Interface IErrorBarPainter
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ErrorBarPainter
,ErrorBarPainterLine
It contains a similar method to
IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
with an additional IErrorBarPixel
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
by ITracePainter
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 ClassesModifier and TypeInterfaceDescriptionstatic interface
Facace interface for accessing a connection segment of
.ErrorBarPainter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The property key defining theconnection
property.static final String
The property key defining theconnectionColor
property.static final String
The property key defining theendPointPainter
property.static final String
The property key defining theendPointColor
property.static final String
The property key defining thestartPointPaint
property.static final String
The property key defining thestartPointColor
property. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.Returns the color of the connection segment or null if unconfigured.Returns the painter for the connection segment of the error bar.Returns the color of the end point or null if unconfigured.Returns the painter for the end point of the error bar.getPropertyChangeListeners
(String property) Returns all property change listeners for the given property.Returns the facade instance for accessing the connection segment of this configurable error bar painter.Returns the facade instance for accessing the end segment of this configurable error bar painter.Returns the facade instance for accessing the start segment of this configurable error bar painter.Returns the color of the start point or null if unconfigured.Returns the painter for the start point of the error bar.void
paintErrorBar
(int absoluteX, int absoluteY, ITracePoint2D original, Graphics g, IErrorBarPixel errorBar) Paint the error bar for the point given by absolute coordinates on the given graphic context.void
Unregisters a property change listener that has been registered 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
(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
(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
(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 Details
-
PROPERTY_CONNECTION
The property key defining theconnection
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
PROPERTY_CONNECTION_COLOR
The property key defining theconnectionColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
PROPERTY_ENDPOINT
The property key defining theendPointPainter
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
PROPERTY_ENDPOINT_COLOR
The property key defining theendPointColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
PROPERTY_STARTPOINT
The property key defining thestartPointPaint
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
PROPERTY_STARTPOINT_COLOR
The property key defining thestartPointColor
property. Use in combination withaddPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
-
-
Method Details
-
addPropertyChangeListener
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
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
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
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
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, 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.original
- the original trace point this error bar is painted for.g
- the graphic context to paint on.errorBar
- contains the data for the errors to render.- See Also:
-
removePropertyChangeListener
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
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
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
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
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
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
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
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.
-