- if(i == 5) {
- facemenuItem.setText("E 面");
- facemenuItem.setName(i + "");
- }
- if(i == 6) {
- facemenuItem.setText("F 面");
- facemenuItem.setName(i + "");
- }
- menus[i - 1] = facemenuItem;
- facemenuItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- List elements = dataBox.getSelectionModel().getAllSelectedElement();
- if(elements.size() == 1) {
- int currentFaceIndex = Integer.parseInt(((JMenuItem)e.getSource()).getName());
- faceMenu.setCurrentFaceIndex(currentFaceIndex);
- Element element = ((Element)elements.get(0));
- element.putClientProperty(EquipmentAppletConstant.TAG_FACEINDEX, currentFaceIndex);
- faceButton.setText(getLabelForFace(currentFaceIndex) + ":" + getLabelForFace(faceMenu.getFaceCount()) + " ");
- EquipmentLocationUtil.changeVisibleByFace(element, currentFaceIndex);
- }
- }
- });
- }
复制代码 |