Changeset 89 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/IncidentEditorFrame.java


Ignore:
Timestamp:
08/28/2017 01:38:15 PM (9 years ago)
Author:
bmcguffin
Message:

Added dropdown menu item to ScriptBuilderFrame?: "Delete Incident". When clicked, user may select an existing incident to delete. Program will prompt user to confirm the deletion, then remove the incident from the script and refresh the display.

Added button to individual event editor window: "Remove this event". When clicked, the currently displayed event will be removed from the timeslice it is in. The display will be refreshed accordingly. NOTE: This still has some bugs, namely that the last remaining event in a timeslice fails to be deleted.

Restructured Interface ScriptEventEditorPanel? to include a removeAssociatedEvent method, which calls a new method in I_ScriptEvent called removeThis, which causes the event to be removed from its timeslice.

Editor.Java previously contained several classes and enums, none of which were set to private scope. Moved these extra classes to their own files to decrease clutter in Editor.java and increase readability of all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.java

    r81 r89  
    88 
    99import java.awt.Adjustable; 
    10 import java.awt.Color; 
    1110import java.awt.event.AdjustmentEvent; 
    1211import java.awt.event.AdjustmentListener; 
     
    5453     */ 
    5554    private ArrayList<JButton> eventButtons = null; 
    56     /** 
    57      * True if we are currently editing an incident. 
    58      */ 
    59     private boolean editingIncident; 
    60     /** 
    61      * Index of the previous incident. 
    62      */ 
    63     int oldIncidentIndex; 
    6455 
    6556    /** 
     
    127118            } 
    128119 
    129             JButton newButton = null; 
     120            JButton newButton = lastButton; 
    130121            switch (e.getKeyChar()) 
    131122            { 
     
    14701461        addNoiseFrame.setVisible(false); 
    14711462 
    1472         update(null, theIncident); 
     1463        this.update(null, theIncident); 
    14731464}//GEN-LAST:event_jButton2ActionPerformed 
    14741465 
     
    17001691        zoomSlider.setValue(zoomSlider.getValue() <= 5 ? 5 : zoomSlider.getValue() - 1); 
    17011692    }//GEN-LAST:event_zoomOutIconMouseClicked 
    1702     private Color selectedColor = Color.BLACK; 
    17031693 
    17041694    /** 
Note: See TracChangeset for help on using the changeset viewer.