Changeset 88 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/gui/panels/OverviewWinSpike.java


Ignore:
Timestamp:
08/28/2017 01:17:11 PM (9 years ago)
Author:
jdalbey
Message:

IncidentTimelinePanel?.java: Added right-click context menu ("popup") with stubbed out functionality.

File:
1 edited

Legend:

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

    r86 r88  
    22 
    33import java.awt.BorderLayout; 
     4import java.awt.Color; 
     5import java.awt.Component; 
     6import java.awt.FlowLayout; 
     7import java.awt.GridLayout; 
    48import java.io.File; 
     9import javax.swing.BorderFactory; 
     10import javax.swing.Box; 
    511import javax.swing.BoxLayout; 
    612import javax.swing.JFrame; 
     
    3137 
    3238        TimelineTickPanel pnl = new TimelineTickPanel(); 
    33         pnl.setLayout(new BoxLayout(pnl, BoxLayout.PAGE_AXIS)); 
     39        //pnl.setLayout(new BoxLayout(pnl, BoxLayout.PAGE_AXIS)); 
     40        //pnl.setLayout(new FlowLayout()); 
     41        pnl.setLayout(new BorderLayout()); 
    3442        // Create a script 
    3543        File inFile = new File("test/scriptbuilder/structures/test_input_file.xml"); 
     
    3745        script.loadScriptFromFile(inFile); 
    3846        ScriptIncident incident = script.incidents.get(2); 
     47         
    3948        IncidentNumberPanel inciNum = new IncidentNumberPanel(); 
    4049        inciNum.update(incident); 
    41         JPanel row1 = new JPanel(); 
    42         row1.setOpaque(false);  // so tick lines will show through 
     50        // Create yellow border during development for easy visualization 
     51        inciNum.setBorder(BorderFactory.createLineBorder(Color.yellow));  
     52 
     53        IncidentNumberPanel inciNum2 = new IncidentNumberPanel(); 
     54        inciNum2.update(script.incidents.get(3)); 
     55        //inciNum2.setSize(100,200); 
     56         
     57        //Box col1 = new Box(BoxLayout.PAGE_AXIS); 
     58        JPanel col1 = new JPanel(new GridLayout(9,1)); 
     59        col1.setOpaque(false);  // so tick lines will show throughut 
     60        col1.setAlignmentX(Component.LEFT_ALIGNMENT); 
    4361        //row1.setSize(200, 500); 
    44         row1.add(inciNum); 
     62        col1.add(inciNum); 
     63        col1.add(inciNum2); 
     64        col1.add(Box.createVerticalGlue()); 
     65         
     66        Box col2 = new Box(BoxLayout.PAGE_AXIS); 
     67        col2.setOpaque(false);  // so tick lines will show throughut 
     68        col2.setAlignmentX(Component.LEFT_ALIGNMENT); 
     69         
    4570        RangeSlider slider = new RangeSlider(0,25); 
    4671        slider.setValue(5); 
    4772        slider.setUpperValue(10); 
    48         row1.add(slider); 
    49         pnl.add(row1); 
     73        slider.setAlignmentX(Component.LEFT_ALIGNMENT); 
     74        RangeSlider slider2 = new RangeSlider(0,25); 
     75        slider2.setValue(5); 
     76        slider2.setUpperValue(10); 
     77        slider2.setAlignmentX(Component.LEFT_ALIGNMENT); 
     78         
     79        col2.add(Box.createVerticalStrut(50)); 
     80        col2.add(slider); 
     81        col2.add(Box.createVerticalStrut(50)); 
     82        col2.add(slider2); 
     83 
     84        pnl.add(col1, BorderLayout.LINE_START); 
     85        pnl.add(col2, BorderLayout.CENTER); 
     86         
    5087        // update this panel with the script 
    5188        pnl.update(script); 
Note: See TracChangeset for help on using the changeset viewer.