|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| 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.ISegmentgetXXXSegment() 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 | |
|---|---|
static java.awt.Color |
DEFAULT_SEGMENT_COLOR
Default color for all segments in case their has not been configured with a color. |
protected java.beans.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(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 given propertyName. |
boolean |
equals(java.lang.Object obj)
|
java.awt.Color |
getConnectionColor()
Returns the color of the connection segment or null if unconfigured. |
IPointPainterConfigurableUI<?> |
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. |
int |
hashCode()
|
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 to IPointPainter.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 to IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D)
. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.beans.PropertyChangeSupport m_propertyChangeSupport
PropertyChangeEvents and maintaining PropertyChangeListeners.
public static final java.awt.Color DEFAULT_SEGMENT_COLOR
IPointPainterConfigurableUI has not been configured with a color.
| Constructor Detail |
|---|
public ErrorBarPainter()
It then has to be configured with the remaining methods as desired.
setEndPointColor(Color),
setEndPointPainter(IPointPainterConfigurableUI),
setConnectionColor(Color),
setConnectionPainter(IPointPainterConfigurableUI),
setStartPointColor(Color),
setStartPointPainter(IPointPainterConfigurableUI)| Method Detail |
|---|
public final void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
IErrorBarPainterpropertyName.
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 IErrorBarPainterpropertyName - 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 boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public final java.awt.Color getConnectionColor()
IErrorBarPainter
getConnectionColor in interface IErrorBarPainterIErrorBarPainter.getConnectionColor()public final IPointPainterConfigurableUI<?> getConnectionPainter()
IErrorBarPainter
getConnectionPainter in interface IErrorBarPainterIErrorBarPainter.getConnectionPainter()public final java.awt.Color getEndPointColor()
IErrorBarPainter
getEndPointColor in interface IErrorBarPainterIErrorBarPainter.getEndPointColor()public final IPointPainterConfigurableUI<?> getEndPointPainter()
IErrorBarPainter
getEndPointPainter in interface IErrorBarPainterIErrorBarPainter.getEndPointPainter()public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String property)
IErrorBarPainter
getPropertyChangeListeners in interface IErrorBarPainterproperty - one of the constants with the PROPERTY_ prefix
defined in this class or subclasses.
IErrorBarPainter.getPropertyChangeListeners(java.lang.String)public IErrorBarPainter.ISegment getSegmentConnection()
IErrorBarPainter
getSegmentConnection in interface IErrorBarPainterIErrorBarPainter.getSegmentConnection()public IErrorBarPainter.ISegment getSegmentEnd()
IErrorBarPainter
getSegmentEnd in interface IErrorBarPainterIErrorBarPainter.getSegmentEnd()public IErrorBarPainter.ISegment getSegmentStart()
IErrorBarPainter
getSegmentStart in interface IErrorBarPainterIErrorBarPainter.getSegmentStart()public final java.awt.Color getStartPointColor()
IErrorBarPainter
getStartPointColor in interface IErrorBarPainterIErrorBarPainter.getStartPointColor()public final IPointPainterConfigurableUI<?> getStartPointPainter()
IErrorBarPainter
getStartPointPainter in interface IErrorBarPainterIErrorBarPainter.getStartPointPainter()public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()
public void paintErrorBar(int absoluteX,
int absoluteY,
ITracePoint2D original,
java.awt.Graphics 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 IErrorBarPainterabsoluteX - 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.IErrorBarPainter.paintErrorBar(int, int, ITracePoint2D, Graphics, IErrorBarPixel)public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
IErrorBarPainter
removePropertyChangeListener in interface IErrorBarPainterlistener - a listener that will only be informed if the property identified
by the argument propertyName changesIErrorBarPainter.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
IErrorBarPainter
removePropertyChangeListener in interface IErrorBarPainterproperty - 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(java.awt.Color connectionColor)
IErrorBarPainterIf 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.
setConnectionColor in interface IErrorBarPainterconnectionColor - The connection segment color to set.IErrorBarPainter.setConnectionColor(java.awt.Color)public final void setConnectionPainter(IPointPainterConfigurableUI<?> connectionPainter)
IErrorBarPainterIPointPainter.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!).
setConnectionPainter in interface IErrorBarPainterconnectionPainter - The connection segmentPainter to set.IErrorBarPainter.setConnectionPainter(info.monitorenter.gui.chart.IPointPainterConfigurableUI)public final void setEndPointColor(java.awt.Color endPointColor)
IErrorBarPainterIf 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.
setEndPointColor in interface IErrorBarPainterendPointColor - The end point color to set.IErrorBarPainter.setEndPointColor(java.awt.Color)public final void setEndPointPainter(IPointPainterConfigurableUI<?> 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, Graphics, ITracePoint2D).
Choosing a
PointPainterLine will
have the same visual effect as setting such an instance for the connection
segment painter.
setEndPointPainter in interface IErrorBarPainterendPointPainter - The end point painter to set.IErrorBarPainter.setEndPointPainter(info.monitorenter.gui.chart.IPointPainterConfigurableUI)public final void setStartPointColor(java.awt.Color startPointColor)
IErrorBarPainterIf 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.
setStartPointColor in interface IErrorBarPainterstartPointColor - The start point color to set.IErrorBarPainter.setStartPointColor(java.awt.Color)public final void setStartPointPainter(IPointPainterConfigurableUI<?> startPointPainter)
IErrorBarPainterIPointPainter.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.
setStartPointPainter in interface IErrorBarPainterstartPointPainter - The startPointPainter to set.IErrorBarPainter.setStartPointPainter(IPointPainterConfigurableUI)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||