Changeset 123 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java


Ignore:
Timestamp:
09/19/2017 02:41:52 PM (9 years ago)
Author:
bmcguffin
Message:

Fixed a bug in saveIncidentActionPerformed() which caused a null pointer exception if the user didn't select an incident to save.

Changed the color of the absolute-time TimeStamp? panel to a more neutral color.

Added "Script:" and "Incident:" labels at the beginning of the absolute-time and relative-time TimeStamp? panels, respectively.

File:
1 edited

Legend:

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

    r118 r123  
    66import java.awt.Graphics2D; 
    77import javax.swing.JPanel; 
     8import scriptbuilder.gui.IncidentEditorFrame; 
    89import scriptbuilder.gui.ScriptBuilderGuiConstants; 
    910import scriptbuilder.structures.ScriptIncident; 
     
    151152    { 
    152153        super.paint(g); 
    153  
     154        String title = ""; 
    154155        Graphics2D g2d = (Graphics2D) g; 
    155156        g2d.setFont(ScriptBuilderGuiConstants.TIMELINE_TICK_TIME_FONT); 
     
    160161                + ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 
    161162        int seconds = offset; 
     163        if(getTopLevelAncestor() instanceof IncidentEditorFrame) 
     164        { 
     165            title = "Incident:"; 
     166        } 
    162167 
    163168        // Major Ticks 
    164169        if (isAbsolute) 
    165170        { 
    166             g2d.setColor(Color.red); 
     171            g2d.setColor(Color.getHSBColor(.5f, .9f, .5f)); 
     172            title = "Script:"; 
    167173        } 
    168174        else 
     
    170176            g2d.setColor(ScriptBuilderGuiConstants.TIMELINE_TICK_COLOR); 
    171177        } 
     178        g2d.drawString(title, 0, 18); 
    172179        for (int i = ScriptBuilderGuiConstants.TICK_TIMELINE_LEFT_MARGIN; 
    173180                i <= longestLengthPlusMargin; 
Note: See TracChangeset for help on using the changeset viewer.