Class ContourPlotExtendedData.UnitPlot<U extends Unit<U>,Z extends org.djunits.value.vdouble.scalar.base.DoubleScalarRel<U,Z>>
java.lang.Object
org.opentrafficsim.animation.graphs.AbstractPlot<S>
org.opentrafficsim.animation.graphs.AbstractBoundedPlot<S>
org.opentrafficsim.animation.graphs.AbstractSpaceTimePlot<AbstractContourPlot.ContourPaintState>
org.opentrafficsim.animation.graphs.AbstractContourPlot<Z>
org.opentrafficsim.animation.graphs.ContourPlotExtendedData<Z>
org.opentrafficsim.animation.graphs.ContourPlotExtendedData.UnitPlot<U,Z>
- Type Parameters:
U- unit typeZ- unit value type
- All Implemented Interfaces:
Identifiable,org.jfree.data.general.Dataset,org.jfree.data.general.SeriesDataset,org.jfree.data.xy.XYDataset,org.jfree.data.xy.XYZDataset
- Enclosing class:
- ContourPlotExtendedData<Z extends Number>
public static class ContourPlotExtendedData.UnitPlot<U extends Unit<U>,Z extends org.djunits.value.vdouble.scalar.base.DoubleScalarRel<U,Z>>
extends ContourPlotExtendedData<Z>
Extension of
ContourPlotExtendedData for DJUNITS data types. The legend format will be "%.1f{unit}".
The label format will be "{quantity} %.2f {unit}". A last digit in the unit will be made in to a
superscript.-
Nested Class Summary
Nested classes/interfaces inherited from class org.opentrafficsim.animation.graphs.ContourPlotExtendedData
ContourPlotExtendedData.UnitPlot<U extends Unit<U>,Z extends org.djunits.value.vdouble.scalar.base.DoubleScalarRel<U, Z>> Nested classes/interfaces inherited from class org.opentrafficsim.animation.graphs.AbstractContourPlot
AbstractContourPlot.Bounds<Z extends Number>, AbstractContourPlot.ContourPaintState, AbstractContourPlot.LabelData<Z extends Number> -
Field Summary
Fields inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
DEFAULT_INITIAL_UPPER_TIME_BOUND, GRAPH_ADD_EVENT, GRAPH_REMOVE_EVENT -
Constructor Summary
ConstructorsConstructorDescriptionUnitPlot(String caption, ContourDataSource source, ExtendedDataNumber<?> extendedDataType, BoundsPaintScale paintScale, Z legendStep, U unit) Constructor with specified paint scale.UnitPlot(String caption, ContourDataSource source, ExtendedDataNumber<?> extendedDataType, AbstractContourPlot.Bounds<Z> bounds, Z legendStep, U unit) Constructor with default paint scale (red at minimum, yellow at mid-point, green at maximum). -
Method Summary
Modifier and TypeMethodDescriptionprotected doublescale(double si) Scale the z-value from SI to the desired unit for users, in line with unit inAbstractContourPlot.LabelData.labelFormat.Methods inherited from class org.opentrafficsim.animation.graphs.ContourPlotExtendedData
getGraphType, toStringMethods inherited from class org.opentrafficsim.animation.graphs.AbstractContourPlot
addListener, calculatePaintState, emptyPaintState, getContourDataType, getDomainOrder, getEndLocation, getGranularities, getGranularity, getItemCount, getRangeBinCount, getSeriesCount, getSeriesKey, getStatusLabel, getX, getXValue, getY, getYValue, getZ, getZValue, indexOf, setGranularity, setInterpolate, setPaintState, setSmoothMethods inherited from class org.opentrafficsim.animation.graphs.AbstractSpaceTimePlot
setAutoBoundDomain, setAutoBoundRange, setChart, updateFixedDomainRangeMethods inherited from class org.opentrafficsim.animation.graphs.AbstractBoundedPlot
setLowerDomainBound, setLowerRangeBound, setUpperDomainBound, setUpperRangeBoundMethods inherited from class org.opentrafficsim.animation.graphs.AbstractPlot
addChangeListener, encodeAsPng, getAvailableTime, getCaption, getChart, getGroup, getId, getPaintState, invalidate, notifyPlotChange, offerPaintState, offerUpdateInterval, removeChangeListener, setGroup, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
UnitPlot
public UnitPlot(String caption, ContourDataSource source, ExtendedDataNumber<?> extendedDataType, AbstractContourPlot.Bounds<Z> bounds, Z legendStep, U unit) Constructor with default paint scale (red at minimum, yellow at mid-point, green at maximum).- Parameters:
caption- captionsource- data sourceextendedDataType- extended data typebounds- paint scale boundslegendStep- legend stepunit- unit to display values in
-
UnitPlot
public UnitPlot(String caption, ContourDataSource source, ExtendedDataNumber<?> extendedDataType, BoundsPaintScale paintScale, Z legendStep, U unit) Constructor with specified paint scale.- Parameters:
caption- captionsource- data sourceextendedDataType- extended data typepaintScale- paint scalelegendStep- legend stepunit- unit to display values in
-
-
Method Details
-
scale
protected double scale(double si) Description copied from class:AbstractContourPlotScale the z-value from SI to the desired unit for users, in line with unit inAbstractContourPlot.LabelData.labelFormat.- Overrides:
scalein classContourPlotExtendedData<Z extends org.djunits.value.vdouble.scalar.base.DoubleScalarRel<U,Z>> - Parameters:
si- SI value- Returns:
- scaled value
-