Class AbstractSpaceTimePlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>
java.lang.Object
org.opentrafficsim.animation.graphs.AbstractPlot<S>
org.opentrafficsim.animation.graphs.AbstractBoundedPlot<S>
org.opentrafficsim.animation.graphs.AbstractSpaceTimePlot<S>
- Type Parameters:
S- paint state type
- All Implemented Interfaces:
Identifiable,org.jfree.data.general.Dataset
- Direct Known Subclasses:
AbstractContourPlot,TrajectoryPlot
public abstract class AbstractSpaceTimePlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>
extends AbstractBoundedPlot<S>
Plots with space-time. This class adds some zoom control, where a user can manually select a zoom range, or the plot
automatically zooms over the entire space range, and either the entire or some most recent fixed period in time.
Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Field Summary
Fields inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSpaceTimePlot(String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, org.djunits.value.vdouble.scalar.Duration delay, org.djunits.value.vdouble.scalar.Duration initialEnd) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.djunits.value.vdouble.scalar.LengthReturns the total space.final voidsetAutoBoundDomain(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on domain axis from user input.final voidsetAutoBoundRange(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on range axis from user input.protected voidsetChart(org.jfree.chart.JFreeChart chart) Sets the chart and adds menus and listeners.protected voidSets the paint state in a thread safe manner and notifies the listeners.voidupdateFixedDomainRange(boolean fixed) Update the fixed-ness of the domain range.Methods inherited from class org.opentrafficsim.animation.graphs.AbstractBoundedPlot
setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBoundMethods inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
addChangeListener, calculatePaintState, emptyPaintState, encodeAsPng, getAvailableTime, getCaption, getChart, getGraphType, getGroup, getId, getPaintState, getStatusLabel, invalidate, notifyPlotChange, offerPaintState, offerUpdateInterval, removeChangeListener, setGroup, update
-
Constructor Details
-
AbstractSpaceTimePlot
public AbstractSpaceTimePlot(String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, org.djunits.value.vdouble.scalar.Duration delay, org.djunits.value.vdouble.scalar.Duration initialEnd) Constructor.- Parameters:
caption- captionupdateInterval- regular update interval (simulation time)scheduler- schedulerdelay- amount of time that chart runs behind simulation to prevent gaps in the charted datainitialEnd- initial end time of plots, will be expanded if simulation time exceeds it
-
-
Method Details
-
setChart
protected void setChart(org.jfree.chart.JFreeChart chart) Description copied from class:AbstractPlotSets the chart and adds menus and listeners.- Overrides:
setChartin classAbstractBoundedPlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>- Parameters:
chart- chart
-
setPaintState
protected void setPaintState()Description copied from class:AbstractPlotSets the paint state in a thread safe manner and notifies the listeners. This method is always invoked on the Swing EDT. This method may be overridden to use a newly set paint state (after callingsuper.setPaintState()) to set internal properties. For example, setting the block size of an internal block renderer based on the granularity of the data.- Overrides:
setPaintStatein classAbstractPlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>
-
updateFixedDomainRange
public void updateFixedDomainRange(boolean fixed) Update the fixed-ness of the domain range.- Parameters:
fixed- if true; the domain range will not update when new data becomes available; if false; the domain range will update to show newly available data
-
setAutoBoundDomain
public final void setAutoBoundDomain(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on domain axis from user input. This class does not force the use ofXYPlots, but the auto bounds command comes from theChartPanelthat shows this plot. In case the used plot is aXYPlot, this method is then invoked. Sub classes with auto domain bounds that work with anXYPlotshould implement this. The method is not abstract as the use ofXYPlotis not obligated. This implementation overrides to reset user-disabled auto-bounds.- Overrides:
setAutoBoundDomainin classAbstractBoundedPlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>- Parameters:
plot- plot
-
setAutoBoundRange
public final void setAutoBoundRange(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on range axis from user input. This class does not force the use ofXYPlots, but the auto bounds command comes from theChartPanelthat shows this plot. In case the used plot is aXYPlot, this method is then invoked. Sub classes with auto range bounds that work with anXYPlotshould implement this. The method is not abstract as the use ofXYPlotis not obligated. This implementation overrides to reset user-disabled auto-bounds.- Overrides:
setAutoBoundRangein classAbstractBoundedPlot<S extends org.opentrafficsim.animation.graphs.AbstractPlot.PaintState>- Parameters:
plot- plot
-
getEndLocation
protected abstract org.djunits.value.vdouble.scalar.Length getEndLocation()Returns the total space.- Returns:
- total space
-