Changeset 98 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels


Ignore:
Timestamp:
08/29/2017 10:40:27 AM (9 years ago)
Author:
bmcguffin
Message:

Added "Add 15 minutes" button, btnAddTime, to both Script Builder and Incident Editor windows. Clicking the button allows the user to add 15 minutes of scrollable space to the end of the timeline window, so that new events can be added after the end. This extra time does not interact with the model and so does not enter the save file, or persist between iterations of the program.

Location:
trunk/src/scriptbuilder/gui/panels
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java

    r96 r98  
    6262 
    6363    /** 
     64     * Filler time at the end of the screen for a particular incident 
     65     */ 
     66    public int requestedEditorFillerTime; 
     67 
     68    /** 
     69     * Filler time at the end of the screen for the whole script 
     70     */ 
     71    public static int requestedScriptBuilderFillerTime = 0; 
     72 
     73    /** 
     74     * Constant for amount of filler to add, in seconds. Set to 15 minutes 
     75     */ 
     76    public static final int FILLER_INTERVAL_SECONDS = 900; 
     77 
     78    /** 
    6479     * The map representing the properties of this incident's events. Keys: 
    6580     * event types. Values: Properties objects for those events. 
     
    310325        super(); 
    311326 
     327        requestedEditorFillerTime = 0; 
    312328//        FACILITATOR_EVAL_EVENT, RADIO_EVAL_EVENT 
    313329        eventTypeToPropertyMap = new HashMap(); 
     
    352368        { 
    353369 
    354             newSize = new Dimension(((incident.length + incident.offset) 
    355                     / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
    356                     * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 
    357                     + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 
    358                     ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 
    359                     + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 
     370            if (getTopLevelAncestor() instanceof IncidentEditorFrame) 
     371            { 
     372 
     373                newSize = new Dimension(((incident.length + incident.offset + requestedEditorFillerTime) 
     374                        / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
     375                        * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 
     376                        + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 
     377                        ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 
     378                        + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 
     379            } 
     380            else 
     381            { 
     382                newSize = new Dimension(((incident.length + incident.offset + requestedScriptBuilderFillerTime) 
     383                        / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
     384                        * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 
     385                        + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 
     386                        ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 
     387                        + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 
     388            } 
    360389 
    361390        } 
  • trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java

    r76 r98  
    6161                if ((incident.length + incident.offset) > longestLength) 
    6262                { 
    63                     longestLength = incident.length + incident.offset; 
     63                    longestLength = incident.length + incident.offset + IncidentTimelinePanel.requestedScriptBuilderFillerTime; 
    6464                } 
    6565            } 
     
    9292     * @param incident the incident which this window is editing. 
    9393     */ 
    94     public void update(ScriptIncident incident) 
     94    public void update(ScriptIncident incident, IncidentTimelinePanel timeline) 
    9595    { 
    9696        longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; 
     
    105105            if ((incident.length + incident.offset) > longestLength) 
    106106            { 
    107                 longestLength = incident.length + incident.offset; 
     107                longestLength = incident.length + incident.offset + timeline.requestedEditorFillerTime; 
    108108            } 
    109109        } 
  • trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java

    r76 r98  
    118118                if ((incident.length + incident.offset) > longestLength) 
    119119                { 
    120                     longestLength = incident.length + incident.offset; 
     120                    longestLength = incident.length + incident.offset + IncidentTimelinePanel.requestedScriptBuilderFillerTime; 
    121121                } 
    122122            } 
     
    141141     * @param incident the incident being edited 
    142142     */ 
    143     public void update(ScriptIncident incident) 
     143    public void update(ScriptIncident incident, IncidentTimelinePanel timeline) 
    144144    { 
    145145        longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; 
     
    155155            if ((incident.length + incident.offset) > longestLength) 
    156156            { 
    157                 longestLength = incident.length + incident.offset; 
     157                longestLength = incident.length + incident.offset + timeline.requestedEditorFillerTime; 
    158158            } 
    159159 
Note: See TracChangeset for help on using the changeset viewer.