public abstract class AbstractSpaceTimePlot extends AbstractBoundedPlot
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT| Constructor and Description |
|---|
AbstractSpaceTimePlot(String caption,
Duration updateInterval,
OTSSimulatorInterface simulator,
Duration delay,
Time initialEnd)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Length |
getEndLocation()
Returns the total path length.
|
void |
setAutoBoundDomain(XYPlot plot)
Overridable; activates auto bounds on domain axis from user input.
|
void |
setAutoBoundRange(XYPlot plot)
Overridable; activates auto bounds on range axis from user input.
|
protected void |
setChart(JFreeChart chart)
Sets the chart and adds menus and listeners.
|
protected void |
update()
Redraws the plot and schedules the next update.
|
void |
updateFixedDomainRange(boolean fixed)
Update the fixed-ness of the domain range.
|
setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBoundaddChangeListener, encodeAsPng, getCaption, getChart, getGraphType, getGroup, getId, getSimulator, getStatusLabel, getUpdateTime, increaseTime, notifyPlotChange, removeChangeListener, setGroup, setUpdateIntervalpublic AbstractSpaceTimePlot(String caption, Duration updateInterval, OTSSimulatorInterface simulator, Duration delay, Time initialEnd)
caption - String; captionupdateInterval - Duration; regular update interval (simulation time)simulator - OTSSimulatorInterface; simulatordelay - Duration; amount of time that chart runs behind simulation to prevent gaps in the charted datainitialEnd - Time; initial end time of plots, will be expanded if simulation time exceeds itprotected void setChart(JFreeChart chart)
setChart in class AbstractBoundedPlotchart - JFreeChart; chartprotected void update()
update in class AbstractPlotpublic void updateFixedDomainRange(boolean fixed)
fixed - boolean; if true; the domain range will not update when new data becomes available; if false; the domain
range will update to show newly available datapublic final void setAutoBoundDomain(XYPlot plot)
XYPlots,
but the auto bounds command comes from the ChartPanel that this class creates. In case the used plot is a
XYPlot, this method is then invoked. Sub classes with auto domain bounds that work with an XYPlot should
implement this. The method is not abstract as the use of XYPlot is not obligated. This implementation overrides to enable it's own form of auto bounds.setAutoBoundDomain in class AbstractBoundedPlotplot - XYPlot; plotpublic final void setAutoBoundRange(XYPlot plot)
XYPlots,
but the auto bounds command comes from the ChartPanel that this class creates. In case the used plot is a
XYPlot, this method is then invoked. Sub classes with auto range bounds that work with an XYPlot should
implement this. The method is not abstract as the use of XYPlot is not obligated. This implementation overrides to enable it's own form of auto bounds.setAutoBoundRange in class AbstractBoundedPlotplot - XYPlot; plotprotected abstract Length getEndLocation()
Copyright © 2014–2019 Delft University of Technology. All rights reserved.