source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/gui/panels/IncidentsPanel.java @ 1

Revision 1, 1.4 KB checked in by bmcguffin, 9 years ago (diff)

2017/07/18: Uploaded entire prototype to SVN repo.

Line 
1package scriptbuilder.gui.panels;
2
3import java.awt.Graphics;
4import java.awt.Graphics2D;
5import java.util.List;
6import javax.swing.JPanel;
7import 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 */
17public class IncidentsPanel extends JPanel
18{
19
20    private SimulationScript script;
21    private TimelineTickPanel timelineTickPanel;
22    private List<IncidentTimelinePanel> incidentPanels;
23    private List<IncidentNumberPanel> 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.