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


Ignore:
Timestamp:
09/07/2017 02:08:40 PM (9 years ago)
Author:
bmcguffin
Message:

Redesigned the method by which the first event in an event is added to relative time 00:00:00.

Added a second timestamp panel to the incident editor screen, which displays absolute script time in red. The original timestamp panel displays time relative to the start of the incident, in black.

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

Legend:

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

    r113 r117  
    243243                if (getTopLevelAncestor() instanceof IncidentEditorFrame) 
    244244                { 
     245                    if (incident.slices.size() == 0) 
     246                    { 
     247                        newSlice = 0; 
     248                    } 
    245249                    if (g.currentEventType != null) 
    246250                    { 
  • trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java

    r115 r117  
    11package scriptbuilder.gui.panels; 
    22 
     3import java.awt.Color; 
    34import java.awt.Dimension; 
    45import java.awt.Graphics; 
     
    2021{ 
    2122 
     23    private int offset = 0; 
     24 
     25    private boolean isAbsolute = false; 
     26 
    2227    private int longestLength = ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH; 
    2328 
     
    3843    { 
    3944        super(); 
     45    } 
     46 
     47    public void setOffset(int newOffset) 
     48    { 
     49        offset = newOffset; 
     50    } 
     51 
     52    public void setAbsolute(boolean abs) 
     53    { 
     54        isAbsolute = abs; 
    4055    } 
    4156 
     
    144159                * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK 
    145160                + ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 
    146         int seconds = 0; 
     161        int seconds = offset; 
    147162 
    148163        // Major Ticks 
    149         g2d.setColor(ScriptBuilderGuiConstants.TIMELINE_TICK_COLOR); 
    150         seconds = 0; 
     164        if (isAbsolute) 
     165        { 
     166            g2d.setColor(Color.red); 
     167        } 
     168        else 
     169        { 
     170            g2d.setColor(ScriptBuilderGuiConstants.TIMELINE_TICK_COLOR); 
     171        } 
    151172        for (int i = ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 
    152173                i <= longestLengthPlusMargin; 
Note: See TracChangeset for help on using the changeset viewer.