Changeset 53 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/drawers


Ignore:
Timestamp:
08/09/2017 10:03:37 AM (9 years ago)
Author:
bmcguffin
Message:

Duplicated main ScriptBuilder? window. The new window will become the Incident Editor window (see Storyboard 2a-B). The main ScriptBuilder? window will become the Incident Combiner window (see storyboard 1a-B).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/drawers/IncidentTimelineDrawer.java

    r1 r53  
    4141        } 
    4242    } 
     43 
     44    /** 
     45     * Draw the incident line. Then, utilize TimeSliceDrawer to draw the 
     46     * timeslices. 
     47     * 
     48     * @param g2d the graphics component 
     49     * @param incident the incident to be drawn 
     50     */ 
     51    public static void DrawScriptBuilderTimeline(Graphics2D g2d, 
     52            ScriptIncident incident) 
     53    { 
     54        // Draw the timeline 
     55        g2d.setColor(incident.color); 
     56        g2d.fillRect(incident.offset / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
     57                * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK, 
     58                ScriptBuilderGuiConstants.TIMELINE_TOP_MARGIN, 
     59                incident.length / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
     60                * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK, 
     61                ScriptBuilderGuiConstants.TIMELINE_HEIGHT); 
     62 
     63        // Draw each time slice 
     64        for (TimeSlice slice : incident.getSlices()) 
     65        { 
     66            TimeSliceDrawer.DrawScriptBuilderTimeSlice(g2d, slice); 
     67        } 
     68    } 
    4369} 
  • trunk/src/scriptbuilder/gui/drawers/TimeSliceDrawer.java

    r7 r53  
    9696        } 
    9797    } 
     98     
     99    /** 
     100     * Draw the events in this timeslice. If any exist, draw the slice event 
     101     * image. If the incident isn't collapsed, draw the event icons as well. 
     102     * 
     103     * @param g2d the graphics component 
     104     * @param slice the timeSlice to draw 
     105     * @param collapsed if true, don't draw the event icons 
     106     */ 
     107    public static void DrawScriptBuilderTimeSlice(Graphics2D g2d, TimeSlice slice) 
     108    { 
     109        // If this is an empty slice, return 
     110        if (slice.events.size() == 0) 
     111        { 
     112            return; 
     113        } 
     114 
     115        // Draw the slice event icon to show that there are events here 
     116        g2d.drawImage(getSliceEventImage(), slice.getX() 
     117                - ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 
     118                ScriptBuilderGuiConstants.TIMELINE_EVENT_ICON_MARGIN, null); 
     119    } 
    98120} 
Note: See TracChangeset for help on using the changeset viewer.