|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.monitorenter.gui.chart.errorbars.ErrorBarPainter
public class ErrorBarPainter
Implementation of an error bar painter that allows configuration of the way
the connection, start point and end point of an error bar is painted by the
use of IPointPainter
.
Property change events are fired as described in method
.
Note that adding property change listeners to the nested access facades of
type
IErrorBarPainter.addPropertyChangeListener(String, PropertyChangeListener)
accessible via IErrorBarPainter.ISegment
getXXXSegment()
methods will fire the
corresponding events for listeners of this instance (as they delegate the
calls) while they fire events for properties defined in
too. If you register for events of this instance and for the retrieved
segments you will receive two
IErrorBarPainter.ISegment
for the same value changed.
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface info.monitorenter.gui.chart.IErrorBarPainter |
---|
IErrorBarPainter.ISegment |
Field Summary | |
---|---|
protected PropertyChangeSupport |
m_propertyChangeSupport
The instance that add support for firing PropertyChangeEvents
and maintaining PropertyChangeListeners . |
Fields inherited from interface info.monitorenter.gui.chart.IErrorBarPainter |
---|
PROPERTY_CONNECTION, PROPERTY_CONNECTION_COLOR, PROPERTY_ENDPOINT, PROPERTY_ENDPOINT_COLOR, PROPERTY_STARTPOINT, PROPERTY_STARTPOINT_COLOR |
Constructor Summary | |
---|---|
ErrorBarPainter()
Creates an instance that by default will not render any error bar. |
Method Summary | |
---|---|
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 . |
Color |
getConnectionColor()
Returns the color of the connection segment or null if unconfigured. |
IPointPainter |
getConnectionPainter()
Returns the painter for the connection segment of the error bar. |
Color |
getEndPointColor()
Returns the color of the end point or null if unconfigured. |
IPointPainter |
getEndPointPainter()
Returns the painter for the end point of the error bar. |
PropertyChangeListener[] |
getPropertyChangeListeners(String property)
Returns all property change listeners for the given property. |
IErrorBarPainter.ISegment |
getSegmentConnection()
Returns the facade instance for accessing the connection segment of this configurable error bar painter. |
IErrorBarPainter.ISegment |
getSegmentEnd()
Returns the facade instance for accessing the end segment of this configurable error bar painter. |
IErrorBarPainter.ISegment |
getSegmentStart()
Returns the facade instance for accessing the start segment of this configurable error bar painter. |
Color |
getStartPointColor()
Returns the color of the start point or null if unconfigured. |
IPointPainter |
getStartPointPainter()
Returns the painter for the start point of the error bar. |
void |
paintErrorBar(int absoluteX,
int absoluteY,
Graphics2D g,
IErrorBarPixel errorBar)
Paint the error bar for the point given by absolute coordinates on the given graphic context. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deregisters a property change listener that has been registerd for listening on all properties. |
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener)
Removes a property change listener for listening on the given property. |
void |
setConnectionColor(Color connectionColor)
Sets the color for the connection segment. |
void |
setConnectionPainter(IPointPainter connectionPainter)
Note that the choice for the right point painter has to be taken with care: It is senseless to use an implementation that does not interconnect both coordinates given to IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D) . |
void |
setEndPointColor(Color endPointColor)
Sets the color for the end point. |
void |
setEndPointPainter(IPointPainter endPointPainter)
Sets the painter for the end point of the error bar. |
void |
setStartPointColor(Color startPointColor)
Sets the color for the start point. |
void |
setStartPointPainter(IPointPainter startPointPainter)
Note that the choice for the right point painter has to be taken with care: It is senseless to use an implementation that interconnects both coordinates given to IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PropertyChangeSupport m_propertyChangeSupport
PropertyChangeEvents
and maintaining PropertyChangeListeners
.
Constructor Detail |
---|
public ErrorBarPainter()
It then has to be configured with the remaining methods as desired.
setEndPointColor(Color)
,
setEndPointPainter(IPointPainter)
,
setConnectionColor(Color)
,
setConnectionPainter(IPointPainter)
,
setStartPointColor(Color)
,
setStartPointPainter(IPointPainter)
Method Detail |
---|
public final void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
IErrorBarPainter
propertyName
.
PropertyChangeListener
instances may be added via
Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
.
They inherit the properties to listen from
Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
.
Additionally more PropertyChangeEvents
should be triggered
(contract for implementation!).
PropertyChangeEvent
instances will be
fired to registered PropertyChangeListener
instances.
getPropertyName() |
getSource() |
getOldValue() |
getNewValue() |
comment |
---|---|---|---|---|
|
that changed. |
. |
. |
Note that null as the old value indicates a new painter. Null as the new value is valid and means that the end point rendering is turned off. |
|
that changed. |
. |
. |
Note that null as the old value indicates a new painter. Null as the new value is valid and means that the start point rendering is turned off. |
|
that changed. |
. |
. |
Note that null as the old value indicates a new painter. Null as the new value is valid and means that the connection segment point rendering is turned off. |
|
that changed. |
. |
. |
Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the end point color is switched to default. |
|
that changed. |
. |
. |
Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the start point color is switched to default. |
|
that changed. |
. |
. |
Note that null as the old value indicates a new color different from the default. Null as the new value is valid and means that the connection segment color is switched to default. |
addPropertyChangeListener
in interface IErrorBarPainter
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
changesIErrorBarPainter.addPropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)
public final Color getEndPointColor()
IErrorBarPainter
getEndPointColor
in interface IErrorBarPainter
IErrorBarPainter.getEndPointColor()
public final IPointPainter getEndPointPainter()
IErrorBarPainter
getEndPointPainter
in interface IErrorBarPainter
IErrorBarPainter.getEndPointPainter()
public PropertyChangeListener[] getPropertyChangeListeners(String property)
IErrorBarPainter
getPropertyChangeListeners
in interface IErrorBarPainter
property
- one of the constants with the PROPERTY_
prefix
defined in this class or subclasses.
IErrorBarPainter.getPropertyChangeListeners(java.lang.String)
public final Color getConnectionColor()
IErrorBarPainter
getConnectionColor
in interface IErrorBarPainter
IErrorBarPainter.getConnectionColor()
public IErrorBarPainter.ISegment getSegmentConnection()
IErrorBarPainter
getSegmentConnection
in interface IErrorBarPainter
IErrorBarPainter.getSegmentConnection()
public IErrorBarPainter.ISegment getSegmentEnd()
IErrorBarPainter
getSegmentEnd
in interface IErrorBarPainter
IErrorBarPainter.getSegmentEnd()
public final IPointPainter getConnectionPainter()
IErrorBarPainter
getConnectionPainter
in interface IErrorBarPainter
IErrorBarPainter.getConnectionPainter()
public IErrorBarPainter.ISegment getSegmentStart()
IErrorBarPainter
getSegmentStart
in interface IErrorBarPainter
IErrorBarPainter.getSegmentStart()
public final Color getStartPointColor()
IErrorBarPainter
getStartPointColor
in interface IErrorBarPainter
IErrorBarPainter.getStartPointColor()
public final IPointPainter getStartPointPainter()
IErrorBarPainter
getStartPointPainter
in interface IErrorBarPainter
IErrorBarPainter.getStartPointPainter()
public void paintErrorBar(int absoluteX, int absoluteY, Graphics2D g, IErrorBarPixel errorBar)
IErrorBarPainter
Basic implementations should modularize further and allow configuration for
the way of painting the connection segments, the start point (origin) and
end point of the error bar with implementations of IPointPainter
.
paintErrorBar
in interface IErrorBarPainter
absoluteX
- the ready to use x value for the point to paint.absoluteY
- the ready to use y value for the point to paint.g
- the graphic context to paint on.errorBar
- contains the data for the errors to render.IErrorBarPainter.paintErrorBar(int, int,
java.awt.Graphics2D, info.monitorenter.gui.chart.IErrorBarPixel)
public void removePropertyChangeListener(PropertyChangeListener listener)
IErrorBarPainter
removePropertyChangeListener
in interface IErrorBarPainter
listener
- a listener that will only be informed if the property identified
by the argument propertyName
changesIErrorBarPainter.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
IErrorBarPainter
removePropertyChangeListener
in interface IErrorBarPainter
property
- one of the constants with teh PROPERTY_
prefix
defined in this class or subclasses.listener
- the listener for this property change.IErrorBarPainter.removePropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)
public final void setConnectionColor(Color connectionColor)
IErrorBarPainter
If this is not used or null is provided, the color of the corresponding trace will be used.
setConnectionColor
in interface IErrorBarPainter
connectionColor
- The connection segment color to set.IErrorBarPainter.setConnectionColor(java.awt.Color)
public final void setEndPointColor(Color endPointColor)
IErrorBarPainter
If this is not used or null is provided, the color of the corresponding trace will be used.
setEndPointColor
in interface IErrorBarPainter
endPointColor
- The end point color to set.IErrorBarPainter.setEndPointColor(java.awt.Color)
public final void setEndPointPainter(IPointPainter endPointPainter)
IErrorBarPainter
Note that the choice for the right point painter has to be taken with care:
It is senseless to use an implementation that interconnects both
coordinates given to
IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D)
.
Choosing a
PointPainterLine
will
have the same visual effect as setting such an instance for the connection
segment painter.
setEndPointPainter
in interface IErrorBarPainter
endPointPainter
- The end point painter to set.IErrorBarPainter.setEndPointPainter(info.monitorenter.gui.chart.IPointPainter)
public final void setConnectionPainter(IPointPainter connectionPainter)
IErrorBarPainter
IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D)
.
Choosing a
PointPainterLine
will
have the same visual effect as setting such an instance for the start point
painter.
Currently the only senseful choice is the
PointPainterLine
or null
(to make the connection segment invisible). But the interface is open
enough to use implementations that would paint interpolated dots, discs,
squares,... whatever you think of (contribute!).
setConnectionPainter
in interface IErrorBarPainter
connectionPainter
- The connection segmentPainter to set.IErrorBarPainter.setConnectionPainter(info.monitorenter.gui.chart.IPointPainter)
public final void setStartPointColor(Color startPointColor)
IErrorBarPainter
If this is not used or null is provided, the color of the corresponding trace will be used.
setStartPointColor
in interface IErrorBarPainter
startPointColor
- The start point color to set.IErrorBarPainter.setStartPointColor(java.awt.Color)
public final void setStartPointPainter(IPointPainter startPointPainter)
IErrorBarPainter
IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D)
.
Choosing a
PointPainterLine
will
have the same visual effect as setting such an instance for the connection
segment painter.
setStartPointPainter
in interface IErrorBarPainter
startPointPainter
- The startPointPainter to set.IErrorBarPainter.setStartPointPainter(info.monitorenter.gui.chart.IPointPainter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |