public interface ITracePoint2D extends Comparable<ITracePoint2D>, Serializable, Cloneable
Modifier and Type | Interface and Description |
---|---|
static class |
ITracePoint2D.STATE |
Modifier and Type | Method and Description |
---|---|
boolean |
addAdditionalPointPainter(IPointPainter<?> pointPainter)
Adds a point painter that additionally (to the pointer painters of the
trace (
)) paint this
point. |
Object |
clone()
Returns a cloned instance (deep copy).
|
Set<IPointPainter<?>> |
getAdditionalPointPainters()
Returns the point painter that additionally (to the trace painter of the
chart) paint this point.
|
double |
getEuclidDistance(double xNormalized,
double yNormalized)
Returns the Euclid distance of this point's normalized values (
) to the given
normalized coordinates. |
ITrace2D |
getListener()
Returns the listener trace connected to this trace point.
|
double |
getManhattanDistance(double xNormalized,
double yNormalized)
Returns the Manhattan distance of this point's normalized values (
) to the given
normalized coordinates. |
double[] |
getNormalizedHighlightSweetSpotCoordinates()
Returns the normalized coordinates of this point that should be highlighted
or null if
new double[]{this.getX(), this.getY()};
is the position to highlight. |
double |
getScaledX() |
double |
getScaledY() |
String |
getTooltipText()
Returns the tool tip text that should be displayed in case this trace point
is selected to show a tool tip.
|
double |
getX()
Returns the x value.
|
double |
getY()
Returns the y value.
|
boolean |
isDiscontinuation()
|
boolean |
isVisble()
Returns true if
getScaledX() AND getScaledY() is in the
range [0.0..1.0] and isDiscontinuation() returns false. |
boolean |
removeAdditionalPointPainter(IPointPainter<?> pointPainter)
Removes a point painter that additionally (to the pointer painters of the
trace (
)) paint this
point. |
Set<IPointPainter<?>> |
removeAllAdditionalPointPainters()
Removes all point painters that additionally (to the pointer painters of
the trace (
)) paint this
point. |
void |
setListener(ITrace2D listener)
Allows
ITrace2D instances to register (or de-register)
themselves with this point to receive (or stop receiving) change
information via
ITrace2D#firePointChanged(ITracePoint2D, STATE, Object, Object)
events. |
void |
setLocation(double xValue,
double yValue)
This method overloads the method of
java.awt.geom.Point2D.Double to fire a property change event
to listeners of the corresponding instances
via their method
(with int argument set to ). |
void |
setScaledX(double scaledX)
Only intended for Chart2D!!!.
|
void |
setScaledY(double scaledY)
Only intended for Chart2D!!!.
|
compareTo
boolean addAdditionalPointPainter(IPointPainter<?> pointPainter)
ITrace2D.getTracePainters()
)) paint this
point.
No clone will be taken. Outside modifications of the argument later on will also affect this instances state!
Caution! This is a low level mechanism that is also used by the
highlighting mechanism. It is being utilized by the
which will
use some mouse motion listener to remove outdated highlighters and add
highlighters to the new point in focus by taking the highlighter configured
in the trace. Chart2D.enablePointHighlighting(boolean)
So to use point highlighting for traces you should not re-program it at
this level but just use
and
ITrace2D.addPointHighlighter(IPointPainter)
Chart2D.enablePointHighlighting(boolean)
.
pointPainter
- a point painter that will additionally (to the trace painter of
the chart) paint this point. Comparable.compareTo(Object)
.Object clone()
Set<IPointPainter<?>> getAdditionalPointPainters()
The original list is returned so painters may be added or removed (even all painters may be cleared).
double getEuclidDistance(double xNormalized, double yNormalized)
getScaledX()
, getScaledY()
) to the given
normalized coordinates.
xNormalized
- the normalized x coordinate between 0 and 1.0 to measure the
Euclid distance to.yNormalized
- the normalized y coordinate between 0 and 1.0 to measure the
Euclid distance to.
getScaledX()
, getScaledY()
) to the given
normalized coordinates.ITrace2D getListener()
double getManhattanDistance(double xNormalized, double yNormalized)
getScaledX()
, getScaledY()
) to the given
normalized coordinates.
xNormalized
- the normalized x coordinate between 0 and 1.0 to measure the
Manhattan distance to.yNormalized
- the normalized y coordinate between 0 and 1.0 to measure the
Manhattan distance to.
getScaledX()
, getScaledY()
) to the given
normalized coordinates.double[] getNormalizedHighlightSweetSpotCoordinates()
new double[]{this.getX(), this.getY()};
is the position to highlight.
Trace point implementations (like CandleStick
) render larger spaces
than their center coordinate. Those may return the area of interest that
should be highlighted.
double getScaledX()
double getScaledY()
String getTooltipText()
double getX()
Point2D.getX()
double getY()
Point2D.getY()
boolean isDiscontinuation()
getX()
and/or getY()
is
Double.NaN
which signals a discontinuation.boolean isVisble()
getScaledX()
AND getScaledY()
is in the
range [0.0..1.0] and isDiscontinuation()
returns false.
This call only makes sense after the point has been added to a trace.
getScaledX()
AND getScaledY()
is in the
range [0.0..1.0] and isDiscontinuation()
returns false.boolean removeAdditionalPointPainter(IPointPainter<?> pointPainter)
ITrace2D.getTracePainters()
)) paint this
point.
pointPainter
- a point painter that currently is used to additionally (to the
trace painter of the chart) paint this point. Comparable.compareTo(Object)
.Set<IPointPainter<?>> removeAllAdditionalPointPainters()
ITrace2D.getTracePainters()
)) paint this
point.
void setListener(ITrace2D listener)
ITrace2D
instances to register (or de-register)
themselves with this point to receive (or stop receiving) change
information via
ITrace2D#firePointChanged(ITracePoint2D, STATE, Object, Object)
events.
listener
- The instance that will be informed about changes or null to
deregister.void setLocation(double xValue, double yValue)
java.awt.geom.Point2D.Double
to fire a property change event
to listeners of the corresponding ITrace2D
instances
via their method
ITrace2D#firePointChanged(ITracePoint2D, STATE, Object, Object)
(with int argument set to ITracePoint2D.STATE.CHANGED
).
xValue
- the new x-coordinate for this point.yValue
- the new y-coordinate for this point.void setScaledX(double scaledX)
scaledX
- the scaledX to setvoid setScaledY(double scaledY)
scaledY
- the scaledY to setCopyright © 2017. All rights reserved.