Changeset 134 in tmcsimulator-scriptbuilder for trunk/src/event/editor
- Timestamp:
- 10/23/2017 05:27:01 PM (9 years ago)
- Location:
- trunk/src/event/editor/frame
- Files:
-
- 4 edited
-
Editor.form (modified) (1 diff)
-
Editor.java (modified) (5 diffs)
-
Properties.java (modified) (2 diffs)
-
PropertyModel.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/frame/Editor.form
r119 r134 161 161 <Property name="text" type="java.lang.String" value="Audio"/> 162 162 </Properties> 163 <Events> 164 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="AudioActionPerformed"/> 165 </Events> 163 166 </MenuItem> 164 167 <MenuItem class="javax.swing.JMenuItem" name="CADLog"> -
trunk/src/event/editor/frame/Editor.java
r130 r134 28 28 private PropertyModel model = new PropertyModel(); 29 29 30 // public PropertyModel getPropertyModel()31 // {32 // return model;33 // }34 30 public void addEvent(Properties property, I_ScriptEvent se) 35 31 { … … 69 65 if (src.isSelected()) 70 66 { 71 model.addEvent Panel(property, new CCTVEvent());67 model.addEventFromDropdown(property, incident, slice); 72 68 } 73 69 else … … 83 79 { 84 80 JMenuItem src = (JMenuItem) evt.getSource(); 85 model.addEventPanel(Properties.valueOf(src.getText().replaceAll(" ", "")), new CCTVEvent()); 81 Properties property = Properties.valueOf(src.getText().replaceAll(" ", "")); 82 model.addEventFromDropdown(property, incident, slice); 86 83 } 87 84 }; … … 356 353 Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N 357 354 Audio.setText("Audio"); 355 Audio.addActionListener(new java.awt.event.ActionListener() 356 { 357 public void actionPerformed(java.awt.event.ActionEvent evt) 358 { 359 AudioActionPerformed(evt); 360 } 361 }); 358 362 menuAutoData.add(Audio); 359 363 … … 461 465 462 466 }//GEN-LAST:event_btnRemoveCurrentEventActionPerformed 467 468 private void AudioActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_AudioActionPerformed 469 {//GEN-HEADEREND:event_AudioActionPerformed 470 // TODO add your handling code here: 471 }//GEN-LAST:event_AudioActionPerformed 463 472 464 473 private void updateEventTime() -
trunk/src/event/editor/frame/Properties.java
r93 r134 6 6 import java.awt.Image; 7 7 import java.awt.image.BufferedImage; 8 import scriptbuilder.structures.ScriptEvent; 9 import scriptbuilder.structures.ScriptEvent; 10 import scriptbuilder.structures.events.*; 11 import scriptbuilder.structures.events.I_ScriptEvent; 8 12 9 13 public enum Properties 10 14 { 11 15 ATMS ("ATMS", PropertyTypes.Optional, 12 loadImage(Images.getImage("ATMSEval.png")) ),16 loadImage(Images.getImage("ATMSEval.png")), new ATMSEvaluationEvent()), 13 17 ActivityLog ("Activity Log", PropertyTypes.Optional, 14 loadImage(Images.getImage("ActivityLogEval.png")) ),18 loadImage(Images.getImage("ActivityLogEval.png")), new ActivityLogEvaluationEvent()), 15 19 CAD ("CAD", PropertyTypes.Optional, 16 loadImage(Images.getImage("CADEval.png")) ),20 loadImage(Images.getImage("CADEval.png")), new CADEvaluationEvent()), 17 21 Facilitator ("Faciliatator", PropertyTypes.Optional, 18 loadImage(Images.getImage("FacilitatorEval.png")) ),22 loadImage(Images.getImage("FacilitatorEval.png")), new FacilitatorEvaluationEvent()), 19 23 Radio ("Radio", PropertyTypes.Optional, 20 loadImage(Images.getImage("RadioEval.png")) ),24 loadImage(Images.getImage("RadioEval.png")), new RadioEvaluationEvent()), 21 25 MaintenanceRadio ("Maintenance Radio", PropertyTypes.Optional, 22 loadImage(Images.getImage("MaintenanceRadio.png")) ),26 loadImage(Images.getImage("MaintenanceRadio.png")), new MaintenanceRadioEvent()), 23 27 TMTRadio ("TMT Radio", PropertyTypes.Optional, 24 loadImage(Images.getImage("TMTRadio.png")) ),28 loadImage(Images.getImage("TMTRadio.png")), new TMTRadioEvent()), 25 29 Telephone ("Telephone", PropertyTypes.Optional, 26 loadImage(Images.getImage("Telephone.png")) ),30 loadImage(Images.getImage("Telephone.png")), new TelephoneEvent()), 27 31 CHPRadio ("CHP Radio",PropertyTypes.Optional, 28 loadImage(Images.getImage("CHPRadio.png")) ),32 loadImage(Images.getImage("CHPRadio.png")), new CHPRadioEvent()), 29 33 CMS ("CMS", PropertyTypes.Multiple, 30 loadImage(Images.getImage("CMSEval.png")) ),34 loadImage(Images.getImage("CMSEval.png")), new CMSEvaluationEvent()), 31 35 Audio ("Audio", PropertyTypes.Multiple, 32 loadImage(Images.getImage("Audio.png")) ),36 loadImage(Images.getImage("Audio.png")), new AudioEvent()), 33 37 CCTV ("CCTV", PropertyTypes.Multiple, 34 loadImage(Images.getImage("CCTV.png")) ),38 loadImage(Images.getImage("CCTV.png")), new CCTVEvent()), 35 39 CADLog ("CAD Log", PropertyTypes.Multiple, 36 loadImage(Images.getImage("CAD.png")) ),40 loadImage(Images.getImage("CAD.png")), new CADEvent()), 37 41 Paramics ("Paramics", PropertyTypes.Multiple, 38 loadImage(Images.getImage("Paramics.png")) ),42 loadImage(Images.getImage("Paramics.png")), new ParamicsEvent()), 39 43 Tow ("Tow", PropertyTypes.Multiple, 40 loadImage(Images.getImage("Tow.png")) ),44 loadImage(Images.getImage("Tow.png")), new TowEvent()), 41 45 Unit ("Unit", PropertyTypes.Multiple, 42 loadImage(Images.getImage("Unit.png")) ),46 loadImage(Images.getImage("Unit.png")), new UnitEvent()), 43 47 Witness ("Witness", PropertyTypes.Multiple, 44 loadImage(Images.getImage("Witness.png")) );48 loadImage(Images.getImage("Witness.png")), new WitnessEvent()); 45 49 46 50 private String title; 47 51 private PropertyTypes type; 48 52 private ImageIcon image; 53 private I_ScriptEvent sevt; 49 54 50 private Properties(String theTitle, PropertyTypes theType, ImageIcon theImage )55 private Properties(String theTitle, PropertyTypes theType, ImageIcon theImage, I_ScriptEvent se) 51 56 { 52 57 title = theTitle; 53 58 type = theType; 54 59 image = theImage; 60 sevt = se; 55 61 } 56 62 … … 58 64 { 59 65 return title; 66 } 67 68 public I_ScriptEvent getEvent() 69 { 70 return ScriptEvent.factoryByType(sevt.getScriptEventType()); 60 71 } 61 72 -
trunk/src/event/editor/frame/PropertyModel.java
r130 r134 23 23 import java.util.TreeMap; 24 24 import javax.swing.JPanel; 25 import scriptbuilder.structures.ScriptIncident; 26 import scriptbuilder.structures.TimeSlice; 25 27 import scriptbuilder.structures.events.I_ScriptEvent; 26 28 … … 82 84 } 83 85 } 86 87 public void addEventFromDropdown(Properties property, ScriptIncident inc, TimeSlice ts) 88 { 89 try 90 { 91 I_ScriptEvent se = property.getEvent(); 92 93 inc.addNewEvent(se, ts.getTime()); 94 95 JPanel panel = (JPanel) classMap.get(property).newInstance(); 96 97 final PropertyPanel propertyPanel = properties.addPropertyPanel(property, panel); 98 if (panel instanceof I_ScriptEventEditorPanel) 99 { 100 eventMap.put(panel, se); 101 ((I_ScriptEventEditorPanel) panel).getEventObject(se); 102 } 103 } 104 catch (Exception e) 105 { 106 System.err.println("Could not create panel of type \"" + property + "\""); 107 } 108 } 84 109 85 110 public void removeProperty(Properties property)
Note: See TracChangeset
for help on using the changeset viewer.
