Interface IErrorBarPainter
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
ErrorBarPainter
,ErrorBarPainterLine
public interface IErrorBarPainter extends java.io.Serializable
Interface for a renderer of error bars.It contains a similar method to
IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
with an additionalIErrorBarPixel
for getting information about the error to render.A visible error bar consists of three parts:
- The start point
- The end point
- The segment connecting the start point and the end point
IPointPainter
instances (which are used byITracePainter
implementations too.If one of these three parts (see the setters) is null, the corresponding part should not be painted.
A further configuration is to define the colors of these parts by the according setters.
- Version:
- $Revision: 1.27 $
- Author:
- Achim Westermann
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IErrorBarPainter.ISegment
Facace interface for accessing a connection segment of
.ErrorBarPainter
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CONNECTION
The property key defining theconnection
property.static java.lang.String
PROPERTY_CONNECTION_COLOR
The property key defining theconnectionColor
property.static java.lang.String
PROPERTY_ENDPOINT
The property key defining theendPointPainter
property.static java.lang.String
PROPERTY_ENDPOINT_COLOR
The property key defining theendPointColor
property.static java.lang.String
PROPERTY_STARTPOINT
The property key defining thestartPointPaint
property.static java.lang.String
PROPERTY_STARTPOINT_COLOR
The property key defining thestartPointColor
property.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.java.awt.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.java.awt.Color
getEndPointColor()
Returns the color of the end point or null if unconfigured.IPointPainterConfigurableUI<?>
getEndPointPainter()
Returns the painter for the end point of the error bar.java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.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.java.awt.Color
getStartPointColor()
Returns the color of the start point or null if unconfigured.IPointPainterConfigurableUI<?>
getStartPointPainter()
Returns the painter for the start point of the error bar.void
paintErrorBar(int absoluteX, int absoluteY, ITracePoint2D original, java.awt.Graphics g, IErrorBarPixel errorBar)
Paint the error bar for the point given by absolute coordinates on the given graphic context.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters a property change listener that has been registered for listening on all properties.void
removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
Removes a property change listener for listening on the given property.void
setConnectionColor(java.awt.Color connectionColor)
Sets the color for the connection segment.void
setConnectionPainter(IPointPainterConfigurableUI<?> 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 toIPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
.void
setEndPointColor(java.awt.Color endPointColor)
Sets the color for the end point.void
setEndPointPainter(IPointPainterConfigurableUI<?> endPointPainter)
Sets the painter for the end point of the error bar.void
setStartPointColor(java.awt.Color startPointColor)
Sets the color for the start point.void
setStartPointPainter(IPointPainterConfigurableUI<?> 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 toIPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
.
-
-
-
Field Detail
-
PROPERTY_CONNECTION
static final java.lang.String PROPERTY_CONNECTION
The property key defining theconnection
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_CONNECTION_COLOR
static final java.lang.String PROPERTY_CONNECTION_COLOR
The property key defining theconnectionColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_ENDPOINT
static final java.lang.String PROPERTY_ENDPOINT
The property key defining theendPointPainter
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_ENDPOINT_COLOR
static final java.lang.String PROPERTY_ENDPOINT_COLOR
The property key defining theendPointColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_STARTPOINT
static final java.lang.String PROPERTY_STARTPOINT
The property key defining thestartPointPaint
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_STARTPOINT_COLOR
static final java.lang.String PROPERTY_STARTPOINT_COLOR
The property key defining thestartPointColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
addPropertyChangeListener
void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.PropertyChangeEvents
PropertyChangeListener
instances may be added viaContainer.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
. They inherit the properties to listen fromContainer.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
. Additionally morePropertyChangeEvents
should be triggered (contract for implementation!).Property Change events
The followingPropertyChangeEvent
instances will be fired to registeredPropertyChangeListener
instances.getPropertyName()
getSource()
getOldValue()
getNewValue()
comment PROPERTY_ENDPOINT
that changed.IErrorBarPainter
.IPointPainter
.IPointPainter
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. PROPERTY_STARTPOINT
that changed.IErrorBarPainter
.IPointPainter
.IPointPainter
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. PROPERTY_CONNECTION
that changed.IErrorBarPainter
.IPointPainter
.IPointPainter
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. PROPERTY_ENDPOINT_COLOR
that changed.IErrorBarPainter
.Color
.Color
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. PROPERTY_STARTPOINT_COLOR
that changed.IErrorBarPainter
.Color
.Color
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. PROPERTY_CONNECTION_COLOR
that changed.IErrorBarPainter
.Color
.Color
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. - Parameters:
propertyName
- the name of the property the listener is interested inlistener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes
-
getConnectionColor
java.awt.Color getConnectionColor()
Returns the color of the connection segment or null if unconfigured.- Returns:
- the color of the connection segment or null if unconfigured.
-
getConnectionPainter
IPointPainter<?> getConnectionPainter()
Returns the painter for the connection segment of the error bar.- Returns:
- The painter for the connection segment of the error bar.
-
getEndPointColor
java.awt.Color getEndPointColor()
Returns the color of the end point or null if unconfigured.- Returns:
- the color of the end point or null if unconfigured.
-
getEndPointPainter
IPointPainterConfigurableUI<?> getEndPointPainter()
Returns the painter for the end point of the error bar.- Returns:
- The painter for the end point of the error bar.
-
getPropertyChangeListeners
java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String property)
Returns all property change listeners for the given property.- Parameters:
property
- one of the constants with thePROPERTY_
prefix defined in this class or subclasses.- Returns:
- the property change listeners for the given property.
-
getSegmentConnection
IErrorBarPainter.ISegment getSegmentConnection()
Returns the facade instance for accessing the connection segment of this configurable error bar painter.- Returns:
- the facade instance for accessing the connection segment of this configurable error bar painter.
-
getSegmentEnd
IErrorBarPainter.ISegment getSegmentEnd()
Returns the facade instance for accessing the end segment of this configurable error bar painter.- Returns:
- the facade instance for accessing the end segment of this configurable error bar painter.
-
getSegmentStart
IErrorBarPainter.ISegment getSegmentStart()
Returns the facade instance for accessing the start segment of this configurable error bar painter.- Returns:
- the facade instance for accessing the start segment of this configurable error bar painter.
-
getStartPointColor
java.awt.Color getStartPointColor()
Returns the color of the start point or null if unconfigured.- Returns:
- the color of the start point or null if unconfigured.
-
getStartPointPainter
IPointPainterConfigurableUI<?> getStartPointPainter()
Returns the painter for the start point of the error bar.- Returns:
- the painter for the start point of the error bar.
-
paintErrorBar
void paintErrorBar(int absoluteX, int absoluteY, ITracePoint2D original, java.awt.Graphics g, IErrorBarPixel errorBar)
Paint the error bar for the point given by absolute coordinates on the given graphic context.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
.- Parameters:
absoluteX
- the ready to use x value for the point to paint.absoluteY
- the ready to use y value for the point to paint.errorBar
- contains the data for the errors to render.original
- the original trace point this error bar is painted for.g
- the graphic context to paint on.- See Also:
IErrorBarPixel
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters a property change listener that has been registered for listening on all properties.- Parameters:
listener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes
-
removePropertyChangeListener
void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
Removes a property change listener for listening on the given property.- Parameters:
property
- one of the constants with tehPROPERTY_
prefix defined in this class or subclasses.listener
- the listener for this property change.
-
setConnectionColor
void setConnectionColor(java.awt.Color connectionColor)
Sets the color for the connection segment.If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying connection painter exists nothing will be done.
- Parameters:
connectionColor
- The connection segment color to set.
-
setConnectionPainter
void setConnectionPainter(IPointPainterConfigurableUI<?> 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 toIPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
.Choosing a
PointPainterLine
will have the same visual effect as setting such an instance for the start point painter.Currently the only useful 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!).- Parameters:
connectionPainter
- The connection segmentPainter to set.
-
setEndPointColor
void setEndPointColor(java.awt.Color endPointColor)
Sets the color for the end point.If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying end point painter exists nothing will be done.
- Parameters:
endPointColor
- The end point color to set.
-
setEndPointPainter
void setEndPointPainter(IPointPainterConfigurableUI<?> endPointPainter)
Sets the painter for the end point of the error bar.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, Graphics, ITracePoint2D)
.Choosing a
PointPainterLine
will have the same visual effect as setting such an instance for the connection segment painter.- Parameters:
endPointPainter
- The end point painter to set.
-
setStartPointColor
void setStartPointColor(java.awt.Color startPointColor)
Sets the color for the start point.If this is not used or null is provided, the color of the corresponding trace will be used. If no underlying start point painter exists nothing will be done.
- Parameters:
startPointColor
- The start point color to set.
-
setStartPointPainter
void setStartPointPainter(IPointPainterConfigurableUI<?> 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 toIPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
.Choosing a
PointPainterLine
will have the same visual effect as setting such an instance for the connection segment painter.- Parameters:
startPointPainter
- The startPointPainter to set.
-
-