| Revision 53,
1.4 KB
checked in by bmcguffin, 9 years ago
(diff) |
|
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).
|
| Rev | Line | |
|---|
| 1 | package scriptbuilder.gui.panels; |
|---|
| 2 | |
|---|
| 3 | import java.awt.Graphics; |
|---|
| 4 | import java.awt.Graphics2D; |
|---|
| 5 | import java.util.List; |
|---|
| 6 | import javax.swing.JPanel; |
|---|
| 7 | import scriptbuilder.structures.SimulationScript; |
|---|
| 8 | |
|---|
| 9 | /** |
|---|
| 10 | * Represents the underlying panel for the main GUI timeline. Contains all the |
|---|
| 11 | * timeline panels which sit on top of each other. May be unused in current |
|---|
| 12 | * implementation. |
|---|
| 13 | * |
|---|
| 14 | * @author Greg Eddington <geddingt@calpoly.edu> |
|---|
| 15 | * @author Bryan McGuffin |
|---|
| 16 | */ |
|---|
| 17 | public class IncidentsPanel extends JPanel |
|---|
| 18 | { |
|---|
| 19 | |
|---|
| 20 | private SimulationScript script; |
|---|
| 21 | private TimelineTickPanel timelineTickPanel; |
|---|
| 22 | private List<ScriptBuilderTimelinePanel> incidentPanels; |
|---|
| 23 | private List<ScriptBuilderNumberPanel> numberPanels; |
|---|
| 24 | |
|---|
| 25 | /** |
|---|
| 26 | * Install the script model into this object. |
|---|
| 27 | * |
|---|
| 28 | * @param script |
|---|
| 29 | */ |
|---|
| 30 | public void setScript(SimulationScript script) |
|---|
| 31 | { |
|---|
| 32 | this.script = script; |
|---|
| 33 | |
|---|
| 34 | timelineTickPanel.update(script); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * Constructor. Set up new timeline tick panel. |
|---|
| 39 | */ |
|---|
| 40 | public IncidentsPanel() |
|---|
| 41 | { |
|---|
| 42 | super(); |
|---|
| 43 | |
|---|
| 44 | timelineTickPanel = new TimelineTickPanel(); |
|---|
| 45 | this.add(timelineTickPanel); |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | /** |
|---|
| 49 | * Refresh the timelineTickPanel. |
|---|
| 50 | * |
|---|
| 51 | * @param g Graphics component |
|---|
| 52 | */ |
|---|
| 53 | @Override |
|---|
| 54 | public void paint(Graphics g) |
|---|
| 55 | { |
|---|
| 56 | super.paint(g); |
|---|
| 57 | |
|---|
| 58 | Graphics2D g2d = (Graphics2D) g; |
|---|
| 59 | timelineTickPanel.paint(g); |
|---|
| 60 | } |
|---|
| 61 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.