java.lang.Object
org.opentrafficsim.animation.graphs.AbstractPlot<DistributionPlotExtendedData.DistributionPaintState>
org.opentrafficsim.animation.graphs.DistributionPlotExtendedData<G,Z>
- Type Parameters:
G- GTU data type that needs to be consistent between the sampler data and the extended data typeZ- value type that needs to be consistent between extended data type and label data
- All Implemented Interfaces:
Identifiable,org.jfree.data.general.Dataset,org.jfree.data.general.SeriesDataset,org.jfree.data.xy.IntervalXYDataset,org.jfree.data.xy.XYDataset
public class DistributionPlotExtendedData<G extends GtuData,Z extends Number>
extends AbstractPlot<DistributionPlotExtendedData.DistributionPaintState>
implements org.jfree.data.xy.IntervalXYDataset
Distribution data plot for any numerical extended trajectory data. Data is collected cumulatively; each interval adds to the
totals of the previous interval.
Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOnly contains time.static final recordInput container for label input. -
Field Summary
Fields inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionDistributionPlotExtendedData(SamplerData<G> samplerData, GraphPath<? extends LaneData<?>> path, ExtendedDataType<Z, ?, ?, G> dataType, PlotScheduler plotScheduler, DistributionPlotExtendedData.LabelData<Z> labelData) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculatePaintState(org.djunits.value.vdouble.scalar.Duration time) Calculates the paint state object and offers it throughAbstractPlot.offerPaintState(S), or delegates this work to a delegate.Returns an empty paint state.org.jfree.data.DomainOrdergetEndX(int series, int item) doublegetEndXValue(int series, int item) getEndY(int series, int item) doublegetEndYValue(int series, int item) Return the graph type for transceiver.intgetItemCount(int series) intgetSeriesKey(int series) getStartX(int series, int item) doublegetStartXValue(int series, int item) getStartY(int series, int item) doublegetStartYValue(int series, int item) getStatusLabel(double domainValue, double rangeValue) Returns the status label when the mouse is over the given location.getX(int series, int item) doublegetXValue(int series, int item) getY(int series, int item) doublegetYValue(int series, int item) intindexOf(Comparable seriesKey) voidsetAutoBoundDomain(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on domain axis from user input.voidsetAutoBoundRange(org.jfree.chart.plot.XYPlot plot) Overridable; activates auto bounds on range axis from user input.Methods inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
addChangeListener, encodeAsPng, getAvailableTime, getCaption, getChart, getGroup, getId, getPaintState, invalidate, notifyPlotChange, offerPaintState, offerUpdateInterval, removeChangeListener, setChart, setGroup, setPaintState, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DistributionPlotExtendedData
public DistributionPlotExtendedData(SamplerData<G> samplerData, GraphPath<? extends LaneData<?>> path, ExtendedDataType<Z, ?, ?, G> dataType, PlotScheduler plotScheduler, DistributionPlotExtendedData.LabelData<Z> labelData) Constructor.- Parameters:
samplerData- sampler datapath- pathdataType- data typeplotScheduler- plot schedulerlabelData- label data
-
-
Method Details
-
getSeriesCount
public int getSeriesCount()- Specified by:
getSeriesCountin interfaceorg.jfree.data.general.SeriesDataset
-
getSeriesKey
- Specified by:
getSeriesKeyin interfaceorg.jfree.data.general.SeriesDataset
-
indexOf
- Specified by:
indexOfin interfaceorg.jfree.data.general.SeriesDataset
-
getDomainOrder
public org.jfree.data.DomainOrder getDomainOrder()- Specified by:
getDomainOrderin interfaceorg.jfree.data.xy.XYDataset
-
getItemCount
public int getItemCount(int series) - Specified by:
getItemCountin interfaceorg.jfree.data.xy.XYDataset
-
getX
- Specified by:
getXin interfaceorg.jfree.data.xy.XYDataset
-
getXValue
public double getXValue(int series, int item) - Specified by:
getXValuein interfaceorg.jfree.data.xy.XYDataset
-
getY
- Specified by:
getYin interfaceorg.jfree.data.xy.XYDataset
-
getYValue
public double getYValue(int series, int item) - Specified by:
getYValuein interfaceorg.jfree.data.xy.XYDataset
-
getStartX
- Specified by:
getStartXin interfaceorg.jfree.data.xy.IntervalXYDataset
-
getStartXValue
public double getStartXValue(int series, int item) - Specified by:
getStartXValuein interfaceorg.jfree.data.xy.IntervalXYDataset
-
getEndX
- Specified by:
getEndXin interfaceorg.jfree.data.xy.IntervalXYDataset
-
getEndXValue
public double getEndXValue(int series, int item) - Specified by:
getEndXValuein interfaceorg.jfree.data.xy.IntervalXYDataset
-
getStartY
- Specified by:
getStartYin interfaceorg.jfree.data.xy.IntervalXYDataset
-
getStartYValue
public double getStartYValue(int series, int item) - Specified by:
getStartYValuein interfaceorg.jfree.data.xy.IntervalXYDataset
-
getEndY
- Specified by:
getEndYin interfaceorg.jfree.data.xy.IntervalXYDataset
-
getEndYValue
public double getEndYValue(int series, int item) - Specified by:
getEndYValuein interfaceorg.jfree.data.xy.IntervalXYDataset
-
getGraphType
Description copied from class:AbstractPlotReturn the graph type for transceiver.- Specified by:
getGraphTypein classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Returns:
- the graph type.
-
getStatusLabel
Description copied from class:AbstractPlotReturns the status label when the mouse is over the given location.- Specified by:
getStatusLabelin classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Parameters:
domainValue- domain value (x-axis)rangeValue- range value (y-axis)- Returns:
- status label when the mouse is over the given location
-
emptyPaintState
Description copied from class:AbstractPlotReturns an empty paint state. This is used at plot initialization.- Specified by:
emptyPaintStatein classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Returns:
- empty paint state.
-
calculatePaintState
protected void calculatePaintState(org.djunits.value.vdouble.scalar.Duration time) Description copied from class:AbstractPlotCalculates the paint state object and offers it throughAbstractPlot.offerPaintState(S), or delegates this work to a delegate. This method is invoked by the worker thread and can thus perform heavy calculations outside of the Swing EDT. Intermediate paint states during long calculations may also be offered. It is up to the implementation to either calculate a complete paint state, or cumulatively built on the results from previous calls. It is also up to the implementation to know when the whole time span needs to be recalculated due to property changes.- Specified by:
calculatePaintStatein classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Parameters:
time- time until which data in the paint state should be calculated
-
setAutoBoundDomain
public void setAutoBoundDomain(org.jfree.chart.plot.XYPlot plot) Description copied from class:AbstractPlotOverridable; 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.- Overrides:
setAutoBoundDomainin classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Parameters:
plot- plot
-
setAutoBoundRange
public void setAutoBoundRange(org.jfree.chart.plot.XYPlot plot) Description copied from class:AbstractPlotOverridable; 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.- Overrides:
setAutoBoundRangein classAbstractPlot<DistributionPlotExtendedData.DistributionPaintState>- Parameters:
plot- plot
-