IErrorBarPolicy<AErrorBarPolicyConfigurable>, IPointPainter<AErrorBarPolicyConfigurable>, ITracePainter<AErrorBarPolicyConfigurable>, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Comparable<AErrorBarPolicyConfigurable>, java.util.EventListenerErrorBarPolicyAbsoluteSummation, ErrorBarPolicyRelativepublic abstract class AErrorBarPolicyConfigurable extends java.lang.Object implements IErrorBarPolicy<AErrorBarPolicyConfigurable>, java.beans.PropertyChangeListener
IErrorBarPolicy base
implementation that is configurable by the means of showing positive/negative
errors in x/y dimension.
Implementations have to implement the methods
.
internalGetNegativeXError(int, int, ITracePoint2D)
internalGetNegativeYError(int, int, ITracePoint2D)
internalGetPositiveXError(int, int, ITracePoint2D)
internalGetPositiveYError(int, int, ITracePoint2D)
Please see the class description of
IErrorBarPixel for details.
| Modifier and Type | Field | Description |
|---|---|---|
protected ITracePoint2D |
m_lastPoint |
The last trace point coordinate that was sent to
paintPoint(int, int, int, int, Graphics, ITracePoint2D). |
protected int |
m_lastX |
The last x coordinate that was sent to
paintPoint(int, int, int, int, Graphics, ITracePoint2D). |
protected int |
m_lastY |
The last y coordinate that was sent to
paintPoint(int, int, int, int, Graphics, ITracePoint2D). |
protected java.beans.PropertyChangeSupport |
m_propertyChangeSupport |
The instance that add support for firing
PropertyChangeEvents
and maintaining PropertyChangeListeners. |
PROPERTY_CONFIGURATION, PROPERTY_ERRORBARPAINTER| Constructor | Description |
|---|---|
AErrorBarPolicyConfigurable() |
Defcon.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addErrorBarPainter(IErrorBarPainter painter) |
Adds the given error bar painter to the list of painters of this instance.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
Adds a property change listener.
|
void |
calculateErrorBar(int xPixel,
int yPixel,
ErrorBarPixel errorBar,
ITracePoint2D original) |
Calculates the errors of the given errorbar according to the point to
render and the configuration of this instance.
|
int |
compareTo(AErrorBarPolicyConfigurable o) |
|
void |
discontinue(java.awt.Graphics g2d) |
Invoked to inform the painter that a discontinue in the trace to # paint has occured.
|
void |
endPaintIteration(java.awt.Graphics g2d) |
Invoked to inform implementations that a paint iteration ends for the
corresponding
ITrace2D. |
boolean |
equals(java.lang.Object obj) |
|
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldvalue,
java.lang.Object newvalue) |
Fires a property change event to the registered listeners.
|
javax.swing.JComponent |
getCustomConfigurator() |
Allows an implementation to return a
JComponent that takes
care of custom configuration properties for the UI support of error bar
policies. |
java.util.Set<IErrorBarPainter> |
getErrorBarPainters() |
Returns the set of
IErrorBarPainter to use. |
protected ITrace2D |
getTrace() |
Returns the trace error bars have to be rendered for.
|
int |
hashCode() |
|
protected abstract int |
internalGetNegativeXError(int xPixel,
int yPixel,
ITracePoint2D original) |
Internally compute the negative x error for the given point as a pixel
value (not relative to the the origin value).
|
protected abstract int |
internalGetNegativeYError(int xPixel,
int yPixel,
ITracePoint2D original) |
Internally compute the negative y error for the given point as a pixel
value (not relative to the the origin value).
|
protected abstract int |
internalGetPositiveXError(int xPixel,
int yPixel,
ITracePoint2D original) |
Internally compute the positive x error in pixel for the given point as an
absolute value (not relative to the the origin value).
|
protected abstract int |
internalGetPositiveYError(int xPixel,
int yPixel,
ITracePoint2D original) |
Internally compute the positive y error in pixel for the given point as an
absolute value (not relative to the the origin value).
|
boolean |
isShowNegativeXErrors() |
Returns true if negative errors in x dimension are shown.
|
boolean |
isShowNegativeYErrors() |
Returns true if negative errors in y dimension are shown.
|
boolean |
isShowPositiveXErrors() |
Returns true if positive errors in x dimension are shown.
|
boolean |
isShowPositiveYErrors() |
Returns true if positive errors in y dimension are shown.
|
void |
paintPoint(int absoluteX,
int absoluteY,
int nextX,
int nextY,
java.awt.Graphics g,
ITracePoint2D original) |
Paint the point given by absolute coordinates on the given graphic context.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
Just turns the property change event of subsequent configuration (like
to
and informs outer added with
. |
boolean |
removeErrorBarPainter(IErrorBarPainter painter) |
Removes the given error bar painter.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
Deregisters a property change listener that has been registerd 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 |
setErrorBarPainter(IErrorBarPainter painter) |
Makes the given error bar painter the sole painter for error bars of this
instance.
|
void |
setShowNegativeXErrors(boolean showNegativeXErrors) |
Set whether negative errors in x dimension should be shown.
|
void |
setShowNegativeYErrors(boolean showNegativeYErrors) |
Set whether negative errors in y dimension should be shown.
|
void |
setShowPositiveXErrors(boolean showPositiveXErrors) |
Set whether positive errors in x dimension should be shown.
|
void |
setShowPositiveYErrors(boolean showPositiveYErrors) |
Set whether positive errors in y dimension should be shown.
|
void |
setTrace(ITrace2D trace) |
Intended for
ATrace2D only that
will register itself to the instances added to it. |
void |
startPaintIteration(java.awt.Graphics g2d) |
Invoked to inform implementations that a paint iteration starts for the
corresponding
ITrace2D. |
getXError, getYErrorprotected ITracePoint2D m_lastPoint
paintPoint(int, int, int, int, Graphics, ITracePoint2D).
It will be needed at endPaintIteration(Graphics) as the former
method only uses the first set of coordinates to store in the internal list
to avoid duplicates.
protected int m_lastX
paintPoint(int, int, int, int, Graphics, ITracePoint2D).
It will be needed at endPaintIteration(Graphics) as the former
method only uses the first set of coordinates to store in the internal list
to avoid duplicates.
protected int m_lastY
paintPoint(int, int, int, int, Graphics, ITracePoint2D).
It will be needed at endPaintIteration(Graphics) as the former
method only uses the first set of coordinates to store in the internal list
to avoid duplicates.
protected java.beans.PropertyChangeSupport m_propertyChangeSupport
PropertyChangeEvents
and maintaining PropertyChangeListeners.
PropertyChangeListener instances.public void addErrorBarPainter(IErrorBarPainter painter)
IErrorBarPolicyaddErrorBarPainter in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>painter - the painter to use.IErrorBarPolicy.addErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)public final void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>propertyName - The name of the property to listen on.listener - The PropertyChangeListener to be added.ITrace2D.addPropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)public final void calculateErrorBar(int xPixel,
int yPixel,
ErrorBarPixel errorBar,
ITracePoint2D original)
IErrorBarPolicycalculateErrorBar in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>xPixel - the x value in pixel to render an error bar for.yPixel - the y value in pixel to render an error bar for.errorBar - an error bar to use: This is for design reasons as internally this
method is used too with a reused instance.original - the original point, possibly useful for calculations.IErrorBarPolicy.calculateErrorBar(int,
int, info.monitorenter.gui.chart.errorbars.ErrorBarPixel,
info.monitorenter.gui.chart.ITracePoint2D)public int compareTo(AErrorBarPolicyConfigurable o)
compareTo in interface java.lang.Comparable<AErrorBarPolicyConfigurable>Comparable.compareTo(java.lang.Object)public void discontinue(java.awt.Graphics g2d)
ITracePainter
This only has to be implemented by painters that collect several points of
IPointPainter.paintPoint(int, int, int, int, Graphics, ITracePoint2D) to draw them as polygons (e.g.:
Graphics.drawPolyline(int[], int[], int)).
discontinue in interface ITracePainter<AErrorBarPolicyConfigurable>g2d - provided in case pending paint operations have to be performed.ITracePainter.discontinue(java.awt.Graphics)public void endPaintIteration(java.awt.Graphics g2d)
IPointPainterITrace2D.
endPaintIteration in interface IPointPainter<AErrorBarPolicyConfigurable>g2d - provided in case pending paint operations have to be performed.IPointPainter.endPaintIteration(java.awt.Graphics)public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)protected final void firePropertyChange(java.lang.String property,
java.lang.Object oldvalue,
java.lang.Object newvalue)
property - one of the PROPERTY_XXX constants defined in
ITrace2D.oldvalue - the old value of the property.newvalue - the new value of the property.public javax.swing.JComponent getCustomConfigurator()
IErrorBarPolicyJComponent that takes
care of custom configuration properties for the UI support of error bar
policies.
Returns a JComponent that - stand alone - takes care of
configuring custom properties or null if nothing is required. This will be
integrated in the error bar wizard UI of jchart2d.
getCustomConfigurator in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>JComponent that - stand alone - takes care of
configuring custom properties or null if nothing is required.IErrorBarPolicy.getCustomConfigurator()public java.util.Set<IErrorBarPainter> getErrorBarPainters()
IErrorBarPolicyIErrorBarPainter to use.
getErrorBarPainters in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>IErrorBarPainter to use.IErrorBarPolicy.getErrorBarPainters()protected final ITrace2D getTrace()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()protected abstract int internalGetNegativeXError(int xPixel,
int yPixel,
ITracePoint2D original)
xPixel - the x value in pixel for the error to render.yPixel - the y value in pixel for the error to render.original - the original point, possibly useful for calculations.protected abstract int internalGetNegativeYError(int xPixel,
int yPixel,
ITracePoint2D original)
xPixel - the x value in pixel for the error to render.yPixel - the y value in pixel for the error to render.original - the original point, possibly useful for calculations.protected abstract int internalGetPositiveXError(int xPixel,
int yPixel,
ITracePoint2D original)
xPixel - the x value in pixel for the error to render.yPixel - the y value in pixel for the error to render.original - the original point, possibly useful for calculations.protected abstract int internalGetPositiveYError(int xPixel,
int yPixel,
ITracePoint2D original)
xPixel - the x coordinate in pixel for the error to render.yPixel - the y coordinate in pixel for the error to render.original - the original point, possibly useful for calculations.public final boolean isShowNegativeXErrors()
IErrorBarPolicyisShowNegativeXErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>IErrorBarPolicy.isShowNegativeXErrors()public final boolean isShowNegativeYErrors()
IErrorBarPolicyisShowNegativeYErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>IErrorBarPolicy.isShowNegativeYErrors()public final boolean isShowPositiveXErrors()
IErrorBarPolicyisShowPositiveXErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>IErrorBarPolicy.isShowPositiveXErrors()public final boolean isShowPositiveYErrors()
IErrorBarPolicyisShowPositiveYErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>IErrorBarPolicy.isShowPositiveYErrors()public void paintPoint(int absoluteX,
int absoluteY,
int nextX,
int nextY,
java.awt.Graphics g,
ITracePoint2D original)
IPointPainterThe next coordinates are also provided to allow to check how much distance is available for the graphic representation of the current point.
paintPoint in interface IPointPainter<AErrorBarPolicyConfigurable>absoluteX - the ready to use x value for the point to paint.absoluteY - the ready to use y value for the point to paint.nextX - the ready to use next x value for the point to paint.nextY - the ready to use next y value for the point to paint.g - the graphic context to paint on.original - just for information, for painting this should be irrelevant and
it should not be changed too!IPointPainter.paintPoint(int, int, int,
int, java.awt.Graphics, info.monitorenter.gui.chart.ITracePoint2D)public void propertyChange(java.beans.PropertyChangeEvent evt)
IErrorBarPainter.PROPERTY_CONNECTION to
IErrorBarPolicy.PROPERTY_CONFIGURATION
and informs outer PropertyChangeListener added with
addPropertyChangeListener(String, PropertyChangeListener).
propertyChange in interface java.beans.PropertyChangeListenerPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)public boolean removeErrorBarPainter(IErrorBarPainter painter)
IErrorBarPolicyremoveErrorBarPainter in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>painter - the error bar painter to remove.IErrorBarPolicy.removeErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
IErrorBarPolicyremovePropertyChangeListener in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>listener - a listener that will only be informed if the property identified
by the argument propertyName changesIErrorBarPolicy.removePropertyChangeListener(java.beans.PropertyChangeListener)public void removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener)
IErrorBarPolicyremovePropertyChangeListener in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>property - one of the constants with teh PROPERTY_ prefix
defined in this class or subclasses.listener - the listener for this property change.IErrorBarPolicy.removePropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)public void setErrorBarPainter(IErrorBarPainter painter)
IErrorBarPolicysetErrorBarPainter in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>painter - the painter to use.IErrorBarPolicy.setErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)public final void setShowNegativeXErrors(boolean showNegativeXErrors)
IErrorBarPolicysetShowNegativeXErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>showNegativeXErrors - if true negative errors in x dimension will be shown.IErrorBarPolicy.setShowNegativeXErrors(boolean)public final void setShowNegativeYErrors(boolean showNegativeYErrors)
IErrorBarPolicysetShowNegativeYErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>showNegativeYErrors - if true negative errors in y dimension will be shown.IErrorBarPolicy.setShowNegativeYErrors(boolean)public final void setShowPositiveXErrors(boolean showPositiveXErrors)
IErrorBarPolicysetShowPositiveXErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>showPositiveXErrors - if true positive errors in x dimension will be shown.IErrorBarPolicy.setShowPositiveXErrors(boolean)public final void setShowPositiveYErrors(boolean showPositiveYErrors)
IErrorBarPolicysetShowPositiveYErrors in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>showPositiveYErrors - if true positive errors in y dimension will be shown.IErrorBarPolicy.setShowPositiveYErrors(boolean)public void setTrace(ITrace2D trace)
ATrace2D only that
will register itself to the instances added to it.
This is support for error bar policies that need information about the
whole trace (e.g. median value). It has nothing to do with the kind of
error bar policy to be used by a trace. See
ITrace2D.setErrorBarPolicy(IErrorBarPolicy) and
ITrace2D.addErrorBarPolicy(IErrorBarPolicy) for this feature
instead.
setTrace in interface IErrorBarPolicy<AErrorBarPolicyConfigurable>trace - the trace error bars are rendered for.public void startPaintIteration(java.awt.Graphics g2d)
IPointPainterITrace2D.
startPaintIteration in interface IPointPainter<AErrorBarPolicyConfigurable>g2d - provided in case pending paint operations have to be performed.IPointPainter.startPaintIteration(java.awt.Graphics)Copyright © 2001 - 2010 LGPL, All Rights Footloose.