Changeset 123 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder


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.

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

Legend:

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

    r117 r123  
    15441544            script.numberOfIncidents++; 
    15451545            IncidentEditorFrame editor = new IncidentEditorFrame(script.incidents.get(indx), this); 
    1546              
     1546 
    15471547            editor.setVisible(true); 
    15481548        } 
     
    16161616 
    16171617        addIncidentName.setText(""); 
    1618          
     1618 
    16191619        int newLogNum = 100; 
    16201620        boolean found = false; 
     
    16331633                } 
    16341634            } 
    1635         }  
    1636          
     1635        } 
     1636 
    16371637        addIncidentNumber.setValue(newLogNum); 
    16381638        addIncidentStart.setValue(0); 
     
    18371837                incidentList, 
    18381838                script.incidents.get(0)); 
     1839        if (result == null) 
     1840        { 
     1841            return; 
     1842        } 
    18391843        input = result.toString(); 
    18401844        int i = 0; 
  • 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.