Changeset 53 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels/ScriptBuilderTimelinePanel.java


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).

File:
1 copied

Legend:

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

    r49 r53  
    2929 * @version 2017/06/30 
    3030 */ 
    31 public class IncidentTimelinePanel extends JPanel 
     31public class ScriptBuilderTimelinePanel extends JPanel 
    3232{ 
    3333 
     
    3939     * If true, this panel is in its minimized state. 
    4040     */ 
    41     boolean collapsed; 
     41    //boolean collapsed; 
    4242    /** 
    4343     * If false, this panel won't be drawn. 
     
    198198                    lastSlice = newSlice; 
    199199                    String newToolTip; 
    200                     if (collapsed) 
    201                     { 
    202                         newToolTip = incident.slices.get(newSlice).toString(); 
    203                     } 
    204                     else 
    205                     { 
    206                         newToolTip = incident.slices.get(newSlice).getToolTipText(y); 
    207                     } 
     200 
     201                    newToolTip = incident.slices.get(newSlice).toString(); 
     202 
    208203                    setToolTipText((newToolTip == null || newToolTip.equals("")) 
    209204                            ? null : newToolTip); 
     
    218213     * Constructor. Generates a HashMap of all possible event types. 
    219214     */ 
    220     public IncidentTimelinePanel() 
     215    public ScriptBuilderTimelinePanel() 
    221216    { 
    222217        super(); 
     
    258253    { 
    259254        this.incident = incident; 
    260         if (incident != null) 
    261         { 
    262             this.collapsed = incident.collapsed; 
    263         } 
    264255        this.visible = incident != null; 
    265256 
     
    267258        if (visible) 
    268259        { 
    269             if (collapsed) 
    270             { 
    271                 newSize = new Dimension((incident.length + incident.offset) 
    272                         / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
    273                         * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK, 
    274                         ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT); 
    275             } 
    276             else 
    277             { 
    278                 int mostEvents = 0; 
    279                 for (TimeSlice slice : incident.getSlices()) 
    280                 { 
    281                     if (slice.events.size() > mostEvents) 
    282                     { 
    283                         mostEvents = slice.events.size(); 
    284                     } 
    285                 } 
    286  
    287                 newSize = new Dimension((ScriptBuilderGuiConstants.MAX_SIMULATION_LENGTH) 
    288                         / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
    289                         * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK, 
    290                         ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 
    291                         + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * (mostEvents + 1)); 
    292             } 
     260 
     261            newSize = new Dimension(((incident.length + incident.offset) 
     262                    / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION 
     263                    * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK) 
     264                    + ScriptBuilderGuiConstants.EVENT_ICON_WIDTH, 
     265                    ScriptBuilderGuiConstants.TIMELINE_COLLAPSED_HEIGHT 
     266                    + ScriptBuilderGuiConstants.SCRIPT_EVENT_ICON_STEP * 2); 
     267 
    293268        } 
    294269        else 
     
    319294 
    320295        Graphics2D g2d = (Graphics2D) g; 
    321         IncidentTimelineDrawer.DrawIncidentTimeline(g2d, incident, collapsed); 
     296        IncidentTimelineDrawer.DrawScriptBuilderTimeline(g2d, incident); 
    322297 
    323298        if (focused) 
Note: See TracChangeset for help on using the changeset viewer.