Changeset 130 in tmcsimulator-scriptbuilder for trunk/src/event/editor/UnitPanel.java
- Timestamp:
- 10/23/2017 08:58:34 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/event/editor/UnitPanel.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/UnitPanel.java
r92 r130 51 51 } 52 52 } 53 txtUnitNumber.addKeyListener(new KeyListener() 54 { 55 public void keyTyped(KeyEvent e) 56 { 57 } 58 public void keyPressed(KeyEvent e) 59 { 60 if (e.getKeyCode() == KeyEvent.VK_ENTER) 61 { 62 event.unitNum = txtUnitNumber.getText(); 63 } 64 } 65 public void keyReleased(KeyEvent e) 66 { 67 } 68 }); 69 ActiveDropdown.addActionListener(new ActionListener() 70 { 71 72 public void actionPerformed(ActionEvent e) 73 { 74 event.unitActive = ActiveDropdown.getSelectedItem().toString(); 75 } 76 }); 53 77 54 for (int i = 0; i < PrimaryDropdown.getItemCount(); i++) 78 55 { … … 82 59 } 83 60 } 84 PrimaryDropdown.addActionListener(new ActionListener() 85 { 86 87 public void actionPerformed(ActionEvent e) 88 { 89 event.unitPrimary = PrimaryDropdown.getSelectedItem().toString(); 90 } 91 }); 61 92 62 boolean containsItem = false; 93 63 for (int i = 0; i < StatusDropdown.getItemCount() && !containsItem; i++) … … 104 74 StatusDropdown.setSelectedItem(StatusDropdown.getItemCount() - 1); 105 75 } 106 StatusDropdown.addActionListener(new ActionListener() 107 { 108 109 public void actionPerformed(ActionEvent e) 110 { 111 event.unitStatus = StatusDropdown.getSelectedItem().toString(); 112 } 113 }); 76 114 77 } 115 78 … … 119 82 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 120 83 } 121 84 122 85 @Override 123 86 public boolean removeAssociatedEvent() … … 126 89 event = null; 127 90 return true; 91 } 92 93 @Override 94 public void uponClose() 95 { 96 event.unitNum = txtUnitNumber.getText(); 97 event.unitActive = ActiveDropdown.getSelectedItem().toString(); 98 event.unitPrimary = PrimaryDropdown.getSelectedItem().toString(); 99 event.unitStatus = StatusDropdown.getSelectedItem().toString(); 128 100 } 129 101
Note: See TracChangeset
for help on using the changeset viewer.
