Class Trace2DLtdSorted
java.lang.Object
info.monitorenter.gui.chart.traces.ATrace2D
info.monitorenter.gui.chart.traces.Trace2DSorted
info.monitorenter.gui.chart.traces.Trace2DLtdSorted
- All Implemented Interfaces:
ITrace2D,PropertyChangeListener,Serializable,Comparable<ITrace2D>,EventListener
Additional to the
Trace2DLtdReplacing all tracepoints will be
sorted by their x- value.
Performance is slower compared to the class named above. Internally a
TreeSet is used (instead of RingBufferArrayFast)
to keep the comparable TracePoint2D- instances sorted.
Internally all tracepoints are TracePoint2D -instances.
- Version:
- $Revision: 1.12 $
- Author:
- Achim Westermann
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface info.monitorenter.gui.chart.ITrace2D
ITrace2D.DistancePoint -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe maximum amount of points that will be shown.Fields inherited from class info.monitorenter.gui.chart.traces.Trace2DSorted
m_pointsFields inherited from class info.monitorenter.gui.chart.traces.ATrace2D
m_computingTraces, m_maxX, m_maxXErrorBar, m_maxY, m_maxYErrorBar, m_minX, m_minXErrorBar, m_minY, m_minYErrorBar, m_name, m_physicalUnitsX, m_physicalUnitsY, m_propertyChangeSupport, m_rendererFields inherited from interface info.monitorenter.gui.chart.ITrace2D
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_POINT_CHANGED, PROPERTY_POINT_HIGHLIGHTERS_CHANGED, PROPERTY_STROKE, PROPERTY_TRACEPOINT, PROPERTY_VISIBLE, PROPERTY_ZINDEX, Z_INDEX_MIN, ZINDEX_MAX -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an instance with a default buffer size of 100.Trace2DLtdSorted(int maxsize) Constructs an instance with a buffer size of maxsize. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddPointInternal(ITracePoint2D point) In case point has an x- value already contained, the old trace point with that value will be replaced by the new one.final intReturns the maximum amount ofTracePoint2Dinstances that may be added.final voidsetMaxSize(int amount) Sets the maximum amount of points that will be shown.Methods inherited from class info.monitorenter.gui.chart.traces.Trace2DSorted
getSize, isEmpty, iterator, removeAllPointsInternal, removePointInternalMethods inherited from class info.monitorenter.gui.chart.traces.ATrace2D
addComputingTrace, addErrorBarPolicy, addPoint, addPoint, addPointHighlighter, addPropertyChangeListener, addTracePainter, compareTo, containsTracePainter, ensureInitialized, finalize, firePointAdded, firePointChanged, firePointRemoved, firePropertyChange, getChangeListeners, getColor, getErrorBarPolicies, getHasErrorBars, getInstanceCount, getLabel, getMaxX, getMaxY, getMinX, getMinY, getName, getNearestPointEuclid, getNearestPointManhattan, getPhysicalUnits, getPhysicalUnitsX, getPhysicalUnitsY, getPointHighlighters, getPropertyChangeListeners, getRenderer, getStroke, getTracePainters, getZIndex, isVisible, maxXSearch, maxYSearch, minXSearch, minYSearch, propertyChange, removeAllPointHighlighters, removeAllPoints, removeComputingTrace, removeErrorBarPolicy, removePoint, removePointHighlighter, removePropertyChangeListener, removePropertyChangeListener, removeTracePainter, setColor, setErrorBarPolicy, setName, setPhysicalUnits, setPointHighlighter, setRenderer, setStroke, setTracePainter, setVisible, setZIndex, showsErrorBars, showsNegativeXErrorBars, showsNegativeYErrorBars, showsPositiveXErrorBars, showsPositiveYErrorBars, toStringMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface info.monitorenter.gui.chart.ITrace2D
addComputingTrace, addErrorBarPolicy, addPoint, addPoint, addPointHighlighter, addPropertyChangeListener, addTracePainter, containsTracePainter, firePointChanged, getColor, getErrorBarPolicies, getHasErrorBars, getLabel, getMaxX, getMaxY, getMinX, getMinY, getName, getNearestPointEuclid, getNearestPointManhattan, getPhysicalUnits, getPhysicalUnitsX, getPhysicalUnitsY, getPointHighlighters, getPropertyChangeListeners, getRenderer, getStroke, getTracePainters, getZIndex, isVisible, removeAllPointHighlighters, removeAllPoints, removeComputingTrace, removeErrorBarPolicy, removePoint, removePointHighlighter, removePropertyChangeListener, removePropertyChangeListener, removeTracePainter, setColor, setErrorBarPolicy, setName, setPhysicalUnits, setPointHighlighter, setRenderer, setStroke, setTracePainter, setVisible, setZIndex, showsErrorBars, showsNegativeXErrorBars, showsNegativeYErrorBars, showsPositiveXErrorBars, showsPositiveYErrorBarsMethods inherited from interface java.beans.PropertyChangeListener
propertyChange
-
Field Details
-
m_maxsize
protected int m_maxsizeThe maximum amount of points that will be shown.
-
-
Constructor Details
-
Trace2DLtdSorted
public Trace2DLtdSorted()Constructs an instance with a default buffer size of 100. -
Trace2DLtdSorted
public Trace2DLtdSorted(int maxsize) Constructs an instance with a buffer size of maxsize.- Parameters:
maxsize- the maximum amount of points to show.
-
-
Method Details
-
addPointInternal
In case point has an x- value already contained, the old trace point with that value will be replaced by the new one. Else the new trace point will be added at an index in order to keep the ascending order of trace points with a higher x- value are contained.If points takes additional space (it's x- value is not already contained) and maxsize is reached, the first element (with lowest x- value) will be removed.
- Overrides:
addPointInternalin classTrace2DSorted- Parameters:
point- the point to add.- Returns:
- true if the point was successfully removed.
-
getMaxSize
public final int getMaxSize()Description copied from interface:ITrace2DReturns the maximum amount of
TracePoint2Dinstances that may be added. For implementations that limit the maximum amount this is a reasonable amount. Non-limiting implementations should returnInteger.MAX_VALUE. This allows to detect the unlimitedness. Of course no implementation could store that amount of points.- Specified by:
getMaxSizein interfaceITrace2D- Overrides:
getMaxSizein classTrace2DSorted- Returns:
- The maximum amount of
TracePoint2Dinstances that may be added. - See Also:
-
setMaxSize
public final void setMaxSize(int amount) Sets the maximum amount of points that will be shown.- Parameters:
amount- the maximum amount of points that will be shown.
-