Class AErrorBarPolicyConfigurable
- All Implemented Interfaces:
IErrorBarPolicy<AErrorBarPolicyConfigurable>,IPointPainter<AErrorBarPolicyConfigurable>,ITracePainter<AErrorBarPolicyConfigurable>,PropertyChangeListener,Serializable,Comparable<AErrorBarPolicyConfigurable>,EventListener
- Direct Known Subclasses:
ErrorBarPolicyAbsoluteSummation,ErrorBarPolicyRelative
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.
- Version:
- $Revision: 1.41 $
- Author:
- Achim Westermann
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ITracePoint2DThe last trace point coordinate that was sent topaintPoint(int, int, int, int, Graphics, ITracePoint2D).protected intThe last x coordinate that was sent topaintPoint(int, int, int, int, Graphics, ITracePoint2D).protected intThe last y coordinate that was sent topaintPoint(int, int, int, int, Graphics, ITracePoint2D).protected PropertyChangeSupportThe instance that add support for firingPropertyChangeEventsand maintainingPropertyChangeListeners.Fields inherited from interface info.monitorenter.gui.chart.IErrorBarPolicy
PROPERTY_CONFIGURATION, PROPERTY_ERRORBARPAINTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorBarPainter(IErrorBarPainter painter) Adds the given error bar painter to the list of painters of this instance.final voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Adds a property change listener.final voidcalculateErrorBar(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.intvoiddiscontinue(Graphics g2d) Invoked to inform the painter that a discontinue in the trace to # paint has occured.voidInvoked to inform implementations that a paint iteration ends for the correspondingITrace2D.booleanprotected final voidfirePropertyChange(String property, Object oldvalue, Object newvalue) Fires a property change event to the registered listeners.Allows an implementation to return aJComponentthat takes care of custom configuration properties for the UI support of error bar policies.Returns the set ofIErrorBarPainterto use.protected final ITrace2DgetTrace()Returns the trace error bars have to be rendered for.inthashCode()protected abstract intinternalGetNegativeXError(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 intinternalGetNegativeYError(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 intinternalGetPositiveXError(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 intinternalGetPositiveYError(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).final booleanReturns true if negative errors in x dimension are shown.final booleanReturns true if negative errors in y dimension are shown.final booleanReturns true if positive errors in x dimension are shown.final booleanReturns true if positive errors in y dimension are shown.voidpaintPoint(int absoluteX, int absoluteY, int nextX, int nextY, Graphics g, ITracePoint2D original) Paint the point given by absolute coordinates on the given graphic context.voidJust turns the property change event of subsequent configuration (liketoIErrorBarPainter.PROPERTY_CONNECTIONand informs outerIErrorBarPolicy.PROPERTY_CONFIGURATIONadded withPropertyChangeListener.addPropertyChangeListener(String, PropertyChangeListener)booleanremoveErrorBarPainter(IErrorBarPainter painter) Removes the given error bar painter.voidDeregisters a property change listener that has been registerd for listening on all properties.voidremovePropertyChangeListener(String property, PropertyChangeListener listener) Removes a property change listener for listening on the given property.voidsetErrorBarPainter(IErrorBarPainter painter) Makes the given error bar painter the sole painter for error bars of this instance.final voidsetShowNegativeXErrors(boolean showNegativeXErrors) Set whether negative errors in x dimension should be shown.final voidsetShowNegativeYErrors(boolean showNegativeYErrors) Set whether negative errors in y dimension should be shown.final voidsetShowPositiveXErrors(boolean showPositiveXErrors) Set whether positive errors in x dimension should be shown.final voidsetShowPositiveYErrors(boolean showPositiveYErrors) Set whether positive errors in y dimension should be shown.voidIntended forATrace2Donly that will register itself to the instances added to it.voidInvoked to inform implementations that a paint iteration starts for the correspondingITrace2D.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface info.monitorenter.gui.chart.IErrorBarPolicy
getXError, getYError
-
Field Details
-
m_lastPoint
The last trace point coordinate that was sent topaintPoint(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. -
m_lastX
protected int m_lastXThe last x coordinate that was sent topaintPoint(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. -
m_lastY
protected int m_lastYThe last y coordinate that was sent topaintPoint(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. -
m_propertyChangeSupport
The instance that add support for firingPropertyChangeEventsand maintainingPropertyChangeListeners.PropertyChangeListenerinstances.
-
-
Constructor Details
-
AErrorBarPolicyConfigurable
public AErrorBarPolicyConfigurable()Defcon.
-
-
Method Details
-
addErrorBarPainter
Description copied from interface:IErrorBarPolicyAdds the given error bar painter to the list of painters of this instance.- Specified by:
addErrorBarPainterin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
painter- the painter to use.- See Also:
-
addPropertyChangeListener
Adds a property change listener.- Specified by:
addPropertyChangeListenerin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
propertyName- The name of the property to listen on.listener- The PropertyChangeListener to be added.- See Also:
-
calculateErrorBar
public final void calculateErrorBar(int xPixel, int yPixel, ErrorBarPixel errorBar, ITracePoint2D original) Description copied from interface:IErrorBarPolicyCalculates the errors of the given errorbar according to the point to render and the configuration of this instance.- Specified by:
calculateErrorBarin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
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.- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<AErrorBarPolicyConfigurable>- See Also:
-
discontinue
Description copied from interface:ITracePainterInvoked to inform the painter that a discontinue in the trace to # paint has occured.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)).- Specified by:
discontinuein interfaceITracePainter<AErrorBarPolicyConfigurable>- Parameters:
g2d- provided in case pending paint operations have to be performed.- See Also:
-
endPaintIteration
Description copied from interface:IPointPainterInvoked to inform implementations that a paint iteration ends for the correspondingITrace2D.- Specified by:
endPaintIterationin interfaceIPointPainter<AErrorBarPolicyConfigurable>- Parameters:
g2d- provided in case pending paint operations have to be performed.- See Also:
-
equals
-
firePropertyChange
Fires a property change event to the registered listeners.- Parameters:
property- one of thePROPERTY_XXXconstants defined in.ITrace2Doldvalue- the old value of the property.newvalue- the new value of the property.
-
getCustomConfigurator
Description copied from interface:IErrorBarPolicyAllows an implementation to return aJComponentthat takes care of custom configuration properties for the UI support of error bar policies.Returns a
JComponentthat - 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.- Specified by:
getCustomConfiguratorin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- a
JComponentthat - stand alone - takes care of configuring custom properties or null if nothing is required. - See Also:
-
getErrorBarPainters
Description copied from interface:IErrorBarPolicyReturns the set ofIErrorBarPainterto use.- Specified by:
getErrorBarPaintersin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- the set of
IErrorBarPainterto use. - See Also:
-
getTrace
Returns the trace error bars have to be rendered for.- Returns:
- the trace for rendering error bars.
-
hashCode
public int hashCode() -
internalGetNegativeXError
Internally compute the negative x error for the given point as a pixel value (not relative to the the origin value).- Parameters:
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.- Returns:
- the negative x error in pixel for the given point as an absolute value (not relative to the the origin value).
-
internalGetNegativeYError
Internally compute the negative y error for the given point as a pixel value (not relative to the the origin value).- Parameters:
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.- Returns:
- the negative y error in pixel for the given point as an absolute value (not relative to the the origin value).
-
internalGetPositiveXError
Internally compute the positive x error in pixel for the given point as an absolute value (not relative to the the origin value).- Parameters:
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.- Returns:
- the positive x error in pixel for the given point as an absolute value (not relative to the the origin value).
-
internalGetPositiveYError
Internally compute the positive y error in pixel for the given point as an absolute value (not relative to the the origin value).- Parameters:
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.- Returns:
- the positive y error in pixel for the given point as an absolute value (not relative to the the origin value).
-
isShowNegativeXErrors
public final boolean isShowNegativeXErrors()Description copied from interface:IErrorBarPolicyReturns true if negative errors in x dimension are shown.- Specified by:
isShowNegativeXErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- true if negative errors in x dimension are shown.
- See Also:
-
isShowNegativeYErrors
public final boolean isShowNegativeYErrors()Description copied from interface:IErrorBarPolicyReturns true if negative errors in y dimension are shown.- Specified by:
isShowNegativeYErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- true if negative errors in y dimension are shown.
- See Also:
-
isShowPositiveXErrors
public final boolean isShowPositiveXErrors()Description copied from interface:IErrorBarPolicyReturns true if positive errors in x dimension are shown.- Specified by:
isShowPositiveXErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- true if positive errors in x dimension are shown.
- See Also:
-
isShowPositiveYErrors
public final boolean isShowPositiveYErrors()Description copied from interface:IErrorBarPolicyReturns true if positive errors in y dimension are shown.- Specified by:
isShowPositiveYErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Returns:
- true if positive errors in y dimension are shown.
- See Also:
-
paintPoint
public void paintPoint(int absoluteX, int absoluteY, int nextX, int nextY, Graphics g, ITracePoint2D original) Description copied from interface:IPointPainterPaint the point given by absolute coordinates on the given graphic context.The next coordinates are also provided to allow to check how much distance is available for the graphic representation of the current point.
- Specified by:
paintPointin interfaceIPointPainter<AErrorBarPolicyConfigurable>- 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.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!- See Also:
-
propertyChange
Just turns the property change event of subsequent configuration (liketoIErrorBarPainter.PROPERTY_CONNECTIONand informs outerIErrorBarPolicy.PROPERTY_CONFIGURATIONadded withPropertyChangeListener.addPropertyChangeListener(String, PropertyChangeListener)- Specified by:
propertyChangein interfacePropertyChangeListener- See Also:
-
removeErrorBarPainter
Description copied from interface:IErrorBarPolicyRemoves the given error bar painter.- Specified by:
removeErrorBarPainterin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
painter- the error bar painter to remove.- Returns:
- true if the given error bar painter was removed, comparison by the means of the equals operation.
- See Also:
-
removePropertyChangeListener
Description copied from interface:IErrorBarPolicyDeregisters a property change listener that has been registerd for listening on all properties.- Specified by:
removePropertyChangeListenerin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
listener- a listener that will only be informed if the property identified by the argumentpropertyNamechanges- See Also:
-
removePropertyChangeListener
Description copied from interface:IErrorBarPolicyRemoves a property change listener for listening on the given property.- Specified by:
removePropertyChangeListenerin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
property- one of the constants with tehPROPERTY_prefix defined in this class or subclasses.listener- the listener for this property change.- See Also:
-
setErrorBarPainter
Description copied from interface:IErrorBarPolicyMakes the given error bar painter the sole painter for error bars of this instance.- Specified by:
setErrorBarPainterin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
painter- the painter to use.- See Also:
-
setShowNegativeXErrors
public final void setShowNegativeXErrors(boolean showNegativeXErrors) Description copied from interface:IErrorBarPolicySet whether negative errors in x dimension should be shown.- Specified by:
setShowNegativeXErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
showNegativeXErrors- if true negative errors in x dimension will be shown.- See Also:
-
setShowNegativeYErrors
public final void setShowNegativeYErrors(boolean showNegativeYErrors) Description copied from interface:IErrorBarPolicySet whether negative errors in y dimension should be shown.- Specified by:
setShowNegativeYErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
showNegativeYErrors- if true negative errors in y dimension will be shown.- See Also:
-
setShowPositiveXErrors
public final void setShowPositiveXErrors(boolean showPositiveXErrors) Description copied from interface:IErrorBarPolicySet whether positive errors in x dimension should be shown.- Specified by:
setShowPositiveXErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
showPositiveXErrors- if true positive errors in x dimension will be shown.- See Also:
-
setShowPositiveYErrors
public final void setShowPositiveYErrors(boolean showPositiveYErrors) Description copied from interface:IErrorBarPolicySet whether positive errors in y dimension should be shown.- Specified by:
setShowPositiveYErrorsin interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
showPositiveYErrors- if true positive errors in y dimension will be shown.- See Also:
-
setTrace
Intended forATrace2Donly 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)andITrace2D.addErrorBarPolicy(IErrorBarPolicy)for this feature instead.- Specified by:
setTracein interfaceIErrorBarPolicy<AErrorBarPolicyConfigurable>- Parameters:
trace- the trace error bars are rendered for.
-
startPaintIteration
Description copied from interface:IPointPainterInvoked to inform implementations that a paint iteration starts for the correspondingITrace2D.- Specified by:
startPaintIterationin interfaceIPointPainter<AErrorBarPolicyConfigurable>- Parameters:
g2d- provided in case pending paint operations have to be performed.- See Also:
-