Class TracePoint2D

java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
info.monitorenter.gui.chart.TracePoint2D
All Implemented Interfaces:
ITracePoint2D, Serializable, Cloneable, Comparable<ITracePoint2D>

public class TracePoint2D extends Point2D.Double implements ITracePoint2D
A specialized version of java.awt.Point2D.Double who carries two further values: double scaledX and double scaledY which allow the Chart2D to cache the scaled values (between 0.0 and 1.0) without having to keep a copy of the aggregators (ITrace2D) complete tracepoints.

This avoids the necessity to care for the correct order of a set of scaled tracepoints copied for caching purposes. Especially in the case of new TracePoint2D instances added to a ITrace2D instance managed by a Chart2D there remains no responsibility for sorting the cached copy. This allows that the managing Chart2D may just rescale the newly added tracepoint instead of searching for the correct order of the new tracepoint by value - comparisons of x and y: The TracePoint2D passed to the method traceChanged(Chart2DDataChangeEvent e) coded in the argument is the original.

Why caching of scaled values for the coordinates?
This takes more RAM but else for every repaint() invocation of the Chart2D would force all tracepoints of all traces to be rescaled again.

A TracePoint2D will inform it's listener of type ITrace on changes of the internal values.

Version:
$Revision: 1.34 $
Author:
Achim Westermann Achim.Westermann@gmx.de
See Also: