- Timestamp:
- 09/01/2017 12:13:01 PM (9 years ago)
- Location:
- trunk/src/scriptbuilder
- Files:
-
- 7 edited
-
gui/IncidentEditorFrame.java (modified) (8 diffs)
-
gui/IncidentPaletteFrame.java (modified) (1 diff)
-
gui/ScriptBuilderFrame.java (modified) (4 diffs)
-
gui/application.properties (modified) (1 diff)
-
gui/panels/IncidentTimelinePanel.java (modified) (1 diff)
-
structures/ScriptIncident.java (modified) (2 diffs)
-
structures/SimulationScript.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/gui/IncidentEditorFrame.java
r98 r103 1 1 /** 2 2 * Frame for the Individual Incident Editor. 3 * 3 * 4 4 * @author Bryan McGuffin 5 5 * @version 2017/08/08 … … 12 12 import java.awt.event.KeyEvent; 13 13 import java.awt.event.KeyListener; 14 import java.awt.event.WindowAdapter; 15 import java.awt.event.WindowEvent; 14 16 import java.io.IOException; 15 17 import java.util.ArrayList; … … 40 42 public class IncidentEditorFrame extends javax.swing.JFrame implements Observer 41 43 { 42 44 43 45 /** 44 46 * The script incident currently being edited. 45 47 */ 46 48 private ScriptIncident theIncident; 47 49 50 private ScriptBuilderFrame parent; 51 52 private int savedOffset; 53 48 54 /** 49 55 * The current type of selected event. … … 232 238 * Constructor. Prep new script model, initialize the GUI, and add listeners 233 239 * for all buttons. 234 * 235 * @param theIncidentthe Script Incident which this window will edit.236 */ 237 public IncidentEditorFrame(ScriptIncident theIncident)240 * 241 * @param inc the Script Incident which this window will edit. 242 */ 243 public IncidentEditorFrame(ScriptIncident inc, ScriptBuilderFrame topFrame) 238 244 { 239 this.theIncident = theIncident; 245 this.theIncident = inc; 246 this.savedOffset = this.theIncident.offset; 247 this.theIncident.setOffset(0); 248 this.parent = topFrame; 240 249 initComponents(); 241 this.update(null, theIncident); 250 251 timelineTickPanel.update(theIncident, incidentTimelinePanel1); 252 timeStampPanel.update(theIncident, incidentTimelinePanel1); 253 254 incidentTimelinePanel1.timelinePanelUpdate(theIncident); 255 256 incidentNumberPanel1.update(theIncident); 242 257 selectButton.addKeyListener(new TimelineKeyListener()); 243 258 cadButton.addKeyListener(new TimelineKeyListener()); … … 261 276 // zoomSlider.setValue(zoomSlider.getValue() - 1); 262 277 // zoomSlider.setValue(zoomSlider.getValue() + 1); 263 264 278 // Set listener for scroll pane 265 279 AdjustmentListener listener = new MyAdjustmentListener(); … … 287 301 eventButtons.add(facilitatorEvalButton); 288 302 eventButtons.add(radioEvalButton); 289 290 incidentNumber.setText(""+this.theIncident.number); 291 incidentName.setText(""+this.theIncident.name); 292 incidentDescription.setText(""+this.theIncident.description); 303 304 this.addWindowListener(new WindowAdapter() 305 { 306 @Override 307 public void windowClosing(WindowEvent e) 308 { 309 theIncident.setOffset(savedOffset); 310 parent.returnFocus(); 311 } 312 }); 313 314 incidentNumber.setText("" + this.theIncident.number); 315 incidentName.setText("" + this.theIncident.name); 316 incidentDescription.setText("" + this.theIncident.description); 293 317 zoomSlider.setValue(zoomSlider.getMinimum()); 318 this.update(null, this.theIncident); 294 319 } 295 320 … … 310 335 { 311 336 theIncident = (ScriptIncident) arg; 312 337 313 338 timelineTickPanel.update(theIncident, incidentTimelinePanel1); 314 339 timeStampPanel.update(theIncident, incidentTimelinePanel1); … … 329 354 { 330 355 TimeSlice slice = ((SliceChangedEvent) arg).slice; 331 356 332 357 DefaultListModel model = new DefaultListModel(); 333 358 for (I_ScriptEvent e : slice.events) -
trunk/src/scriptbuilder/gui/IncidentPaletteFrame.java
r82 r103 376 376 if (script.addIncident(newInc)) 377 377 { 378 new IncidentEditorFrame(newInc ).setVisible(true);378 new IncidentEditorFrame(newInc, parent).setVisible(true); 379 379 this.dispose(); 380 380 } -
trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java
r100 r103 25 25 import javax.swing.UIManager; 26 26 import javax.swing.UnsupportedLookAndFeelException; 27 import javax.swing.event.ChangeEvent; 27 28 import scriptbuilder.gui.panels.IncidentTimelinePanel; 28 29 import scriptbuilder.structures.ScriptEvent; … … 1537 1538 script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60); 1538 1539 script.numberOfIncidents++; 1539 new IncidentEditorFrame(script.incidents.get(indx) ).setVisible(true);1540 new IncidentEditorFrame(script.incidents.get(indx), this).setVisible(true); 1540 1541 } 1541 1542 else//editing existing incident … … 1726 1727 }//GEN-LAST:event_incidentDetailsActionPerformed 1727 1728 1729 public void returnFocus() 1730 { 1731 zoomSlider.setValue(zoomSlider.getMinimum()); 1732 zoomSliderStateChanged(new ChangeEvent(script)); 1733 } 1734 1728 1735 public void incidentDetailsScreen(ScriptIncident i) 1729 1736 { … … 1994 2001 if (inc != null) 1995 2002 { 1996 IncidentEditorFrame editor = new IncidentEditorFrame(inc );2003 IncidentEditorFrame editor = new IncidentEditorFrame(inc, this); 1997 2004 script.addObserver(editor); 1998 2005 editor.setVisible(true); -
trunk/src/scriptbuilder/gui/application.properties
r81 r103 1 #Fri, 25 Aug 2017 15:31:58-07001 #Fri, 01 Sep 2017 13:13:39 -0700 2 2 3 3 Application.revision=0 -
trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
r101 r103 147 147 if (e.getActionCommand().equals("Edit Events")) 148 148 { 149 IncidentEditorFrame editor = new IncidentEditorFrame(incident );149 IncidentEditorFrame editor = new IncidentEditorFrame(incident, (ScriptBuilderFrame)topFrame); 150 150 script.addObserver(editor); 151 151 editor.setVisible(true); -
trunk/src/scriptbuilder/structures/ScriptIncident.java
r76 r103 157 157 int old = this.offset; 158 158 this.offset = offset; 159 TreeMap<Integer, TimeSlice> newSlices = new TreeMap<Integer, TimeSlice>(); 160 161 for(Integer k : slices.keySet()) 162 { 163 newSlices.put(k + (offset - old), slices.get(k)); 164 } 159 165 160 166 for (TimeSlice ts : slices.values()) … … 162 168 ts.shift(offset - old); 163 169 } 170 171 slices = newSlices; 164 172 165 173 script.update(); -
trunk/src/scriptbuilder/structures/SimulationScript.java
r83 r103 5 5 import java.io.File; 6 6 import java.io.FileWriter; 7 import java.io.OutputStream;8 import java.io.OutputStreamWriter;9 7 import java.util.ArrayList; 10 8 import java.util.List; 11 9 import java.util.Observable; 12 import java.util.Random;13 10 import java.util.Vector; 14 import java.util.logging.Level;15 import java.util.logging.Logger;16 import javax.xml.parsers.ParserConfigurationException;17 11 import javax.xml.parsers.SAXParserFactory; 18 import scriptbuilder.structures.ScriptEvent.ScriptEventType;19 12 import scriptbuilder.structures.ScriptIncident.IncidentFocusedEvent; 20 13 import scriptbuilder.structures.ScriptIncident.SliceChangedEvent;
Note: See TracChangeset
for help on using the changeset viewer.
