Interface ITracePoint2D
-
- All Superinterfaces:
java.lang.Cloneable,java.lang.Comparable<ITracePoint2D>,java.io.Serializable
- All Known Implementing Classes:
TracePoint2D
public interface ITracePoint2D extends java.lang.Comparable<ITracePoint2D>, java.io.Serializable, java.lang.Cloneable
An interface for trace points.- Version:
- $Revision: 1.13 $
- Author:
- Achim Westermann
-
-
Field Summary
Fields Modifier and Type Field Description static intSTATE_ADDEDThe state flag used to inform thelistener viaITrace2Din case a point was added.ITrace2D.firePointChanged(ITracePoint2D, int)static intSTATE_CHANGEDThe state flag used to inform thelistener viaITrace2Din case a point was changed.ITrace2D.firePointChanged(ITracePoint2D, int)static intSTATE_REMOVEDThe state flag used to inform thelistener viaITrace2Din case a point was removed.ITrace2D.firePointChanged(ITracePoint2D, int)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddAdditionalPointPainter(IPointPainter<?> pointPainter)Adds a point painter that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()java.lang.Objectclone()Returns a cloned instance (deep copy).java.util.Set<IPointPainter<?>>getAdditionalPointPainters()Returns the point painter that additionally (to the trace painter of the chart) paint this point.doublegetEuclidDistance(double xNormalized, double yNormalized)Returns the Euclid distance of this point's normalized values () to the given normalized coordinates.getScaledX(),getScaledY()ITrace2DgetListener()Returns the listener trace connected to this trace point.doublegetManhattanDistance(double xNormalized, double yNormalized)Returns the Manhattan distance of this point's normalized values () to the given normalized coordinates.getScaledX(),getScaledY()doublegetManhattanDistance(ITracePoint2D point)Returns the Manhattan distance of this point to the given one.doublegetScaledX()doublegetScaledY()doublegetX()Returns the x value.doublegetY()Returns the y value.booleanremoveAdditionalPointPainter(IPointPainter<?> pointPainter)Removes a point painter that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()java.util.Set<IPointPainter<?>>removeAllAdditionalPointPainters()Removes all point painters that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()voidsetListener(ITrace2D listener)AllowsITrace2Dinstances to register (or de-register) themselves with this point to receive (or stop receiving) change information viaITrace2D.firePointChanged(ITracePoint2D, int)events.voidsetLocation(double xValue, double yValue)This method overloads the method ofjava.awt.geom.Point2D.Doubleto fire a property change event to listeners of the correspondinginstances via their methodITrace2D(with int argument set toITrace2D.firePointChanged(ITracePoint2D, int)).STATE_CHANGEDvoidsetScaledX(double scaledX)Only intended for Chart2D!!!.voidsetScaledY(double scaledY)Only intended for Chart2D!!!.
-
-
-
Field Detail
-
STATE_ADDED
static final int STATE_ADDED
The state flag used to inform thelistener viaITrace2Din case a point was added.ITrace2D.firePointChanged(ITracePoint2D, int)- See Also:
- Constant Field Values
-
STATE_CHANGED
static final int STATE_CHANGED
The state flag used to inform thelistener viaITrace2Din case a point was changed.ITrace2D.firePointChanged(ITracePoint2D, int)Will be used by
andsetLocation(double, double).Point2D.setLocation(java.awt.geom.Point2D)- See Also:
- Constant Field Values
-
STATE_REMOVED
static final int STATE_REMOVED
The state flag used to inform thelistener viaITrace2Din case a point was removed.ITrace2D.firePointChanged(ITracePoint2D, int)- See Also:
- Constant Field Values
-
-
Method Detail
-
addAdditionalPointPainter
boolean addAdditionalPointPainter(IPointPainter<?> pointPainter)
Adds a point painter that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()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 useandITrace2D.addPointHighlighter(IPointPainter)Chart2D.enablePointHighlighting(boolean).- Parameters:
pointPainter- a point painter that will additionally (to the trace painter of the chart) paint this point.- Returns:
- true if this point painter was accepted (not contained before by
the means of
.Comparable.compareTo(Object)
-
removeAdditionalPointPainter
boolean removeAdditionalPointPainter(IPointPainter<?> pointPainter)
Removes a point painter that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()- Parameters:
pointPainter- a point painter that currently is used to additionally (to the trace painter of the chart) paint this point.- Returns:
- true if this point painter was removed (contained before by the
means of
.Comparable.compareTo(Object)
-
removeAllAdditionalPointPainters
java.util.Set<IPointPainter<?>> removeAllAdditionalPointPainters()
Removes all point painters that additionally (to the pointer painters of the trace ()) paint this point.ITrace2D.getTracePainters()- Returns:
- all instances that were used before this call.
-
clone
java.lang.Object clone()
Returns a cloned instance (deep copy).- Returns:
- a cloned instance (deep copy)
-
getAdditionalPointPainters
java.util.Set<IPointPainter<?>> getAdditionalPointPainters()
Returns the point painter that additionally (to the trace painter of the chart) paint this point.The original list is returned so painters may be added or removed (even all painters may be cleared).
- Returns:
- the point painters that additionally (to the trace painter of the chart) paint this point.
-
getEuclidDistance
double getEuclidDistance(double xNormalized, double yNormalized)Returns the Euclid distance of this point's normalized values () to the given normalized coordinates.getScaledX(),getScaledY()- Parameters:
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.- Returns:
- the Euclid distance of this point's normalized values (
) to the given normalized coordinates.getScaledX(),getScaledY()
-
getListener
ITrace2D getListener()
Returns the listener trace connected to this trace point.- Returns:
- the listener trace connected to this trace point.
-
getManhattanDistance
double getManhattanDistance(double xNormalized, double yNormalized)Returns the Manhattan distance of this point's normalized values () to the given normalized coordinates.getScaledX(),getScaledY()- Parameters:
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.- Returns:
- the Manhattan distance of this point's normalized values (
) to the given normalized coordinates.getScaledX(),getScaledY()
-
getManhattanDistance
double getManhattanDistance(ITracePoint2D point)
Returns the Manhattan distance of this point to the given one.- Parameters:
point- the point to measure the Manhattan distance to.- Returns:
- the Manhattan distance of this point to the given one.
-
getScaledX
double getScaledX()
- Returns:
- the scaledX.
-
getScaledY
double getScaledY()
- Returns:
- the scaledY.
-
getX
double getX()
Returns the x value.- Returns:
- the x value.
- See Also:
Point2D.getX()
-
getY
double getY()
Returns the y value.- Returns:
- the y value.
- See Also:
Point2D.getY()
-
setListener
void setListener(ITrace2D listener)
AllowsITrace2Dinstances to register (or de-register) themselves with this point to receive (or stop receiving) change information viaITrace2D.firePointChanged(ITracePoint2D, int)events.- Parameters:
listener- The instance that will be informed about changes or null to deregister.
-
setLocation
void setLocation(double xValue, double yValue)This method overloads the method ofjava.awt.geom.Point2D.Doubleto fire a property change event to listeners of the correspondinginstances via their methodITrace2D(with int argument set toITrace2D.firePointChanged(ITracePoint2D, int)).STATE_CHANGED- Parameters:
xValue- the new x-coordinate for this point.yValue- the new y-coordinate for this point.
-
setScaledX
void setScaledX(double scaledX)
Only intended for Chart2D!!!.- Parameters:
scaledX- the scaledX to set
-
setScaledY
void setScaledY(double scaledY)
Only intended for Chart2D!!!.- Parameters:
scaledY- the scaledY to set
-
-