Changeset 130 in tmcsimulator-scriptbuilder for trunk/src/event
- Timestamp:
- 10/23/2017 08:58:34 AM (9 years ago)
- Location:
- trunk/src/event/editor
- Files:
-
- 16 edited
-
AudioPanel.java (modified) (4 diffs)
-
CADLogPanel.java (modified) (2 diffs)
-
CCTVPanel.java (modified) (1 diff)
-
CHPRadioPanel.java (modified) (2 diffs)
-
CMSEvaluationPanel.java (modified) (3 diffs)
-
GenericEvaluationPanel.java (modified) (1 diff)
-
I_ScriptEventEditorPanel.java (modified) (2 diffs)
-
MaintenanceRadioPanel.java (modified) (2 diffs)
-
ParamicsPanel.java (modified) (6 diffs)
-
TMTRadioPanel.java (modified) (2 diffs)
-
TelephonePanel.java (modified) (1 diff)
-
TowPanel.java (modified) (3 diffs)
-
UnitPanel.java (modified) (5 diffs)
-
WitnessPanel.java (modified) (4 diffs)
-
frame/Editor.java (modified) (2 diffs)
-
frame/PropertyModel.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/AudioPanel.java
r92 r130 23 23 { 24 24 initComponents(); 25 26 25 } 27 26 … … 32 31 audioFileText.setText(event.audioPath); 33 32 audioLengthText.setText(event.audioLength.toString()); 34 audioFileText.addKeyListener(new KeyListener()35 {36 37 public void keyTyped(KeyEvent e)38 {39 }40 41 public void keyPressed(KeyEvent e)42 {43 if (e.getKeyCode() == KeyEvent.VK_ENTER)44 {45 event.audioPath = audioFileText.getText();46 }47 }48 49 public void keyReleased(KeyEvent e)50 {51 }52 });53 audioLengthText.addKeyListener(new KeyListener()54 {55 56 public void keyTyped(KeyEvent e)57 {58 }59 60 public void keyPressed(KeyEvent e)61 {62 if (e.getKeyCode() == KeyEvent.VK_ENTER)63 {64 try65 {66 event.audioLength = Integer.parseInt(audioLengthText.getText());67 }68 catch (Exception ex)69 {70 71 }72 }73 }74 75 public void keyReleased(KeyEvent e)76 {77 }78 }79 );80 33 } 81 34 … … 85 38 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 86 39 } 87 40 88 41 @Override 89 42 public boolean removeAssociatedEvent() … … 92 45 event = null; 93 46 return true; 47 } 48 49 @Override 50 public void uponClose() 51 { 52 event.audioPath = audioFileText.getText(); 53 try 54 { 55 event.audioLength = Integer.parseInt(audioLengthText.getText()); 56 } 57 catch (Exception ex) 58 { 59 60 } 94 61 } 95 62 -
trunk/src/event/editor/CADLogPanel.java
r92 r130 33 33 event = (CADEvent) sei; 34 34 CadTextField.setText(event.detail); 35 CadTextField.addKeyListener(new KeyListener()36 {37 38 public void keyTyped(KeyEvent e)39 {40 }41 42 public void keyPressed(KeyEvent e)43 {44 if (e.getKeyCode() == KeyEvent.VK_ENTER)45 {46 event.detail = CadTextField.getText();47 }48 }49 50 public void keyReleased(KeyEvent e)51 {52 }53 });54 35 } 55 36 … … 66 47 event = null; 67 48 return true; 49 } 50 51 @Override 52 public void uponClose() 53 { 54 event.detail = CadTextField.getText(); 68 55 } 69 56 -
trunk/src/event/editor/CCTVPanel.java
r92 r130 75 75 event = null; 76 76 return true; 77 } 78 79 @Override 80 public void uponClose() 81 { 82 //No change is yet necessary. This panel is not yet implemented. 77 83 } 78 84 -
trunk/src/event/editor/CHPRadioPanel.java
r92 r130 36 36 event = (CHPRadioEvent) sei; 37 37 audioText.setText(event.radioFile); 38 audioText.addKeyListener(new KeyListener() 39 { 40 41 public void keyTyped(KeyEvent e) 42 { 43 } 44 45 public void keyPressed(KeyEvent e) 46 { 47 if (e.getKeyCode() == KeyEvent.VK_ENTER) 48 { 49 event.radioFile = audioText.getText(); 50 } 51 } 52 53 public void keyReleased(KeyEvent e) 54 { 55 } 56 }); 38 57 39 for (int i = 0; i < event.lines.size(); i++) 58 40 { … … 108 90 event = null; 109 91 return true; 92 } 93 94 @Override 95 public void uponClose() 96 { 97 event.radioFile = audioText.getText(); 110 98 } 111 99 -
trunk/src/event/editor/CMSEvaluationPanel.java
r92 r130 35 35 event = (CMSEvaluationEvent) sei; 36 36 txtID.setText(event.cmsID); 37 txtID.addKeyListener(new KeyListener() 38 { 39 40 @Override 41 public void keyTyped(KeyEvent e) 42 { 43 } 44 45 @Override 46 public void keyPressed(KeyEvent e) 47 { 48 if (e.getKeyCode() == KeyEvent.VK_ENTER) 49 { 50 event.cmsID = txtID.getText(); 51 } 52 } 53 54 @Override 55 public void keyReleased(KeyEvent e) 56 { 57 } 58 }); 37 59 38 txtLocation.setText(event.location); 60 txtLocation.addKeyListener(new KeyListener() 61 { 62 63 @Override 64 public void keyTyped(KeyEvent e) 65 { 66 } 67 68 @Override 69 public void keyPressed(KeyEvent e) 70 { 71 if (e.getKeyCode() == KeyEvent.VK_ENTER) 72 { 73 event.location = txtLocation.getText(); 74 } 75 } 76 77 @Override 78 public void keyReleased(KeyEvent e) 79 { 80 } 81 }); 39 82 40 txtMessage.setText(""); 83 41 for (int i = 0; i < event.message.size(); i++) … … 92 50 } 93 51 } 94 TypeDropdown.addActionListener(new ActionListener() 95 { 96 97 @Override 98 public void actionPerformed(ActionEvent e) 99 { 100 event.cmsType = TypeDropdown.getSelectedItem().toString(); 101 } 102 }); 52 103 53 addButton.addActionListener(new ActionListener() 104 54 { … … 139 89 event = null; 140 90 return true; 91 } 92 93 @Override 94 public void uponClose() 95 { 96 event.cmsID = txtID.getText(); 97 event.location = txtLocation.getText(); 98 event.cmsType = TypeDropdown.getSelectedItem().toString(); 141 99 } 142 100 -
trunk/src/event/editor/GenericEvaluationPanel.java
r92 r130 84 84 } 85 85 86 @Override 87 public void uponClose() 88 { 89 //No change is necessary here; this panel saves its state continually 90 } 91 86 92 /** 87 93 * This method is called from within the constructor to initialize the form. -
trunk/src/event/editor/I_ScriptEventEditorPanel.java
r92 r130 23 23 void getEventObject(I_ScriptEvent sei); 24 24 25 /**25 /** 26 26 * Remove the event associated with this panel. 27 27 * … … 29 29 */ 30 30 boolean removeAssociatedEvent(); 31 32 /** 33 * Action to take when the panel closes. 34 */ 35 void uponClose(); 31 36 } -
trunk/src/event/editor/MaintenanceRadioPanel.java
r92 r130 27 27 event = (MaintenanceRadioEvent) sei; 28 28 jTextArea1.setText(event.message); 29 jTextArea1.addKeyListener(new KeyListener()30 {31 32 public void keyTyped(KeyEvent e)33 {34 }35 36 public void keyPressed(KeyEvent e)37 {38 if (e.getKeyCode() == KeyEvent.VK_ENTER)39 {40 event.message = jTextArea1.getText();41 }42 }43 44 public void keyReleased(KeyEvent e)45 {46 }47 });48 29 } 49 30 … … 52 33 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 53 34 } 54 35 55 36 @Override 56 37 public boolean removeAssociatedEvent() 57 38 { 58 ((I_ScriptEvent) event).removeThis();39 ((I_ScriptEvent) event).removeThis(); 59 40 event = null; 60 41 return true; 42 } 43 44 @Override 45 public void uponClose() 46 { 47 event.message = jTextArea1.getText(); 61 48 } 62 49 -
trunk/src/event/editor/ParamicsPanel.java
r92 r130 17 17 private ActionListener removeListener; 18 18 private ParamicsEvent event; 19 ArrayList<JCheckBox> lanes = new ArrayList<JCheckBox>(); 19 20 20 21 /** … … 45 46 LocationDropdown.setSelectedItem(LocationDropdown.getItemCount() - 1); 46 47 } 47 LocationDropdown.addActionListener(new ActionListener() 48 { 49 50 @Override 51 public void actionPerformed(ActionEvent e) 52 { 53 event.locationID = LocationDropdown.getSelectedItem().toString(); 54 } 55 }); 48 56 49 for (int i = 0; i < StatusDropdown.getItemCount(); i++) 57 50 { … … 61 54 } 62 55 } 63 StatusDropdown.addActionListener(new ActionListener() 64 { 65 66 @Override 67 public void actionPerformed(ActionEvent e) 68 { 69 event.status = StatusDropdown.getSelectedItem().toString(); 70 } 71 }); 56 72 57 for (int i = 0; i < TypeDropdown.getItemCount(); i++) 73 58 { … … 77 62 } 78 63 } 79 TypeDropdown.addActionListener(new ActionListener() 80 { 81 82 @Override 83 public void actionPerformed(ActionEvent e) 84 { 85 event.type = TypeDropdown.getSelectedItem().toString(); 86 } 87 }); 88 ArrayList<JCheckBox> lanes = new ArrayList<JCheckBox>(); 64 89 65 lanes.add(jCheckBox1); 90 66 lanes.add(jCheckBox2); … … 108 84 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 109 85 } 110 86 111 87 @Override 112 88 public boolean removeAssociatedEvent() … … 115 91 event = null; 116 92 return true; 93 } 94 95 @Override 96 public void uponClose() 97 { 98 event.locationID = LocationDropdown.getSelectedItem().toString(); 99 event.status = StatusDropdown.getSelectedItem().toString(); 100 event.type = TypeDropdown.getSelectedItem().toString(); 101 for (JCheckBox lane : lanes) 102 { 103 lane.getActionListeners()[0].actionPerformed(new ActionEvent(lane, 0, "record")); 104 } 117 105 } 118 106 -
trunk/src/event/editor/TMTRadioPanel.java
r92 r130 27 27 event = (TMTRadioEvent) sei; 28 28 jTextArea1.setText(event.message); 29 jTextArea1.addKeyListener(new KeyListener()30 {31 32 public void keyTyped(KeyEvent e)33 {34 }35 36 public void keyPressed(KeyEvent e)37 {38 if (e.getKeyCode() == KeyEvent.VK_ENTER)39 {40 event.message = jTextArea1.getText();41 }42 }43 44 public void keyReleased(KeyEvent e)45 {46 }47 });48 29 } 49 30 … … 59 40 event = null; 60 41 return true; 42 } 43 44 @Override 45 public void uponClose() 46 { 47 event.message = jTextArea1.getText(); 61 48 } 62 49 -
trunk/src/event/editor/TelephonePanel.java
r92 r130 114 114 event = null; 115 115 return true; 116 } 117 118 @Override 119 public void uponClose() 120 { 121 //No change is necessary here; this panel saves its state continually 116 122 } 117 123 -
trunk/src/event/editor/TowPanel.java
r92 r130 60 60 event = (TowEvent) sei; 61 61 txtCompany.setText(event.towCompany); 62 txtCompany.addKeyListener(new KeyListener() 63 { 64 public void keyTyped(KeyEvent e) 65 { 66 } 67 public void keyPressed(KeyEvent e) 68 { 69 if (e.getKeyCode() == KeyEvent.VK_ENTER) 70 { 71 event.towCompany = txtCompany.getText(); 72 } 73 } 74 public void keyReleased(KeyEvent e) 75 { 76 } 77 }); 62 78 63 txtBeat.setText(event.towBeat); 79 txtBeat.addKeyListener(new KeyListener() 80 { 81 public void keyTyped(KeyEvent e) 82 { 83 } 84 public void keyPressed(KeyEvent e) 85 { 86 if (e.getKeyCode() == KeyEvent.VK_ENTER) 87 { 88 event.towBeat = txtBeat.getText(); 89 } 90 } 91 public void keyReleased(KeyEvent e) 92 { 93 } 94 }); 64 95 65 txtConfirmationNumber.setText("" + event.towConfNum); 96 txtConfirmationNumber.addKeyListener(new KeyListener() 97 { 98 public void keyTyped(KeyEvent e) 99 { 100 } 101 public void keyPressed(KeyEvent e) 102 { 103 if (e.getKeyCode() == KeyEvent.VK_ENTER) 104 { 105 event.towConfNum = txtConfirmationNumber.getText(); 106 } 107 } 108 public void keyReleased(KeyEvent e) 109 { 110 } 111 }); 66 112 67 txtPublicNumber.setText("" + event.towPubNum); 113 txtPublicNumber.addKeyListener(new KeyListener() 114 { 115 public void keyTyped(KeyEvent e) 116 { 117 } 118 public void keyPressed(KeyEvent e) 119 { 120 if (e.getKeyCode() == KeyEvent.VK_ENTER) 121 { 122 event.towPubNum = txtPublicNumber.getText(); 123 } 124 } 125 public void keyReleased(KeyEvent e) 126 { 127 } 128 }); 68 129 69 } 130 70 … … 134 74 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 135 75 } 136 76 137 77 @Override 138 78 public boolean removeAssociatedEvent() … … 141 81 event = null; 142 82 return true; 83 } 84 85 @Override 86 public void uponClose() 87 { 88 event.towCompany = txtCompany.getText(); 89 event.towBeat = txtBeat.getText(); 90 event.towConfNum = txtConfirmationNumber.getText(); 91 event.towPubNum = txtPublicNumber.getText(); 143 92 } 144 93 -
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 -
trunk/src/event/editor/WitnessPanel.java
r92 r130 34 34 txtFirstName.setText(st.nextToken()); 35 35 } 36 txtFirstName.addKeyListener(new KeyListener()37 {38 public void keyTyped(KeyEvent e)39 {40 }41 36 42 public void keyPressed(KeyEvent e)43 {44 if (e.getKeyCode() == KeyEvent.VK_ENTER)45 {46 event.witnessName = txtFirstName.getText() + " " + txtLastName.getText();47 }48 }49 50 public void keyReleased(KeyEvent e)51 {52 }53 });54 37 txtLastName.setText(""); 55 38 while (st.hasMoreTokens()) … … 57 40 txtLastName.setText(txtLastName.getText() + st.nextToken()); 58 41 } 59 txtLastName.addKeyListener(new KeyListener()60 {61 public void keyTyped(KeyEvent e)62 {63 }64 42 65 public void keyPressed(KeyEvent e) 66 { 67 if (e.getKeyCode() == KeyEvent.VK_ENTER) 68 { 69 event.witnessName = txtFirstName.getText() + " " + txtLastName.getText(); 70 } 71 } 43 txtPhoneNumber.setText("" + event.witnessNum); 72 44 73 public void keyReleased(KeyEvent e) 74 { 75 } 76 }); 77 txtPhoneNumber.setText("" + event.witnessNum); 78 txtPhoneNumber.addKeyListener(new KeyListener() 79 { 80 public void keyTyped(KeyEvent e) 81 { 82 } 45 txtAddress.setText(event.witnessAddress); 83 46 84 public void keyPressed(KeyEvent e)85 {86 if (e.getKeyCode() == KeyEvent.VK_ENTER)87 {88 event.witnessNum = txtPhoneNumber.getText();89 }90 }91 92 public void keyReleased(KeyEvent e)93 {94 }95 });96 txtAddress.setText(event.witnessAddress);97 txtAddress.addKeyListener(new KeyListener()98 {99 public void keyTyped(KeyEvent e)100 {101 }102 103 public void keyPressed(KeyEvent e)104 {105 if (e.getKeyCode() == KeyEvent.VK_ENTER)106 {107 event.witnessAddress = txtAddress.getText();108 }109 }110 111 public void keyReleased(KeyEvent e)112 {113 }114 });115 47 } 116 48 … … 120 52 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 121 53 } 122 54 123 55 @Override 124 56 public boolean removeAssociatedEvent() … … 127 59 event = null; 128 60 return true; 61 } 62 63 @Override 64 public void uponClose() 65 { 66 event.witnessName = txtFirstName.getText() + " " + txtLastName.getText(); 67 event.witnessNum = txtPhoneNumber.getText(); 68 event.witnessAddress = txtAddress.getText(); 129 69 } 130 70 -
trunk/src/event/editor/frame/Editor.java
r119 r130 124 124 } 125 125 } 126 126 127 } 127 128 … … 150 151 public void keyReleased(KeyEvent e) 151 152 { 153 } 154 }); 155 this.addWindowListener(new WindowAdapter() 156 { 157 @Override 158 public void windowClosing(WindowEvent e) 159 { 160 //Add previous offset back in 161 //If we didn't adjust the offset, this will just set it to the old value 162 //If we deleted the first event(s), this will add the offsets, 163 //to ensure that events stay at the correct times 164 model.closePanels(); 152 165 } 153 166 }); -
trunk/src/event/editor/frame/PropertyModel.java
r101 r130 93 93 notifyObservers(arg); 94 94 } 95 96 /** 97 * Propagate the window closure. 98 */ 99 public void closePanels() 100 { 101 for(JPanel panel : eventMap.keySet()) 102 { 103 if(panel instanceof I_ScriptEventEditorPanel) 104 { 105 ((I_ScriptEventEditorPanel) panel).uponClose(); 106 } 107 } 108 } 95 109 96 110 /*
Note: See TracChangeset
for help on using the changeset viewer.
