Interface IErrorBarPolicy<T extends IErrorBarPolicy<T>>
-
- Type Parameters:
T
- needed for generic comparable.
- All Superinterfaces:
java.lang.Comparable<T>
,IPointPainter<T>
,ITracePainter<T>
,java.io.Serializable
- All Known Implementing Classes:
AErrorBarPolicyConfigurable
,ErrorBarPolicyAbsoluteSummation
,ErrorBarPolicyRelative
public interface IErrorBarPolicy<T extends IErrorBarPolicy<T>> extends ITracePainter<T>
Interface for a facade towards painting error bars that adds a layer of configuration.It acts as a facade for an
with configurableITracePainter
instances that will be provided with configuredIErrorBarPainter
instances.IErrorBarPixel
Property Change events
The following table describes the contract of this interface of
instances that are thrown by methods.PropertyChangeEvent
thrown by method getPropertyName()
getSource()
getOldValue()
getNewValue()
All mutator methods that would cause different rendering. PROPERTY_CONFIGURATION
that changedIErrorBarPolicy
null
, as this event marks a general changenull
, as this event marks a general changeaddErrorBarPainter(IErrorBarPainter)
PROPERTY_ERRORBARPAINTER
that changedIErrorBarPolicy
null
, which marks that a new painter was added.
, the added painter.IErrorBarPainter
removeErrorBarPainter(IErrorBarPainter)
PROPERTY_ERRORBARPAINTER
that changedIErrorBarPolicy
, the removed painter.IErrorBarPainter
null
, which marks that a painter was removed.all mutator methods of IErrorBarPainter
PROPERTY_ERRORBARPAINTER
that changedIErrorBarPolicy
, the changed painter.IErrorBarPainter
, the changed painter (same as old value).IErrorBarPainter
- Version:
- $Revision: 1.21 $
- Author:
- Achim Westermann
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CONFIGURATION
The property key defining a general change of an instance.static java.lang.String
PROPERTY_ERRORBARPAINTER
This is fired whenever the internal set of error bar painters changes.
-
Method Summary
All Methods Instance Methods Abstract Methods 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)
Registers a property change listener that will be informed about changes of the property identified by the givenpropertyName
.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.javax.swing.JComponent
getCustomConfigurator()
Allows an implementation to return aJComponent
that takes care of custom configuration properties for the UI support of error bar policies.java.util.Set<IErrorBarPainter>
getErrorBarPainters()
Returns the set ofIErrorBarPainter
to use.double
getXError(double xValue)
Returns the relative x error (value domain) that is added to / subtracted from the values to display.double
getYError(double yValue)
Returns the relative y error (value domain) that is added to / subtracted from the values to display.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.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 forATrace2D
only that will register itself to the instances added to it.-
Methods inherited from interface info.monitorenter.gui.chart.IPointPainter
endPaintIteration, paintPoint, startPaintIteration
-
Methods inherited from interface info.monitorenter.gui.chart.ITracePainter
discontinue
-
-
-
-
Field Detail
-
PROPERTY_CONFIGURATION
static final java.lang.String PROPERTY_CONFIGURATION
The property key defining a general change of an instance.This is fired whenever the internal configuration of the error bar policy changes. This internal configuration should be of no interest for clients of this interface. What counts is that rendering of the error bars will have changed whenever this event is fired. Subclasses might fire this event to tell exactly this: "Rendering has changed. Please repaint."
As it is of no interest and knowledge which configuration has changed the
PropertyChangeEvent.getNewValue()
and thePropertyChangeEvent.getOldValue()
of thePropertyChangeEvent
given toPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
of listeners should be null always.Use in combination with
addPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
PROPERTY_ERRORBARPAINTER
static final java.lang.String PROPERTY_ERRORBARPAINTER
This is fired whenever the internal set of error bar painters changes.Namely from
addErrorBarPainter(IErrorBarPainter)
andsetErrorBarPainter(IErrorBarPainter)
.removeErrorBarPainter(IErrorBarPainter)
Use in combination with
addPropertyChangeListener(String, PropertyChangeListener)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
addErrorBarPainter
void addErrorBarPainter(IErrorBarPainter painter)
Adds the given error bar painter to the list of painters of this instance.- Parameters:
painter
- the painter to use.
-
addPropertyChangeListener
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 givenpropertyName
.- 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
-
calculateErrorBar
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.- 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.
-
getCustomConfigurator
javax.swing.JComponent getCustomConfigurator()
Allows an implementation to return aJComponent
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.- Returns:
- a
JComponent
that - stand alone - takes care of configuring custom properties or null if nothing is required.
-
getErrorBarPainters
java.util.Set<IErrorBarPainter> getErrorBarPainters()
Returns the set ofIErrorBarPainter
to use.- Returns:
- the set of
IErrorBarPainter
to use.
-
getXError
double getXError(double xValue)
Returns the relative x error (value domain) that is added to / subtracted from the values to display.- Parameters:
xValue
- the absolute x value (not pixel) to get the error for.- Returns:
- the relative x error in value domain that is added to / subtracted from the values to display.
-
getYError
double getYError(double yValue)
Returns the relative y error (value domain) that is added to / subtracted from the values to display.- Parameters:
yValue
- the absolute y value (not pixel) to get the error for.- Returns:
- the relative y error in value domain that is added to / subtracted from the values to display.
-
isShowNegativeXErrors
boolean isShowNegativeXErrors()
Returns true if negative errors in x dimension are shown.- Returns:
- true if negative errors in x dimension are shown.
-
isShowNegativeYErrors
boolean isShowNegativeYErrors()
Returns true if negative errors in y dimension are shown.- Returns:
- true if negative errors in y dimension are shown.
-
isShowPositiveXErrors
boolean isShowPositiveXErrors()
Returns true if positive errors in x dimension are shown.- Returns:
- true if positive errors in x dimension are shown.
-
isShowPositiveYErrors
boolean isShowPositiveYErrors()
Returns true if positive errors in y dimension are shown.- Returns:
- true if positive errors in y dimension are shown.
-
removeErrorBarPainter
boolean removeErrorBarPainter(IErrorBarPainter painter)
Removes the given error bar painter.- 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.
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deregisters a property change listener that has been registerd for listening on all properties.- Parameters:
listener
- a listener that will only be informed if the property identified by the argumentpropertyName
changes
-
removePropertyChangeListener
void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
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.
-
setErrorBarPainter
void setErrorBarPainter(IErrorBarPainter painter)
Makes the given error bar painter the sole painter for error bars of this instance.- Parameters:
painter
- the painter to use.
-
setShowNegativeXErrors
void setShowNegativeXErrors(boolean showNegativeXErrors)
Set whether negative errors in x dimension should be shown.- Parameters:
showNegativeXErrors
- if true negative errors in x dimension will be shown.
-
setShowNegativeYErrors
void setShowNegativeYErrors(boolean showNegativeYErrors)
Set whether negative errors in y dimension should be shown.- Parameters:
showNegativeYErrors
- if true negative errors in y dimension will be shown.
-
setShowPositiveXErrors
void setShowPositiveXErrors(boolean showPositiveXErrors)
Set whether positive errors in x dimension should be shown.- Parameters:
showPositiveXErrors
- if true positive errors in x dimension will be shown.
-
setShowPositiveYErrors
void setShowPositiveYErrors(boolean showPositiveYErrors)
Set whether positive errors in y dimension should be shown.- Parameters:
showPositiveYErrors
- if true positive errors in y dimension will be shown.
-
setTrace
void setTrace(ITrace2D trace)
Intended forATrace2D
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)
andITrace2D.addErrorBarPolicy(IErrorBarPolicy)
for this feature instead.- Parameters:
trace
- the trace error bars are rendered for.
-
-