1
2
3
4
5
6
7
8
9
10 package nl.tudelft.simulation.dsol.statistics.charts;
11
12 import java.rmi.RemoteException;
13
14 import nl.tudelft.simulation.dsol.context.ContextUtil;
15 import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
16
17 /***
18 * The XYPlot extends the XYPlot and links this it to the dsol framework <br>
19 * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
20 * University of Technology </a>, the Netherlands. <br>
21 * See for project information <a href="http://www.simulation.tudelft.nl">
22 * www.simulation.tudelft.nl </a> <br>
23 * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
24 * License (GPL) </a>, no warranty <br>
25 *
26 * @version 1.0 18.08.2003 <br>
27 * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
28 * Jacobs </a>
29 */
30 public class XYChart extends nl.tudelft.simulation.jstats.charts.xy.XYChart
31 {
32 /***
33 * constructs a new XYChart
34 *
35 * @param simulator the simulator
36 * @param title the title
37 * @throws RemoteException on network failure
38 */
39 public XYChart(final SimulatorInterface simulator, final String title)
40 throws RemoteException
41 {
42 this(simulator, title, new double[]{0,
43 simulator.getReplication().getRunControl().getRunLength()});
44 }
45
46 /***
47 * constructs a new XYChart
48 *
49 * @param simulator the simulator
50 * @param title the title
51 * @param axisType the axisType to use.
52 * @throws RemoteException on network failure
53 */
54 public XYChart(final SimulatorInterface simulator, final String title,
55 final short axisType) throws RemoteException
56 {
57 this(simulator, title, new double[]{0,
58 simulator.getReplication().getRunControl().getRunLength()},
59 axisType);
60 }
61
62 /***
63 * constructs a new XYChart
64 *
65 * @param simulator the simulator
66 * @param title the title
67 * @param domain the domain
68 */
69 public XYChart(final SimulatorInterface simulator, final String title,
70 final double[] domain)
71 {
72 super(title, domain);
73 ContextUtil.bindToContext(simulator, this);
74 }
75
76 /***
77 * constructs a new XYChart
78 *
79 * @param simulator the simulator
80 * @param title the title
81 * @param domain the domain
82 * @param axisType the axisType to use.
83 */
84 public XYChart(final SimulatorInterface simulator, final String title,
85 final double[] domain, final short axisType)
86 {
87 super(title, domain, axisType);
88 ContextUtil.bindToContext(simulator, this);
89 }
90
91 /***
92 * constructs a new XYChart
93 *
94 * @param simulator the simulator
95 * @param title the title
96 * @param domain the domain
97 * @param range the range
98 */
99 public XYChart(final SimulatorInterface simulator, final String title,
100 final double[] domain, final double[] range)
101 {
102 super(title, domain, range);
103 ContextUtil.bindToContext(simulator, this);
104 }
105
106 /***
107 * constructs a new XYChart
108 *
109 * @param simulator the simulator
110 * @param title the title
111 * @param domain the domain
112 * @param range the range
113 * @param axisType the XYChart.axisType
114 */
115 public XYChart(final SimulatorInterface simulator, final String title,
116 final double[] domain, final double[] range, final short axisType)
117 {
118 super(title, domain, range, axisType);
119 ContextUtil.bindToContext(simulator, this);
120 }
121
122 /***
123 * @see java.lang.Object#toString()
124 */
125 public String toString()
126 {
127 return super.getChart().getTitle().getText();
128 }
129 }