|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcckit.plot.Plot
A plot is determined by a CoordinateSystem
, Curves
,
and an optional Legend
.
Registrated PlotListeners
will be informed
when the plot changes.
A DataPlot
can be connected with a Plot instance.
This is done with the method connect()
which registrates
this Plot instance as
a DataListener
at the connected DataPlot.
After an received DataEvents
has been handled
the registrated PlotListeners will receive a
PlotEvent
of the type PlotEventType.DATA_PLOT_CHANGED
.
Field Summary | |
static java.lang.String |
COORDINATE_SYSTEM_KEY
Configuration parameter key. |
static java.lang.String |
CURVE_FACTORY_KEY
Configuration parameter key. |
static java.lang.String |
INITIAL_HINT_FOR_NEXT_CURVE_KEY
Configuration parameter key. |
static java.lang.String |
LEGEND_KEY
Configuration parameter key. |
static java.lang.String |
LEGEND_VISIBLE_KEY
Configuration parameter key. |
Constructor Summary | |
Plot(ConfigParameters config)
Creates an instance from the specfied configuration parameters. |
Method Summary | |
void |
addPlotListener(PlotListener listener)
Adds the specfied PlotListener . |
void |
connect(DataPlot dataPlot)
Connect the specified DataPlot with this instance.
|
void |
dataChanged(DataEvent event)
Handles the received DataEvent and notifies
PlotListeners by an event of the type
PlotEventType.DATA_CURVE_CHANGED or
PlotEventType.DATA_PLOT_CHANGED . |
GraphicalComposite |
getCompletePlot()
Creates a graphical representation of the complete plot. |
GraphicalElement |
getCoordinateSystem()
Returns the view of the coordinate system. |
GraphicalElement[] |
getCurves()
Returns the graphical representations of all curves. |
GraphicalElement |
getLegend()
Returns the graphical representations of the legend. |
boolean |
isLegendVisible()
Returns true if the legend is visible. |
protected void |
notifyListeners(PlotEvent event)
Sends all registrated PlotListeners
the specified event. |
void |
removePlotListener(PlotListener listener)
Removes the specfied PlotListener . |
DataPoint |
transform(GraphPoint point)
Transforms a point from device-independent coordinates into data coordinates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String COORDINATE_SYSTEM_KEY
public static final java.lang.String CURVE_FACTORY_KEY
public static final java.lang.String LEGEND_VISIBLE_KEY
public static final java.lang.String LEGEND_KEY
public static final java.lang.String INITIAL_HINT_FOR_NEXT_CURVE_KEY
Constructor Detail |
public Plot(ConfigParameters config)
Key & Default Value | Type | Mandatory | Description |
---|---|---|---|
coordinateSystem = CartesianCoordinateSystem |
ConfigParameters | no | Definition of the CoordinateSystem . |
curveFactory = SimpleCurveFactory |
ConfigParameters | no | Definition of the CurveFactory . |
initialHintForNextCurve = null | ConfigParameters | no | Definition of the initial Hint which is needed by some
SymbolFactories like BarFactory .
|
legend = default values of Legend |
ConfigParameters | no | Configuration parameters of a Legend . |
legendVisible = true | boolean | no | If true the Legend will be created. |
Method Detail |
public void addPlotListener(PlotListener listener)
PlotListener
. Does nothing if
already added.public void removePlotListener(PlotListener listener)
PlotListener
. Does nothing if
already removed.protected void notifyListeners(PlotEvent event)
PlotListeners
the specified event.public void connect(DataPlot dataPlot)
DataPlot
with this instance.
If this Plot instance is already connected with a
DataPlot the connection will be released and a
PlotEvent
of the type PlotEventType.DATA_PLOT_DISCONNECTED
will be sent to all registrated PlotListeners
.
It registers itself at dataPlot and
all its DataCurves
.
Finally all curves will be generated and a PlotEvent
of the type PlotEventType.DATA_PLOT_CONNECTED
will be transmitted.
public DataPoint transform(GraphPoint point)
point
- Point in device-independent coordinates.public GraphicalComposite getCompletePlot()
public GraphicalElement getCoordinateSystem()
public GraphicalElement[] getCurves()
public boolean isLegendVisible()
public GraphicalElement getLegend()
public void dataChanged(DataEvent event)
DataEvent
and notifies
PlotListeners
by an event of the type
PlotEventType.DATA_CURVE_CHANGED
or
PlotEventType.DATA_PLOT_CHANGED
. The following table shows what
this method does:
Source of event | All hints for the next curve are null? | Action | Type of sent PlotEvent | |
---|---|---|---|---|
DataCurve | Yes | Recreate changed curve. | DATA_CURVE_CHANGED | |
DataCurve | No | Recreate changed curve and all curves with large curve index. | DATA_PLOT_CHANGED | |
DataPlot | - | Recreate all curves
and Legend view. | DATA_PLOT_CHANGED |
dataChanged
in interface DataListener
jcckit.data.DataListener
event
- Data event informing where and what happened.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |