Class ATrace2D
- All Implemented Interfaces:
ITrace2D
,PropertyChangeListener
,Serializable
,Comparable<ITrace2D>
,EventListener
- Direct Known Subclasses:
Trace2DArithmeticMean
,Trace2DArithmeticMeanX
,Trace2DArithmeticMeanY
,Trace2DLtd
,Trace2DSimple
,Trace2DSorted
ITrace2D
that provides the
major amount of aspects needed in order to work correctly together with
Chart2D
.
Caching of minimum and maximum bounds, property change support, the complex
z-Index handling (incorporates calls to internals of Chart2D
,
default naming, bound management and event handling are covered here.
- Version:
- $Revision: 1.75 $
- 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 TypeFieldDescriptionThe list of traces that compute their values from this trace.protected double
Cached maximum x value for performance improvement.protected double
Cached maximum x value with error bar extension for performance improvement.protected double
Cached maximum y value for performance improvement.protected double
Cached maximum y value with error bar extension for performance improvement.protected double
Cached minimum x value for performance improvement.protected double
Cached minimum x value with error bar extension for performance improvement.protected double
Cached minimum y value for performance improvement.protected double
Cached minimum y value with error bar extension for performance improvement.protected String
The name property.protected String
The physical unit property for x dimension.protected String
The physical unit property for x dimension.protected PropertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
.protected Object
TheChart2D
this trace is added to.Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComputingTrace
(ITrace2D trace) Adds a trace that "should" compute values from the points added viaITrace2D.addPoint(ITracePoint2D)
final boolean
addErrorBarPolicy
(IErrorBarPolicy<?> errorBarPolicy) Adds the given error bar policy to the internal set of error bar policies.final boolean
addPoint
(double x, double y) Adds a trace point to the internal data.final boolean
Add the given point to thisITrace2D
.boolean
addPointHighlighter
(IPointPainter<?> highlighter) Adds the given point painter to the internal set of point highlighters.protected abstract boolean
Override this template method for the custom add operation that depends on the policies of the implementation.final void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.boolean
addTracePainter
(ITracePainter<?> painter) Adds the given trace painter to the internal set of trace painters.final int
boolean
containsTracePainter
(ITracePainter<?> painter) Returns true if the given painter is contained in this compound painter.protected final void
Ensures that no deadlock due to a missing internal chart reference may occur.protected void
finalize()
Decreases internal instance count by one.protected void
firePointAdded
(ITracePoint2D added) Fire property change events related to an added point.void
firePointChanged
(ITracePoint2D changed, int state) Method triggered by
,ITracePoint2D.setLocation(double, double)
oraddPoint(ITracePoint2D)
removePoint(ITracePoint2D)
protected void
firePointRemoved
(ITracePoint2D removed) Fire property change events related to a removed point.protected final void
firePropertyChange
(String property, Object oldvalue, Object newvalue) Fires a property change event to the registered listeners.Returns a shallow copied list of the change listeners of this instance.final Color
getColor()
Get theColor
this trace will be painted with.final Set
<IErrorBarPolicy<?>> Returns theSet<
that will be used to render error bars for this trace.IErrorBarPolicy
>final boolean
Returns true if this trace has error bars configured.static int
Returns the instanceCount for allATrace2D
subclasses.final String
getLabel()
Returns a label for this trace.final double
getMaxX()
Returns the original maximum x- value ignoring the offsetX.final double
getMaxY()
Returns the original maximum y- value ignoring the offsetY.final double
getMinX()
Returns the original minimum x- value ignoring the offsetX.final double
getMinY()
Returns the original minimum y- value ignoring the offsetY.final String
getName()
Returns the name of this trace.getNearestPointEuclid
(double x, double y) Naive implementation that iterates over every point.getNearestPointManhattan
(double x, double y) Naive implementation that iterates over every point.final String
Returns the concatenation[x: "
.ITrace2D.getPhysicalUnitsX()
", y: "ITrace2D.getPhysicalUnitsY()
"]final String
Returns the physical unit string value for the x dimension.final String
Returns the physical unit string value for the y dimension.final Set
<IPointPainter<?>> Returns theSet<
that may be used to highlight points of this trace.IPointPainter
>getPropertyChangeListeners
(String property) Returns all property change listeners for the given property.final Chart2D
Returns the chart that renders this instance or null, if this trace is not added to a chart.final Stroke
Get theStroke
object this instance will be painted with.final Set
<ITracePainter<?>> Returns theSet<
that will be used to paint this trace.ITracePainter
>final Integer
The z-index defines the order in which this instance will be painted.final boolean
Returns true if this instance should be rendered.protected void
Internal search for the maximum x value that is only invoked if no cached value is at hand or bounds have changed by adding new points.protected void
Internal search for the maximum y value that is only invoked if no cached value is at hand or bounds have changed by adding new points.protected void
Internal search for the minimum x value that is only invoked if no cached value is at hand or bounds have changed by adding new points.protected void
Internal search for the minimum y value that is only invoked if no cached value is at hand or bounds have changed by adding new points.void
Set
<IPointPainter<?>> Clears all internal point highlighters used.final void
Changes the internal state to empty to allow that the caching of bounds is cleared and delegates the call toremoveAllPointsInternal()
.protected abstract void
Override this template method for the custom remove operation that depends on theCollection
used in the implementation.boolean
removeComputingTrace
(ITrace2D trace) Remove a trace that "should" compute values from the points added via
.ITrace2D.addPoint(ITracePoint2D)
boolean
removeErrorBarPolicy
(IErrorBarPolicy<?> errorBarPolicy) Removes the given error bar policy from the internal set of error bar policies.boolean
removePoint
(ITracePoint2D point) Remove the given point from thisITrace2D
.boolean
removePointHighlighter
(IPointPainter<?> higlighter) Removes the given point highlighter, if it's class is contained.protected abstract ITracePoint2D
removePointInternal
(ITracePoint2D point) Override this template method for the custom remove operation that depends on the internal storage the implementation.void
Unregisters a property change listener that has been registered for listening on all properties.void
removePropertyChangeListener
(String property, PropertyChangeListener listener) Removes a property change listener for listening on the given property.boolean
removeTracePainter
(ITracePainter<?> painter) Removes the given trace painter, if it's class is contained and if more painters are remaining.final void
Set theColor
this trace will be painted with.final Set
<IErrorBarPolicy<?>> setErrorBarPolicy
(IErrorBarPolicy<?> errorBarPolicy) Replaces all internal error bar policies by the new one.final void
Sets the descriptive name for this trace.final void
setPhysicalUnits
(String xunit, String yunit) Assigns a specific String representing the physical unit to theITrace2D
(e.g.final Set
<IPointPainter<?>> setPointHighlighter
(IPointPainter<?> highlighter) Replaces all internal point highlighters by the new one.final void
setRenderer
(Chart2D renderer) Allows the chart this instance is painted by to register itself.final void
Allows to specify the rendering of the ITrace2D.final Set
<ITracePainter<?>> setTracePainter
(ITracePainter<?> painter) Replaces all internal trace painters by the new one.final void
setVisible
(boolean visible) Set the visible property of this instance.final void
Sets the internal z-index property.boolean
Tests whether error bars are painted by this trace.boolean
Tests whether error bars in negative x direction are painted by this trace.boolean
Tests whether error bars in negative y direction are painted by this trace.boolean
Tests whether error bars in positive x direction are painted by this trace.boolean
Tests whether error bars in positive y direction are painted by this trace.toString()
ReturnsgetName()
.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface info.monitorenter.gui.chart.ITrace2D
getMaxSize, getSize, isEmpty, iterator
-
Field Details
-
m_computingTraces
The list of traces that compute their values from this trace. -
m_maxX
protected double m_maxXCached maximum x value for performance improvement. -
m_maxXErrorBar
protected double m_maxXErrorBarCached maximum x value with error bar extension for performance improvement. -
m_maxY
protected double m_maxYCached maximum y value for performance improvement. -
m_maxYErrorBar
protected double m_maxYErrorBarCached maximum y value with error bar extension for performance improvement. -
m_minX
protected double m_minXCached minimum x value for performance improvement. -
m_minXErrorBar
protected double m_minXErrorBarCached minimum x value with error bar extension for performance improvement. -
m_minY
protected double m_minYCached minimum y value for performance improvement. -
m_minYErrorBar
protected double m_minYErrorBarCached minimum y value with error bar extension for performance improvement. -
m_name
The name property. -
m_physicalUnitsX
The physical unit property for x dimension. -
m_physicalUnitsY
The physical unit property for x dimension. -
m_propertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
. -
m_renderer
TheChart2D
this trace is added to. Needed for synchronization.
-
-
Constructor Details
-
ATrace2D
public ATrace2D()Defcon.
-
-
Method Details
-
getInstanceCount
public static int getInstanceCount()Returns the instanceCount for allATrace2D
subclasses.- Returns:
- Returns the instanceCount for all
ATrace2D
subclasses.
-
addComputingTrace
Description copied from interface:ITrace2D
Adds a trace that "should" compute values from the points added viaITrace2D.addPoint(ITracePoint2D)
The given trace will be informed in case an add operation on this trace succeeds via
.ITrace2D.addPoint(ITracePoint2D)
- Specified by:
addComputingTrace
in interfaceITrace2D
- Parameters:
trace
- the trace that will calculate it's points from the added points of this trace.- See Also:
-
ensureInitialized
protected final void ensureInitialized()Ensures that no deadlock due to a missing internal chart reference may occur.- Throws:
IllegalStateException
- if this trace is not assigned to a chart.
-
addErrorBarPolicy
Description copied from interface:ITrace2D
Adds the given error bar policy to the internal set of error bar policies.It will be the last error bar policy to render (most forward on screen).
- Specified by:
addErrorBarPolicy
in interfaceITrace2D
- Parameters:
errorBarPolicy
- the error bar policy to add for rendering this trace's error bars.- Returns:
- true if the painter was added (same instance was not contained before).
- See Also:
-
addPoint
public final boolean addPoint(double x, double y) Description copied from interface:ITrace2D
Adds a trace point to the internal data.Warning:
Do not call this method before this trace has been added to a chart or you will not succeed as the chart is needed to get the properChart2D.getTracePointProvider()
-
addPoint
Add the given point to thisITrace2D
.This implementation performs caching of minimum and maximum values for x and y and the delegates to
addPointInternal(ITracePoint2D)
that has to perform the "real" add operation.Property change events are fired as described in method
.firePointAdded(ITracePoint2D)
-
addPointHighlighter
Description copied from interface:ITrace2D
Adds the given point painter to the internal set of point highlighters.It will be the last point painter to paint highlighting if highlighting is active.
- Specified by:
addPointHighlighter
in interfaceITrace2D
- Parameters:
highlighter
- the highlighter to add for highlighting this trace.- Returns:
- true if the highlighter was added (class of instance not contained before).
- See Also:
-
addPointInternal
Override this template method for the custom add operation that depends on the policies of the implementation.
No property change events have to be fired by default. If this method returns
true
the outer logic of the calling method
will perform bound checks for the new point and fire property changes as described in methodaddPoint(ITracePoint2D)
.firePointChanged(ITracePoint2D, int)
In special cases - when additional modifications to the internal set of points take place (e.g. a further point gets removed) this method should return false (regardless whether the new point was accepted or not) and perform bound checks and fire the property changes as mentioned above "manually".
- Parameters:
p
- the point to add.- Returns:
- true if the given point was accepted or false if not.
-
addPropertyChangeListener
Description copied from interface:ITrace2D
Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.- Specified by:
addPropertyChangeListener
in interfaceITrace2D
- Parameters:
propertyName
- the name of the property the listener is interested inlistener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes- See Also:
-
addTracePainter
Description copied from interface:ITrace2D
Adds the given trace painter to the internal set of trace painters.It will be the last painter to paint (most forward).
- Specified by:
addTracePainter
in interfaceITrace2D
- Parameters:
painter
- the painter to add for rendering this trace.- Returns:
- true if the painter was added (class of instance not contained before).
- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ITrace2D>
- Parameters:
o
- the trace to compare to.- Returns:
- see interface.
- See Also:
-
containsTracePainter
Description copied from interface:ITrace2D
Returns true if the given painter is contained in this compound painter.- Specified by:
containsTracePainter
in interfaceITrace2D
- Parameters:
painter
- the painter to check whether it is contained.- Returns:
- true if the given painter is contained in this compound painter.
- See Also:
-
finalize
Decreases internal instance count by one. -
firePointAdded
Fire property change events related to an added point.A property change event for property
with null as the old value and the new point as the new value is fired. This allows e.g. rescaling of those instances (instead of having to rescale a whole trace).ITrace2D.PROPERTY_TRACEPOINT
Additionally before this property change, property change events for bounds are fired as described in method
.firePointChanged(ITracePoint2D, int)
- Parameters:
added
- the point that was added.
-
firePointChanged
Method triggered by
,ITracePoint2D.setLocation(double, double)
oraddPoint(ITracePoint2D)
removePoint(ITracePoint2D)
Bound checks are performed and property change events for the properties
,ITrace2D.PROPERTY_MAX_X
,ITrace2D.PROPERTY_MIN_X
andITrace2D.PROPERTY_MAX_Y
are fired if the add bounds have changed due to the modification of the point.ITrace2D.PROPERTY_MIN_Y
If
state
is
a property change event withITracePoint2D.STATE_CHANGED
will be fired to all listeners.ITrace2D.PROPERTY_POINT_CHANGED
- Specified by:
firePointChanged
in interfaceITrace2D
- Parameters:
changed
- the point that has been changed which may be a newly added point (from
, a removed one or a modified one.addPoint(ITracePoint2D)
state
- one of {
to inform about the type of change.ITracePoint2D.STATE_ADDED
,ITracePoint2D.STATE_CHANGED
,ITracePoint2D.STATE_REMOVED
-
firePointRemoved
Fire property change events related to a removed point.A property change event for property
with a point as the old value and null as the new value is fired. This allows e.g. rescaling of those instances (instead of having to rescale a whole trace).ITrace2D.PROPERTY_TRACEPOINT
Additionally before this property change, property change events for bounds are fired as described in method
.firePointChanged(ITracePoint2D, int)
- Parameters:
removed
- the point that was removed.
-
firePropertyChange
Fires a property change event to the registered listeners.- Parameters:
property
- one of thePROPERTY_XXX
constants defined inITrace2D
oldvalue
- the old value of the property.newvalue
- the new value of the property.
-
getChangeListeners
Returns a shallow copied list of the change listeners of this instance.- Returns:
- a shallow copied list of the change listeners of this instance.
-
getColor
Get theColor
this trace will be painted with. -
getErrorBarPolicies
Description copied from interface:ITrace2D
Returns theSet<
that will be used to render error bars for this trace.IErrorBarPolicy
>- Specified by:
getErrorBarPolicies
in interfaceITrace2D
- Returns:
- the
Set<
that will be used to render error bars for this trace.IErrorBarPolicy
> - See Also:
-
getHasErrorBars
public final boolean getHasErrorBars()Description copied from interface:ITrace2D
Returns true if this trace has error bars configured.If this returns false, no error bars will be painted for this trace.
- Specified by:
getHasErrorBars
in interfaceITrace2D
- Returns:
- true if this trace has error bars configured.
- See Also:
-
getLabel
Returns a label for this trace.The label is constructed of
- The name of this trace (
getName()
). - The physical unit of this trace (
getPhysicalUnits()
).
- The name of this trace (
-
getMaxX
public final double getMaxX()Returns the original maximum x- value ignoring the offsetX. -
getMaxY
public final double getMaxY()Returns the original maximum y- value ignoring the offsetY. -
getMinX
public final double getMinX()Returns the original minimum x- value ignoring the offsetX. -
getMinY
public final double getMinY()Returns the original minimum y- value ignoring the offsetY. -
getName
Returns the name of this trace. -
getNearestPointEuclid
Naive implementation that iterates over every point.Subclasses that have more insight about their internal data storage could override this with a faster implementation (e.g. if the points are kept in a sorted order a skip - strategy) could find the minimum faster.
- Specified by:
getNearestPointEuclid
in interfaceITrace2D
- Parameters:
x
- the x value as a normalized value between 0 and 1.0.y
- the x value as a normalized value between 0 and 1.0.- Returns:
- the nearest point to the given normalized value coordinates of this trace in Euclid distance.
- See Also:
-
getNearestPointManhattan
Naive implementation that iterates over every point.Subclasses that have more insight about their internal data storage could override this with a faster implementation (e.g. if the points are kept in a sorted order a skip - strategy could find the minimum faster.
- Specified by:
getNearestPointManhattan
in interfaceITrace2D
- Parameters:
x
- the x value as a normalized value between 0 and 1.0.y
- the x value as a normalized value between 0 and 1.0.- Returns:
- the nearest point to the given normalized value coordinates of this trace in Manhattan distance.
- See Also:
-
getPhysicalUnits
Description copied from interface:ITrace2D
Returns the concatenation[x: "
.ITrace2D.getPhysicalUnitsX()
", y: "ITrace2D.getPhysicalUnitsY()
"]- Specified by:
getPhysicalUnits
in interfaceITrace2D
- Returns:
- the concatenation
[x: "
.ITrace2D.getPhysicalUnitsX()
", y: "ITrace2D.getPhysicalUnitsY()
"] - See Also:
-
getPhysicalUnitsX
Description copied from interface:ITrace2D
Returns the physical unit string value for the x dimension.- Specified by:
getPhysicalUnitsX
in interfaceITrace2D
- Returns:
- the physical unit string value for the x dimension.
- See Also:
-
getPhysicalUnitsY
Description copied from interface:ITrace2D
Returns the physical unit string value for the y dimension.- Specified by:
getPhysicalUnitsY
in interfaceITrace2D
- Returns:
- the physical unit string value for the y dimension.
- See Also:
-
getPointHighlighters
Description copied from interface:ITrace2D
Returns theSet<
that may be used to highlight points of this trace.IPointPainter
>This is used by the point highlighting feature:
Chart2D.enablePointHighlighting(boolean)
- Specified by:
getPointHighlighters
in interfaceITrace2D
- Returns:
- the
Set<
that may be used to highlight points.IPointPainter
> - See Also:
-
getPropertyChangeListeners
Description copied from interface:ITrace2D
Returns all property change listeners for the given property.- Specified by:
getPropertyChangeListeners
in interfaceITrace2D
- Parameters:
property
- one of the constants with thePROPERTY_
prefix defined in this class or subclasses.- Returns:
- the property change listeners for the given property.
- See Also:
-
getRenderer
Returns the chart that renders this instance or null, if this trace is not added to a chart.The chart that renders this trace registers itself with this trace in
Chart2D.addTrace(ITrace2D)
.- Specified by:
getRenderer
in interfaceITrace2D
- Returns:
- Returns the renderer.
- See Also:
-
getStroke
Get theStroke
object this instance will be painted with. -
getTracePainters
Description copied from interface:ITrace2D
Returns theSet<
that will be used to paint this trace.ITracePainter
>The original set should be returned by contract to allow adding painters "silently" (vs. using
).ITrace2D.addTracePainter(ITracePainter)
- Specified by:
getTracePainters
in interfaceITrace2D
- Returns:
- the
Set<
that will be used to paint this trace.ITracePainter
> - See Also:
-
getZIndex
Description copied from interface:ITrace2D
The z-index defines the order in which this instance will be painted.A higher value will bring it more "to the front".
-
isVisible
public final boolean isVisible()Description copied from interface:ITrace2D
Returns true if this instance should be rendered. -
maxXSearch
protected void maxXSearch()Internal search for the maximum x value that is only invoked if no cached value is at hand or bounds have changed by adding new points.The result is assigned to the property maxX.
- See Also:
-
maxYSearch
protected void maxYSearch()Internal search for the maximum y value that is only invoked if no cached value is at hand or bounds have changed by adding new points.The result is assigned to the property maxY.
- See Also:
-
minXSearch
protected void minXSearch()Internal search for the minimum x value that is only invoked if no cached value is at hand or bounds have changed by adding new points.The result is assigned to the property minX.
- See Also:
-
minYSearch
protected void minYSearch()Internal search for the minimum y value that is only invoked if no cached value is at hand or bounds have changed by adding new points.The result is assigned to the property minY.
- See Also:
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
- See Also:
-
removeAllPointHighlighters
Description copied from interface:ITrace2D
Clears all internal point highlighters used.Returns the
Set<
that was used to highlight points.IPointPainter
>This is used by the point highlighting feature:
Chart2D.enablePointHighlighting(boolean)
- Specified by:
removeAllPointHighlighters
in interfaceITrace2D
- Returns:
- the
Set<
that was be used to highlight points.IPointPainter
> - See Also:
-
removeAllPoints
public final void removeAllPoints()Changes the internal state to empty to allow that the caching of bounds is cleared and delegates the call toremoveAllPointsInternal()
.- Specified by:
removeAllPoints
in interfaceITrace2D
- See Also:
-
removeAllPointsInternal
protected abstract void removeAllPointsInternal()Override this template method for the custom remove operation that depends on theCollection
used in the implementation.No change events have to be fired, this is done by
ATrace2D
. -
removeComputingTrace
Description copied from interface:ITrace2D
Remove a trace that "should" compute values from the points added via
.ITrace2D.addPoint(ITracePoint2D)
- Specified by:
removeComputingTrace
in interfaceITrace2D
- Parameters:
trace
- the trace that will calculate it's points from the added points of this trace.- Returns:
- true if the given trace was removed (recognized by the means of
).Object.equals(Object)
- See Also:
-
removeErrorBarPolicy
Description copied from interface:ITrace2D
Removes the given error bar policy from the internal set of error bar policies.- Specified by:
removeErrorBarPolicy
in interfaceITrace2D
- Parameters:
errorBarPolicy
- the error bar policy to remove.- Returns:
- true if the painter was removed (same instance contained before).
- See Also:
-
removePoint
Remove the given point from thisITrace2D
.This implementation performs caching of minimum and maximum values for x and y and the delegates to
that has to perform the "real" add remove operation.removePointInternal(ITracePoint2D)
Property change events are fired as described in method
.firePointRemoved(ITracePoint2D)
- Specified by:
removePoint
in interfaceITrace2D
- Parameters:
point
- theTracePoint2D
to remove.- Returns:
- true if the removal succeeded, false else: this could be that the given point was not contained.
- See Also:
-
removePointHighlighter
Description copied from interface:ITrace2D
Removes the given point highlighter, if it's class is contained.- Specified by:
removePointHighlighter
in interfaceITrace2D
- Parameters:
higlighter
- the highlighter to remove.- Returns:
- true if a point highlighter of the class of the given argument was removed.
- See Also:
-
removePointInternal
Override this template method for the custom remove operation that depends on the internal storage the implementation.The returned point may be the same as the given. But some "computing" traces like
will internally delete a different point and return that one.Trace2DArithmeticMean
No property change events have to be fired by default. If this method returns
null
the outer logic of the calling method
will perform bound checks for the returned point and fire property changes for the propertiesremovePoint(ITracePoint2D)
,ITrace2D.PROPERTY_MAX_X
,ITrace2D.PROPERTY_MIN_X
andITrace2D.PROPERTY_MAX_Y
.ITrace2D.PROPERTY_MIN_Y
In special cases - when additional modifications to the internal set of points take place (e.g. a further point get added) this method should return false (regardless whether the old point was really removed or not) and perform bound checks and fire the property changes as mentioned above "manually".
- Parameters:
point
- the point to remove.- Returns:
- null if unsuccessful (and no events should be fired) or the point that actually was removed (in case different than the given one it should be somehow related to the given one).
-
removePropertyChangeListener
Description copied from interface:ITrace2D
Unregisters a property change listener that has been registered for listening on all properties.- Specified by:
removePropertyChangeListener
in interfaceITrace2D
- Parameters:
listener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes- See Also:
-
removePropertyChangeListener
Description copied from interface:ITrace2D
Removes a property change listener for listening on the given property.- Specified by:
removePropertyChangeListener
in interfaceITrace2D
- Parameters:
property
- one of the constants with thePROPERTY_
prefix defined in this class or subclasses.listener
- the listener for this property change.- See Also:
-
removeTracePainter
Description copied from interface:ITrace2D
Removes the given trace painter, if it's class is contained and if more painters are remaining.- Specified by:
removeTracePainter
in interfaceITrace2D
- Parameters:
painter
- the trace painter to remove.- Returns:
- true if a trace painter of the class of the given argument was removed.
- See Also:
-
setColor
Set the
Color
this trace will be painted with. -
setErrorBarPolicy
Description copied from interface:ITrace2D
Replaces all internal error bar policies by the new one.- Specified by:
setErrorBarPolicy
in interfaceITrace2D
- Parameters:
errorBarPolicy
- the new sole painter to use.- Returns:
- the
Set<
that was used before.IErrorBarPolicy
> - See Also:
-
setName
Sets the descriptive name for this trace.If the given argument is null or consists of whitespaces only the lable for this trace might become invisible (depending on physical units set).
-
setPhysicalUnits
Description copied from interface:ITrace2D
Assigns a specific String representing the physical unit to theITrace2D
(e.g. Volt, Ohm, lux, ...) which will be displayed by theChart2D
- Specified by:
setPhysicalUnits
in interfaceITrace2D
- Parameters:
xunit
- the physical unit for the x axis.yunit
- the physical unit for the y axis.- See Also:
-
setPointHighlighter
Description copied from interface:ITrace2D
Replaces all internal point highlighters by the new one.- Specified by:
setPointHighlighter
in interfaceITrace2D
- Parameters:
highlighter
- the new sole highlighter to use.- Returns:
- the
Set<
that was used before or null if nothing changed.IPointPainter
> - See Also:
-
setRenderer
Allows the chart this instance is painted by to register itself.This is internally required for synchronization and re-ordering due to z-Index changes.
- Specified by:
setRenderer
in interfaceITrace2D
- Parameters:
renderer
- the chart that paints this instance.
-
setStroke
Description copied from interface:ITrace2D
Allows to specify the rendering of the ITrace2D. This Stroke will be assigned to theGraphics2D
by the renderingChart2D
when painting this instance. -
setTracePainter
Description copied from interface:ITrace2D
Replaces all internal trace painters by the new one.- Specified by:
setTracePainter
in interfaceITrace2D
- Parameters:
painter
- the new sole painter to use.- Returns:
- the
Set<
that was used before.ITracePainter
> - See Also:
-
setVisible
public final void setVisible(boolean visible) Set the visible property of this instance.
Invisible
ITrace2D
instances (visible == false) will not be painted.- Specified by:
setVisible
in interfaceITrace2D
- Parameters:
visible
- the visible property of this instance to set.- See Also:
-
setZIndex
Description copied from interface:ITrace2D
Sets the internal z-index property. This decides the order in which different traces within the same
are painted.Chart2D
The higher the given value is the more this trace will be brought to front.
The value must not be lower than
ITrace2D.Z_INDEX_MIN
(0) and higher thanITrace2D.ZINDEX_MAX
(100).This might not be tested for increased performance but ignoring these bounds may result in wrong ordering of display.
-
showsErrorBars
public boolean showsErrorBars()Description copied from interface:ITrace2D
Tests whether error bars are painted by this trace.Returns true if
- this trace contains
IErrorBarPolicy
instances. - and at least one of these instances contains at least one
IErrorBarPainter
instance.
- Specified by:
showsErrorBars
in interfaceITrace2D
- Returns:
- true if this trace renders error bars.
- See Also:
- this trace contains
-
showsNegativeXErrorBars
public boolean showsNegativeXErrorBars()Description copied from interface:ITrace2D
Tests whether error bars in negative x direction are painted by this trace.Returns true if
- this trace contains at leaste one
IErrorBarPolicy
instance thatIErrorBarPolicy.isShowNegativeXErrors()
. - and at least one of these instances contains at least one
IErrorBarPainter
instance.
- Specified by:
showsNegativeXErrorBars
in interfaceITrace2D
- Returns:
- true if this trace renders error bars in negative x direction.
- See Also:
- this trace contains at leaste one
-
showsNegativeYErrorBars
public boolean showsNegativeYErrorBars()Description copied from interface:ITrace2D
Tests whether error bars in negative y direction are painted by this trace.Returns true if
- this trace contains at leaste one
IErrorBarPolicy
instance thatIErrorBarPolicy.isShowNegativeYErrors()
. - and at least one of these instances contains at least one
IErrorBarPainter
instance.
- Specified by:
showsNegativeYErrorBars
in interfaceITrace2D
- Returns:
- true if this trace renders error bars in negative y direction.
- See Also:
- this trace contains at leaste one
-
showsPositiveXErrorBars
public boolean showsPositiveXErrorBars()Description copied from interface:ITrace2D
Tests whether error bars in positive x direction are painted by this trace.Returns true if
- this trace contains at leaste one
IErrorBarPolicy
instance thatIErrorBarPolicy.isShowPositiveXErrors()
. - and at least one of these instances contains at least one
IErrorBarPainter
instance.
- Specified by:
showsPositiveXErrorBars
in interfaceITrace2D
- Returns:
- true if this trace renders error bars in positive x direction.
- See Also:
- this trace contains at leaste one
-
showsPositiveYErrorBars
public boolean showsPositiveYErrorBars()Description copied from interface:ITrace2D
Tests whether error bars in positive y direction are painted by this trace.Returns true if
- this trace contains at leaste one
IErrorBarPolicy
instance thatIErrorBarPolicy.isShowPositiveYErrors()
. - and at least one of these instances contains at least one
IErrorBarPainter
instance.
- Specified by:
showsPositiveYErrorBars
in interfaceITrace2D
- Returns:
- true if this trace renders error bars in positive y direction.
- See Also:
- this trace contains at leaste one
-
toString
ReturnsgetName()
.
-