public interface ITrace2DDataAccumulating extends ITrace2D, PropertyChangeListener, Serializable
IAxis
sub interface intended for implementations that
are able to accumulate several points into a single one.
This is needed for performance reasons. Consider a trace containing 1.000.000 trace points. It would be very slow to move the chart window or in any case various repaints are caused (e.g. by tooltips or spanning a rectangle to zoom).
Therefore this sub-interface gives more information to the trace in order to be able to drop certain points:
Chart2D
) and painting will become much faster but also
able to adapt to be more detailed in value subdomains (in the case of
zooming).
ITrace2D
for basic supported
events. The following PropertyChangeEvent
may
be additionally fired to PropertyChangeListener
instances that register themselves with
ITrace2D.addPropertyChangeListener(String, PropertyChangeListener)
.
|
|
|
|
When fired |
---|---|---|---|---|
|
that changed |
, the old value |
, the new value |
was called. |
|
that changed |
, the old value |
, the new value |
was called on the current accumulation strategy. |
ITrace2D.DistancePoint
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_ACCUMULATION_STRATEGY
The property key defining the
property. |
static String |
PROPERTY_ACCUMULATION_STRATEGY_ACCUMULATION_FUNCTION_CHANGED
The property key defining a change of the
property: Namely
AAccumulationStrategy.setAccumulationFunction(IAccumulationFunction)
was called. |
PROPERTY_COLOR, PROPERTY_ERRORBARPOLICY, PROPERTY_ERRORBARPOLICY_CONFIGURATION, PROPERTY_LABEL, PROPERTY_MAX_X, PROPERTY_MAX_Y, PROPERTY_MIN_X, PROPERTY_MIN_Y, PROPERTY_NAME, PROPERTY_PAINTERS, PROPERTY_PHYSICALUNITS, PROPERTY_STROKE, PROPERTY_TRACEPOINT_CHANGED_HIGHLIGHTERS, PROPERTY_TRACEPOINT_CHANGED_LOCATION, PROPERTY_TRACEPOINT_CHANGED_RENDERING, PROPERTY_TRACEPOINTS, PROPERTY_VISIBLE, PROPERTY_ZINDEX, Z_INDEX_MIN, ZINDEX_MAX
Modifier and Type | Method and Description |
---|---|
IAccumulationStrategy |
getAccumulationStrategy()
Returns the current accumulation strategy.
|
Iterator<ITracePoint2D> |
iterator(int amountOfDesiredPoints)
Returns an
Iterator over the internal
instances that might accumulate internal
ITracePoint2D instances into one. |
IAccumulationStrategy |
setAccumulationStrategy(IAccumulationStrategy accumulationStrategy)
Installs the given accumulation strategy.
|
addComputingTrace, addErrorBarPolicy, addPoint, addPoint, addPoint, addPointHighlighter, addPropertyChangeListener, addTracePainter, containsTracePainter, descendingIterator, firePointChanged, getColor, getErrorBarPolicies, getHasErrorBars, getLabel, getMaxSize, getMaxX, getMaxY, getMinX, getMinY, getName, getNearestPointEuclid, getNearestPointManhattan, getPhysicalUnits, getPhysicalUnitsX, getPhysicalUnitsY, getPointHighlighters, getPropertyChangeListeners, getRenderer, getSize, getStroke, getTracePainters, getTracePointProvider, getZIndex, initPaintIteration, isAdditionalSpaceRequired, isEmpty, isPixelTransformationRequired, isVisible, iterator, maxXSearch, maxYSearch, minXSearch, minYSearch, onAdded2ChartBeforeFirstPaint, removeAllPointHighlighters, removeAllPoints, removeComputingTrace, removeErrorBarPolicy, removePoint, removePointHighlighter, removePropertyChangeListener, removePropertyChangeListener, removeTracePainter, setColor, setErrorBarPolicy, setName, setPhysicalUnits, setPointHighlighter, setRenderer, setStroke, setTracePainter, setTracePointProvider, setVisible, setZIndex, showsErrorBars, showsNegativeXErrorBars, showsNegativeYErrorBars, showsPositiveXErrorBars, showsPositiveYErrorBars
propertyChange
compareTo
static final String PROPERTY_ACCUMULATION_STRATEGY
setAccumulationStrategy(IAccumulationStrategy)
property. Use in combination with
ITrace2D.addPropertyChangeListener(String, PropertyChangeListener)
.static final String PROPERTY_ACCUMULATION_STRATEGY_ACCUMULATION_FUNCTION_CHANGED
setAccumulationStrategy(IAccumulationStrategy)
property: Namely
AAccumulationStrategy.setAccumulationFunction(IAccumulationFunction)
was called.
Use in combination with
ITrace2D.addPropertyChangeListener(String, PropertyChangeListener)
.
IAccumulationStrategy getAccumulationStrategy()
Iterator<ITracePoint2D> iterator(int amountOfDesiredPoints)
Iterator
over the internal
ITracePoint2D
instances that might accumulate internal
ITracePoint2D
instances into one.
Implementations should be synchronized. As this method may return "synthetic" points created at runtime that are made up by accumulation of several real internal points modifications of the instances returned are lossy!
There is no guarantee that changes made to the contained tracepoints will
be reflected in the display immediately. The order the iterator returns the
TracePoint2D
instances decides how the Chart2D
will paint the trace.
Important contract
No bounds of traces in x dimension should ever be changed for sorted traces
(by x value). This means the lowest point in x-dimension and the highest
point in x-dimension have to be returned unchanged in order not to change
the x value domain.
amountOfDesiredPoints
- The amount of points that should at least be returned to the
caller. Note that implementation may return twice as much points
depending on the accumulation function that is used (e.g. an
arithmetic mean function would need at least two points to fold
them into one so if the internal amount of points is not twice as
much as the requested amount accumulation has to be skipped).Iterator
over the internal
ITracePoint2D
instances that might accumulate
internal ITracePoint2D
instances into one by taking visible
range and desired amount of points into account.IAccumulationStrategy setAccumulationStrategy(IAccumulationStrategy accumulationStrategy)
accumulationStrategy
- the accumulation strategy to use.Copyright © 2019. All rights reserved.