public class Trace2DCandleSticks extends Object implements ITrace2D
Pass in the real trace implementation (e.g.
to the constructor to add the feature of drawing candlesticks to the
technical implementation. Like this:
Trace2DLtd
ITrace2D candleStickTrace = new Trace2DCandleSticks(new Trace2DLtd());
ITrace2D.DistancePoint
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
Constructor and Description |
---|
Trace2DCandleSticks(ITrace2D delegateThatIsEnrichedByCandlestickPainting,
int candleStickWidth)
Constructor taking the trace implementation to decorate with candle stick
painting.
|
Modifier and Type | Method and Description |
---|---|
void |
addComputingTrace(ITrace2D trace)
Adds a trace that "should" compute values from the points added via
. |
boolean |
addErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
Adds the given error bar policy to the internal set of error bar policies.
|
boolean |
addPoint(double x,
double y)
Adds a trace point to the internal data.
|
boolean |
addPoint(ITracePoint2D p)
Adds the given
TracePoint2D to the internal data. |
boolean |
addPoint(ITracePoint2D p,
ITrace2D wrapperOfMe)
Do not call this unless you know what it does.
|
boolean |
addPointHighlighter(IPointPainter<?> highlighter)
Adds the given point painter to the internal set of point highlighters.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Registers a property change listener that will be informed about changes of
the property identified by the given
propertyName . |
boolean |
addTracePainter(ITracePainter<?> painter)
Adds the given trace painter to the internal set of trace painters.
|
int |
compareTo(ITrace2D o) |
boolean |
containsTracePainter(ITracePainter<?> painter)
Returns true if the given painter is contained in this compound painter.
|
Iterator<ITracePoint2D> |
descendingIterator()
Returns an
Iterator over the internal
instances in reverse order. |
void |
firePointChanged(ITracePoint2D changed,
ITracePoint2D.STATE state,
Object oldValue,
Object newValue)
Method to trigger by
, or
. |
Color |
getColor()
Because the color is data common to a trace of a
Chart2D it is
stored here. |
Set<IErrorBarPolicy<?>> |
getErrorBarPolicies()
Returns the
Set< that will be
used to render error bars for this trace. |
boolean |
getHasErrorBars()
Returns true if this trace has error bars configured.
|
String |
getLabel()
Callback method for the
Chart2D that returns a
String describing the label of the ITrace2D that
will be displayed below the drawing area of the Chart2D . |
int |
getMaxSize()
Returns the maximum amount of
ITracePoint2D instances that may be
added. |
double |
getMaxX()
Returns the maximum value to be displayed on the x- axis of the
Chart2D . |
double |
getMaxY()
Returns the maximum value to be displayed on the y- axis of the Chart2D.
|
double |
getMinX()
Returns the minimum value to be displayed on the x- axis of the Chart2D.
|
double |
getMinY()
Returns the minimum value to be displayed on the y- axis of the Chart2D.
|
String |
getName()
Returns the name of this trace.
|
ITrace2D.DistancePoint |
getNearestPointEuclid(double x,
double y)
Returns the nearest point to the given normalized value coordinates of this
trace in Euclid distance.
|
ITrace2D.DistancePoint |
getNearestPointManhattan(double x,
double y)
Returns the nearest point to the given normalized value coordinates of this
trace in Manhattan distance.
|
String |
getPhysicalUnits()
Returns the concatenation
[x: " . |
String |
getPhysicalUnitsX()
Returns the physical unit string value for the x dimension.
|
String |
getPhysicalUnitsY()
Returns the physical unit string value for the y dimension.
|
Set<IPointPainter<?>> |
getPointHighlighters()
Returns the
Set< that may be used
to highlight points of this trace. |
PropertyChangeListener[] |
getPropertyChangeListeners(String property)
Returns all property change listeners for the given property.
|
Chart2D |
getRenderer() |
int |
getSize()
Returns the amount of
ITracePoint2D instances currently contained. |
Stroke |
getStroke()
Returns the Stroke that is used to render this instance.
|
Set<ITracePainter<?>> |
getTracePainters()
Returns the
Set< that will be used
to paint this trace. |
ITracePointProvider |
getTracePointProvider()
Returns the trace point creator of this trace.
|
Integer |
getZIndex()
The z-index defines the order in which this instance will be painted.
|
void |
initPaintIteration()
Hook called before each paint iteration.
|
boolean |
isAdditionalSpaceRequired()
Returns true if additional space is required for rendering the points.
|
boolean |
isEmpty()
Returns false if internal
instances are
contained or true if not. |
boolean |
isPixelTransformationRequired()
Returns true if a transformation from pixel-domain to value-domain is
needed for min-max - search.
|
boolean |
isVisible()
Returns true if this instance should be rendered.
|
Iterator<ITracePoint2D> |
iterator()
Returns an
Iterator over the internal
instances. |
double |
maxXSearch()
"Internal" expensive 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.
|
double |
maxYSearch()
"Internal" expensive 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.
|
double |
minXSearch()
"Internal" expensive 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.
|
double |
minYSearch()
"Internal" expensive 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 |
onAdded2ChartBeforeFirstPaint()
Hook called when the trace has been added to a chart but before the first paint operation.
|
void |
propertyChange(PropertyChangeEvent evt) |
Set<IPointPainter<?>> |
removeAllPointHighlighters()
Clears all internal point highlighters used.
|
void |
removeAllPoints()
Removes all internal
TracePoint2D .ITrace2D.isEmpty() will
return true afterwards. |
boolean |
removeComputingTrace(ITrace2D trace)
Remove a trace that "should" compute values from the points added via
. |
boolean |
removeErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
Removes the given error bar policy from the internal set of error bar
policies.
|
boolean |
removePoint(ITracePoint2D point)
Removes the given point from this trace.
|
boolean |
removePointHighlighter(IPointPainter<?> highlighter)
Removes the given point highlighter, if it's class is contained.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
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.
|
void |
setColor(Color color)
Set a
java.awt.Color for this trace. |
Set<IErrorBarPolicy<?>> |
setErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
Replaces all internal error bar policies by the new one.
|
void |
setName(String name)
Assingns a specific name to the
ITrace2D which will be
displayed by the Chart2D . |
void |
setPhysicalUnits(String xunit,
String yunit)
Assigns a specific String representing the physical unit to the
ITrace2D (e.g. |
Set<IPointPainter<?>> |
setPointHighlighter(IPointPainter<?> highlighter)
Replaces all internal point highlighters by the new one.
|
void |
setRenderer(Chart2D renderer)
This is a callback from
Chart2D.addTrace(ITrace2D) and must not be
invoked from elsewhere (needed for synchronization). |
void |
setStroke(Stroke stroke)
Allows to specify the rendering of the ITrace2D.
|
Set<ITracePainter<?>> |
setTracePainter(ITracePainter<?> painter)
Replaces all internal trace painters by the new one.
|
void |
setTracePointProvider(ITracePointProvider tracePointProvider)
Sets the trace point creator of this trace.
|
void |
setVisible(boolean visible)
Set the visibility.
|
void |
setZIndex(Integer zIndex)
Sets the internal z-index property.
|
boolean |
showsErrorBars()
Tests whether error bars are painted by this trace.
|
boolean |
showsNegativeXErrorBars()
Tests whether error bars in negative x direction are painted by this trace.
|
boolean |
showsNegativeYErrorBars()
Tests whether error bars in negative y direction are painted by this trace.
|
boolean |
showsPositiveXErrorBars()
Tests whether error bars in positive x direction are painted by this trace.
|
boolean |
showsPositiveYErrorBars()
Tests whether error bars in positive y direction are painted by this trace.
|
public Trace2DCandleSticks(ITrace2D delegateThatIsEnrichedByCandlestickPainting, int candleStickWidth)
delegateThatIsEnrichedByCandlestickPainting
- impl that will deal with the basic trace functionality.candleStickWidth
- width of the candlesticks.public void initPaintIteration()
ITrace2D
initPaintIteration
in interface ITrace2D
ITrace2D.initPaintIteration()
public void onAdded2ChartBeforeFirstPaint()
ITrace2D
onAdded2ChartBeforeFirstPaint
in interface ITrace2D
ITrace2D.onAdded2ChartBeforeFirstPaint()
public void addComputingTrace(ITrace2D trace)
ITrace2D
ITrace2D.addPoint(ITracePoint2D)
.
The given trace will be informed in case an add operation on this trace
succeeds via
.ITrace2D.addPoint(ITracePoint2D)
addComputingTrace
in interface ITrace2D
trace
- ITrace2D.addComputingTrace(info.monitorenter.gui.chart.ITrace2D)
public boolean addErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
ITrace2D
It will be the last error bar policy to render (most forward on screen).
addErrorBarPolicy
in interface ITrace2D
errorBarPolicy
- the error bar policy to add for rendering this trace's error bars.ITrace2D.addErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)
public boolean addPoint(double x, double y)
ITrace2D
addPoint
in interface ITrace2D
x
- the x-value of the point to add.y
- the y-value of the point to add.ITrace2D.addPoint(double, double)
public boolean addPoint(ITracePoint2D p)
ITrace2D
TracePoint2D
to the internal data.
Try to pass instances of TracePoint2D
to this instance instead
of invoking
to increase
performance. Else the given point has to be copied into such an instance
from the other method and delegated to this method.
ITrace2D.addPoint(double, double)
Implementations decide whether the point will be accepted or not. So they
have to update the internal properties minX
, maxX
,maxY
and minY
and also care about firing
property change events for those properties by method
.
PropertyChangeSupport.firePropertyChange(java.beans.PropertyChangeEvent)
addPoint
in interface ITrace2D
p
- the point to add.ITrace2D.addPoint(info.monitorenter.gui.chart.ITracePoint2D)
public boolean addPoint(ITracePoint2D p, ITrace2D wrapperOfMe)
ITrace2D
ITrace2D
implementations that decorate other implementations and
have to register themselves with the added point (instead of this instance
directly).
Prefer calling ITrace2D.addPoint(ITracePoint2D)
.
addPoint
in interface ITrace2D
p
- the TracePoint2D
to add.wrapperOfMe
- the trace instance that wraps this instance.ITrace2D.addPoint(info.monitorenter.gui.chart.ITracePoint2D,
info.monitorenter.gui.chart.ITrace2D)
public boolean addPointHighlighter(IPointPainter<?> highlighter)
ITrace2D
It will be the last point painter to paint highlighting if highlighting is active.
addPointHighlighter
in interface ITrace2D
highlighter
- the highlighter to add for highlighting this trace.ITrace2D.addPointHighlighter(info.monitorenter.gui.chart.IPointPainter)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
ITrace2D
propertyName
.
addPropertyChangeListener
in interface ITrace2D
propertyName
- the name of the property the listener is interested inlistener
- a listener that will only be informed if the property identified
by the argument propertyName
changesITrace2D.addPropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)
public boolean addTracePainter(ITracePainter<?> painter)
ITrace2D
It will be the last painter to paint (most forward).
addTracePainter
in interface ITrace2D
painter
- the painter to add for rendering this trace.ITrace2D.addTracePainter(info.monitorenter.gui.chart.ITracePainter)
public int compareTo(ITrace2D o)
compareTo
in interface Comparable<ITrace2D>
Comparable.compareTo(java.lang.Object)
public boolean containsTracePainter(ITracePainter<?> painter)
ITrace2D
containsTracePainter
in interface ITrace2D
painter
- the painter to check whether it is contained.ITrace2D.containsTracePainter(info.monitorenter.gui.chart.ITracePainter)
public Iterator<ITracePoint2D> descendingIterator()
ITrace2D
Iterator
over the internal
ITrace2D
instances in reverse order.
Implementations should be synchronized. This method is meant to allow
modifications of the internal
instances,
so the original points should be returned.
ITracePoint2D
There is no guarantee that changes made to the contained tracepoints will
be reflected in the display immediately. The order the iterator returns the
instances decides how the
ITracePoint2D
Chart2D
will paint the trace.
descendingIterator
in interface ITrace2D
Iterator
over the internal
ITracePoint2D
instances in descending order.ITrace2D.descendingIterator()
public void firePointChanged(ITracePoint2D changed, ITracePoint2D.STATE state, Object oldValue, Object newValue)
ITrace2D
ITracePoint2D.setLocation(double, double)
, ITrace2D.addPoint(ITracePoint2D)
or
ITrace2D.removePoint(ITracePoint2D)
.
Bound checks are performed and property change events for the properties
,
ITrace2D.PROPERTY_MAX_X
,
ITrace2D.PROPERTY_MIN_X
and
ITrace2D.PROPERTY_MAX_Y
are fired if the add bounds
have changed due to the modification of the point.
ITrace2D.PROPERTY_MIN_Y
firePointChanged
in interface ITrace2D
changed
- the point that has been changed which may be a newly added point
(from ITrace2D.addPoint(ITracePoint2D)
, a removed one
or a modified one.state
- one of ITracePoint2D.STATE
.oldValue
- the old value, or an old x coordinate. May vary depending on
state: ITracePoint2D.STATE.ADDED
: null ITracePoint2D.STATE.REMOVED
: Double, the old x value. ITracePoint2D.STATE.ADDITIONAL_POINT_PAINTER_ADDED
: null. ITracePoint2D.STATE.ADDITIONAL_POINT_PAINTER_REMOVED
:
IPointPainter
, the old point painter that was removed. ITracePoint2D.STATE.CHANGED
: Double
, the old x
coordinate. newValue
- the new value, or an old y coordinate. May vary depending on
state: ITracePoint2D.STATE.ADDED
: null ITracePoint2D.STATE.REMOVED
: Double, the old y value. ITracePoint2D.STATE.ADDITIONAL_POINT_PAINTER_ADDED
:
IPointPainter
, the new point painter that was added. ITracePoint2D.STATE.ADDITIONAL_POINT_PAINTER_REMOVED
: null ITracePoint2D.STATE.CHANGED
: Double
, the old y
coordinate. ITrace2D.firePointChanged(info.monitorenter.gui.chart.ITracePoint2D, info.monitorenter.gui.chart.ITracePoint2D.STATE, java.lang.Object, java.lang.Object)
public Color getColor()
ITrace2D
Chart2D
it is
stored here.
On the other hand only the corresponding Chart2D
may detect
the same color chosen for different IChart2D
instances to be
displayed. Therefore it is allowed to return null. This is a message to the
Chart2D
to leave it the choice of the color. Then the
Chart2D
will chose a color not owned by another
ITrace2D
instance managed and assign it to the null- returning
instance.
The Chart2D
will often call this method. So try to cache the
value in implementation and only check on modifications of
TracePoint
instances or on add
- invocations for
changes.
getColor
in interface ITrace2D
Chart2D
.ITrace2D.getColor()
public Set<IErrorBarPolicy<?>> getErrorBarPolicies()
ITrace2D
Set<IErrorBarPolicy
>
that will be
used to render error bars for this trace.
getErrorBarPolicies
in interface ITrace2D
Set<IErrorBarPolicy
>
that will be
used to render error bars for this trace.ITrace2D.getErrorBarPolicies()
public boolean getHasErrorBars()
ITrace2D
If this returns false, no error bars will be painted for this trace.
getHasErrorBars
in interface ITrace2D
ITrace2D.getHasErrorBars()
public String getLabel()
ITrace2D
Chart2D
that returns a
String
describing the label of the ITrace2D
that
will be displayed below the drawing area of the Chart2D
.
This method should be implemented and finalized ASAP in the inheritance
tree and rely on the property name
and
physicalUnits
.
getLabel
in interface ITrace2D
ITrace2D.getLabel()
public int getMaxSize()
ITrace2D
Returns the maximum amount of ITracePoint2D
instances that may be
added. For implementations that limit the maximum amount this is a
reasonable amount. Non-limiting implementations should return
Integer.MAX_VALUE
. This allows to detect the unlimitedness. Of
course no implementation could store that amount of points.
getMaxSize
in interface ITrace2D
ITracePoint2D
instances that may be
added.ITrace2D.getMaxSize()
public double getMaxX()
ITrace2D
Chart2D
. Implementations should be synchronized for
multithreaded use. No exception is thrown. In case of empty data (no
tracepoints) 0 should be returned, to let the Chart2D know.
The Chart2D
will often call this method. So try to cache the
value in implementation and only check on modifications of
TracePoint
instances or on add
- invocations for
changes.
getMaxX
in interface ITrace2D
ITrace2D.getMaxX()
public double getMaxY()
ITrace2D
getMaxY
in interface ITrace2D
ITrace2D.getMaxY()
public double getMinX()
ITrace2D
Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned. (watch division with zero).
The Chart2D
will often call this method. So try to cache the
value in implementation and only check on modifications of
TracePoint
instances or on add
- invocations for
changes.
getMinX
in interface ITrace2D
ITrace2D.getMinX()
public double getMinY()
ITrace2D
Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned. (watch division with zero).
The Chart2D
will often call this method. So try to cache the
value in implementation and only check on modifications of
TracePoint
instances or on add
- invocations for
changes.
getMinY
in interface ITrace2D
ITrace2D.getMinY()
public String getName()
ITrace2D
getName
in interface ITrace2D
ITrace2D.getName()
public ITrace2D.DistancePoint getNearestPointEuclid(double x, double y)
ITrace2D
Please note that the arguments must be normalized value coordinates like
provided by a
or the
division of a pixel coordinate by the total pixel range of the chart.
ITracePoint2D.getScaledX()
Using the Manhattan distance is much faster than Euclid distance as it only includes basic addition an absolute value for computation per point (vs. square root, addition and quadrature for Euclid distance). However the euclid distance spans a circle for the nearest points which is visually more normal for end users than the Manhattan distance which forms a rhombus and reaches far distances in only one dimension.
getNearestPointEuclid
in interface ITrace2D
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.ITrace2D.getNearestPointEuclid(double,
double)
public ITrace2D.DistancePoint getNearestPointManhattan(double x, double y)
ITrace2D
Please note that the arguments must be normalized value coordinates like
provided by a
or the
division of a pixel coordinate by the total pixel range of the chart.
ITracePoint2D.getScaledX()
Using the Manhattan distance is much faster than Euclid distance as it only includes basic addition an absolute value for computation per point (vs. square root, addition and quadrature for Euclid distance).
getNearestPointManhattan
in interface ITrace2D
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.ITrace2D.getNearestPointManhattan(double,
double)
public String getPhysicalUnits()
ITrace2D
[x: "ITrace2D.getPhysicalUnitsX()
", y: "
ITrace2D.getPhysicalUnitsY()
"]
.
getPhysicalUnits
in interface ITrace2D
[x: "ITrace2D.getPhysicalUnitsX()
", y: "
ITrace2D.getPhysicalUnitsY()
"]
.ITrace2D.getPhysicalUnits()
public String getPhysicalUnitsX()
ITrace2D
getPhysicalUnitsX
in interface ITrace2D
ITrace2D.getPhysicalUnitsX()
public String getPhysicalUnitsY()
ITrace2D
getPhysicalUnitsY
in interface ITrace2D
ITrace2D.getPhysicalUnitsY()
public Set<IPointPainter<?>> getPointHighlighters()
ITrace2D
Set<IPointPainter
>
that may be used
to highlight points of this trace.
This is used by the point highlighting feature:
Chart2D.enablePointHighlighting(boolean)
getPointHighlighters
in interface ITrace2D
Set<IPointPainter
>
that may be used
to highlight points.ITrace2D.getPointHighlighters()
public PropertyChangeListener[] getPropertyChangeListeners(String property)
ITrace2D
getPropertyChangeListeners
in interface ITrace2D
property
- one of the constants with the PROPERTY_
prefix
defined in this class or subclasses.ITrace2D.getPropertyChangeListeners(java.lang.String)
public Chart2D getRenderer()
getRenderer
in interface ITrace2D
ITrace2D.getRenderer()
public int getSize()
ITrace2D
ITracePoint2D
instances currently contained.
getSize
in interface ITrace2D
ITracePoint2D
instances
currently contained.ITrace2D.getSize()
public Stroke getStroke()
ITrace2D
getStroke
in interface ITrace2D
ITrace2D.getStroke()
public Set<ITracePainter<?>> getTracePainters()
ITrace2D
Set<ITracePainter
>
that will be used
to paint this trace.
The original set should be returned by contract to allow adding painters
"silently" (vs. using
).
ITrace2D.addTracePainter(ITracePainter)
getTracePainters
in interface ITrace2D
Set<ITracePainter
>
that will be used
to paint this trace.ITrace2D.getTracePainters()
public ITracePointProvider getTracePointProvider()
ITrace2D
getTracePointProvider
in interface ITrace2D
ITrace2D.getTracePointProvider()
public Integer getZIndex()
ITrace2D
A higher value will bring it more "to the front".
getZIndex
in interface ITrace2D
ITrace2D.getZIndex()
public boolean isAdditionalSpaceRequired()
ITrace2D
In this case min-max - search is much more expensive (points * 2 * painters).
isAdditionalSpaceRequired
in interface ITrace2D
ITrace2D.isAdditionalSpaceRequired()
public boolean isEmpty()
ITrace2D
ITracePoint2D
instances are
contained or true if not.
isEmpty
in interface ITrace2D
ITracePoint2D
instances are contained or true if not.ITrace2D.isEmpty()
public boolean isPixelTransformationRequired()
ITrace2D
In this case min-max - search is much more expensive (points * 2 * painters).
isPixelTransformationRequired
in interface ITrace2D
ITrace2D.isPixelTransformationRequired()
public boolean isVisible()
ITrace2D
isVisible
in interface ITrace2D
ITrace2D.isVisible()
public Iterator<ITracePoint2D> iterator()
ITrace2D
Iterator
over the internal
ITrace2D
instances.
Implementations should be synchronized. This method is meant to allow
modifications of the internal
instances,
so the original points should be returned.
ITracePoint2D
There is no guarantee that changes made to the contained tracepoints will
be reflected in the display immediately. The order the iterator returns the
instances decides how the
ITracePoint2D
Chart2D
will paint the trace.
iterator
in interface ITrace2D
Iterator
over the internal
ITracePoint2D
instances.ITrace2D.iterator()
public double maxXSearch()
ITrace2D
maxXSearch
in interface ITrace2D
ITrace2D.maxXSearch()
public double maxYSearch()
ITrace2D
maxYSearch
in interface ITrace2D
ITrace2D.maxYSearch()
public double minXSearch()
ITrace2D
minXSearch
in interface ITrace2D
ITrace2D.minXSearch()
public double minYSearch()
ITrace2D
minYSearch
in interface ITrace2D
ITrace2D.minYSearch()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
evt
- PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public Set<IPointPainter<?>> removeAllPointHighlighters()
ITrace2D
Returns the Set<
that was used to
highlight points.
IPointPainter
>
This is used by the point highlighting feature:
Chart2D.enablePointHighlighting(boolean)
removeAllPointHighlighters
in interface ITrace2D
Set<IPointPainter
>
that was be used
to highlight points.ITrace2D.removeAllPointHighlighters()
public void removeAllPoints()
ITrace2D
TracePoint2D
.ITrace2D.isEmpty()
will
return true afterwards.
removeAllPoints
in interface ITrace2D
ITrace2D.removeAllPoints()
public boolean removeComputingTrace(ITrace2D trace)
ITrace2D
ITrace2D.addPoint(ITracePoint2D)
.
removeComputingTrace
in interface ITrace2D
trace
- the trace that will calculate it's points from the added points of
this trace.Object.equals(Object)
).ITrace2D.removeComputingTrace(info.monitorenter.gui.chart.ITrace2D)
public boolean removeErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
ITrace2D
removeErrorBarPolicy
in interface ITrace2D
errorBarPolicy
- the error bar policy to remove.ITrace2D.removeErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)
public boolean removePoint(ITracePoint2D point)
ITrace2D
removePoint
in interface ITrace2D
point
- the point to remove.ITrace2D.removePoint(info.monitorenter.gui.chart.ITracePoint2D)
public boolean removePointHighlighter(IPointPainter<?> highlighter)
ITrace2D
removePointHighlighter
in interface ITrace2D
highlighter
- the highlighter to remove.ITrace2D.removePointHighlighter(info.monitorenter.gui.chart.IPointPainter)
public void removePropertyChangeListener(PropertyChangeListener listener)
ITrace2D
removePropertyChangeListener
in interface ITrace2D
listener
- a listener that will only be informed if the property identified
by the argument propertyName
changesITrace2D.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
ITrace2D
removePropertyChangeListener
in interface ITrace2D
property
- one of the constants with the PROPERTY_
prefix
defined in this class or subclasses.listener
- the listener for this property change.ITrace2D.removePropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)
public boolean removeTracePainter(ITracePainter<?> painter)
ITrace2D
removeTracePainter
in interface ITrace2D
painter
- the trace painter to remove.ITrace2D.removeTracePainter(info.monitorenter.gui.chart.ITracePainter)
public void setColor(Color color)
ITrace2D
java.awt.Color
for this trace.
setColor
in interface ITrace2D
color
- the Color to set.ITrace2D.setColor(java.awt.Color)
public Set<IErrorBarPolicy<?>> setErrorBarPolicy(IErrorBarPolicy<?> errorBarPolicy)
ITrace2D
setErrorBarPolicy
in interface ITrace2D
errorBarPolicy
- the new sole painter to use.Set<IErrorBarPolicy
>
that was used
before.ITrace2D.setErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)
public void setName(String name)
ITrace2D
ITrace2D
which will be
displayed by the Chart2D
.
setName
in interface ITrace2D
name
- the name for this trace.ITrace2D.setName(java.lang.String)
public void setPhysicalUnits(String xunit, String yunit)
ITrace2D
ITrace2D
(e.g. Volt, Ohm, lux, ...) which will be displayed by the
Chart2D
setPhysicalUnits
in interface ITrace2D
xunit
- the physical unit for the x axis.yunit
- the physical unit for the y axis.ITrace2D.setPhysicalUnits(java.lang.String,
java.lang.String)
public Set<IPointPainter<?>> setPointHighlighter(IPointPainter<?> highlighter)
ITrace2D
setPointHighlighter
in interface ITrace2D
highlighter
- the new sole highlighter to use.Set<IPointPainter
>
that was used
before or null if nothing changed.ITrace2D.setPointHighlighter(info.monitorenter.gui.chart.IPointPainter)
public void setRenderer(Chart2D renderer)
ITrace2D
Chart2D.addTrace(ITrace2D)
and must not be
invoked from elsewhere (needed for synchronization).
Not the best design to put this to an interface, but Char2D should handle this interface only.
setRenderer
in interface ITrace2D
renderer
- The renderer to set.ITrace2D.setRenderer(info.monitorenter.gui.chart.Chart2D)
public void setStroke(Stroke stroke)
ITrace2D
Graphics2D
by the rendering
Chart2D
when painting this instance.
setStroke
in interface ITrace2D
stroke
- the stroke to use for painting this trace.ITrace2D.setStroke(java.awt.Stroke)
public Set<ITracePainter<?>> setTracePainter(ITracePainter<?> painter)
ITrace2D
setTracePainter
in interface ITrace2D
painter
- the new sole painter to use.Set<ITracePainter
>
that was used
before.ITrace2D.setTracePainter(info.monitorenter.gui.chart.ITracePainter)
public void setTracePointProvider(ITracePointProvider tracePointProvider) throws UnsupportedOperationException
ITrace2D
Null assignment attempts will raise an
.
AssertionError
setTracePointProvider
in interface ITrace2D
tracePointProvider
- the trace point creator of this trace to set.UnsupportedOperationException
- always.ITrace2D.setTracePointProvider(info.monitorenter.gui.chart.ITracePointProvider)
public void setVisible(boolean visible)
ITrace2D
setVisible
in interface ITrace2D
visible
- true if this trace should be painted, false else.ITrace2D.setVisible(boolean)
public void setZIndex(Integer zIndex)
ITrace2D
Chart2D
are painted.
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 than
ITrace2D.ZINDEX_MAX
(100).
This might not be tested for increased performance but ignoring these bounds may result in wrong ordering of display.
setZIndex
in interface ITrace2D
zIndex
- the z index of this trace - the lower the value the more in front
the trace will appear amongst other traces in the same chart.ITrace2D.setZIndex(java.lang.Integer)
public boolean showsErrorBars()
ITrace2D
Returns true if
IErrorBarPolicy
instances.IErrorBarPainter
instance.showsErrorBars
in interface ITrace2D
ITrace2D.showsErrorBars()
public boolean showsNegativeXErrorBars()
ITrace2D
Returns true if
IErrorBarPolicy
instance that
IErrorBarPolicy.isShowNegativeXErrors()
.IErrorBarPainter
instance.showsNegativeXErrorBars
in interface ITrace2D
ITrace2D.showsNegativeXErrorBars()
public boolean showsNegativeYErrorBars()
ITrace2D
Returns true if
IErrorBarPolicy
instance that
IErrorBarPolicy.isShowNegativeYErrors()
.IErrorBarPainter
instance.showsNegativeYErrorBars
in interface ITrace2D
ITrace2D.showsNegativeYErrorBars()
public boolean showsPositiveXErrorBars()
ITrace2D
Returns true if
IErrorBarPolicy
instance that
IErrorBarPolicy.isShowPositiveXErrors()
.IErrorBarPainter
instance.showsPositiveXErrorBars
in interface ITrace2D
ITrace2D.showsPositiveXErrorBars()
public boolean showsPositiveYErrorBars()
ITrace2D
Returns true if
IErrorBarPolicy
instance that
IErrorBarPolicy.isShowPositiveYErrors()
.IErrorBarPainter
instance.showsPositiveYErrorBars
in interface ITrace2D
ITrace2D.showsPositiveYErrorBars()
Copyright © 2017. All rights reserved.