Class ErrorBarPainter
- All Implemented Interfaces:
IErrorBarPainter
,Serializable
- Direct Known Subclasses:
ErrorBarPainterLine
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)
- Version:
- $Revision: 1.27 $
- Author:
- Achim Westermann
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface info.monitorenter.gui.chart.IErrorBarPainter
IErrorBarPainter.ISegment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Color
Default color for all segments in case their
has not been configured with a color.IPointPainterConfigurableUI
protected PropertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
.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
ConstructorsConstructorDescriptionCreates an instance that by default will not render any error bar. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.boolean
final Color
Returns the color of the connection segment or null if unconfigured.final IPointPainterConfigurableUI
<?> Returns the painter for the connection segment of the error bar.final Color
Returns the color of the end point or null if unconfigured.final IPointPainterConfigurableUI
<?> 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.final Color
Returns the color of the start point or null if unconfigured.final IPointPainterConfigurableUI
<?> Returns the painter for the start point of the error bar.int
hashCode()
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.final void
setConnectionColor
(Color connectionColor) Sets the color for the connection segment.final 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)
.final void
setEndPointColor
(Color endPointColor) Sets the color for the end point.final void
setEndPointPainter
(IPointPainterConfigurableUI<?> endPointPainter) Sets the painter for the end point of the error bar.final void
setStartPointColor
(Color startPointColor) Sets the color for the start point.final 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
-
m_propertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
. -
DEFAULT_SEGMENT_COLOR
Default color for all segments in case their
has not been configured with a color.IPointPainterConfigurableUI
-
-
Constructor Details
-
ErrorBarPainter
public ErrorBarPainter()Creates an instance that by default will not render any error bar.It then has to be configured with the remaining methods as desired.
- See Also:
-
-
Method Details
-
addPropertyChangeListener
Description copied from interface:IErrorBarPainter
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 IErrorBarPainter.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. IErrorBarPainter.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. IErrorBarPainter.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. IErrorBarPainter.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. IErrorBarPainter.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. IErrorBarPainter.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. - Specified by:
addPropertyChangeListener
in interfaceIErrorBarPainter
- 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- See Also:
-
equals
-
getConnectionColor
Description copied from interface:IErrorBarPainter
Returns the color of the connection segment or null if unconfigured.- Specified by:
getConnectionColor
in interfaceIErrorBarPainter
- Returns:
- the color of the connection segment or null if unconfigured.
- See Also:
-
getConnectionPainter
Description copied from interface:IErrorBarPainter
Returns the painter for the connection segment of the error bar.- Specified by:
getConnectionPainter
in interfaceIErrorBarPainter
- Returns:
- The painter for the connection segment of the error bar.
- See Also:
-
getEndPointColor
Description copied from interface:IErrorBarPainter
Returns the color of the end point or null if unconfigured.- Specified by:
getEndPointColor
in interfaceIErrorBarPainter
- Returns:
- the color of the end point or null if unconfigured.
- See Also:
-
getEndPointPainter
Description copied from interface:IErrorBarPainter
Returns the painter for the end point of the error bar.- Specified by:
getEndPointPainter
in interfaceIErrorBarPainter
- Returns:
- The painter for the end point of the error bar.
- See Also:
-
getPropertyChangeListeners
Description copied from interface:IErrorBarPainter
Returns all property change listeners for the given property.- Specified by:
getPropertyChangeListeners
in interfaceIErrorBarPainter
- Parameters:
property
- one of the constants with thePROPERTY_
prefix defined in this class or subclasses.- Returns:
- the property change listeners for the given property.
- See Also:
-
getSegmentConnection
Description copied from interface:IErrorBarPainter
Returns the facade instance for accessing the connection segment of this configurable error bar painter.- Specified by:
getSegmentConnection
in interfaceIErrorBarPainter
- Returns:
- the facade instance for accessing the connection segment of this configurable error bar painter.
- See Also:
-
getSegmentEnd
Description copied from interface:IErrorBarPainter
Returns the facade instance for accessing the end segment of this configurable error bar painter.- Specified by:
getSegmentEnd
in interfaceIErrorBarPainter
- Returns:
- the facade instance for accessing the end segment of this configurable error bar painter.
- See Also:
-
getSegmentStart
Description copied from interface:IErrorBarPainter
Returns the facade instance for accessing the start segment of this configurable error bar painter.- Specified by:
getSegmentStart
in interfaceIErrorBarPainter
- Returns:
- the facade instance for accessing the start segment of this configurable error bar painter.
- See Also:
-
getStartPointColor
Description copied from interface:IErrorBarPainter
Returns the color of the start point or null if unconfigured.- Specified by:
getStartPointColor
in interfaceIErrorBarPainter
- Returns:
- the color of the start point or null if unconfigured.
- See Also:
-
getStartPointPainter
Description copied from interface:IErrorBarPainter
Returns the painter for the start point of the error bar.- Specified by:
getStartPointPainter
in interfaceIErrorBarPainter
- Returns:
- the painter for the start point of the error bar.
- See Also:
-
hashCode
public int hashCode() -
paintErrorBar
public void paintErrorBar(int absoluteX, int absoluteY, ITracePoint2D original, Graphics g, IErrorBarPixel errorBar) Description copied from interface:IErrorBarPainter
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
.- Specified by:
paintErrorBar
in interfaceIErrorBarPainter
- 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
Description copied from interface:IErrorBarPainter
Unregisters a property change listener that has been registered for listening on all properties.- Specified by:
removePropertyChangeListener
in interfaceIErrorBarPainter
- Parameters:
listener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes- See Also:
-
removePropertyChangeListener
Description copied from interface:IErrorBarPainter
Removes a property change listener for listening on the given property.- Specified by:
removePropertyChangeListener
in interfaceIErrorBarPainter
- Parameters:
property
- one of the constants with tehPROPERTY_
prefix defined in this class or subclasses.listener
- the listener for this property change.- See Also:
-
setConnectionColor
Description copied from interface:IErrorBarPainter
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.
- Specified by:
setConnectionColor
in interfaceIErrorBarPainter
- Parameters:
connectionColor
- The connection segment color to set.- See Also:
-
setConnectionPainter
Description copied from interface:IErrorBarPainter
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!).- Specified by:
setConnectionPainter
in interfaceIErrorBarPainter
- Parameters:
connectionPainter
- The connection segmentPainter to set.- See Also:
-
setEndPointColor
Description copied from interface:IErrorBarPainter
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.
- Specified by:
setEndPointColor
in interfaceIErrorBarPainter
- Parameters:
endPointColor
- The end point color to set.- See Also:
-
setEndPointPainter
Description copied from interface:IErrorBarPainter
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.- Specified by:
setEndPointPainter
in interfaceIErrorBarPainter
- Parameters:
endPointPainter
- The end point painter to set.- See Also:
-
setStartPointColor
Description copied from interface:IErrorBarPainter
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.
- Specified by:
setStartPointColor
in interfaceIErrorBarPainter
- Parameters:
startPointColor
- The start point color to set.- See Also:
-
setStartPointPainter
Description copied from interface: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 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.- Specified by:
setStartPointPainter
in interfaceIErrorBarPainter
- Parameters:
startPointPainter
- The startPointPainter to set.- See Also:
-