|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable
public abstract class AErrorBarPolicyConfigurable
A
base implementation that is
configurable by the means of showing positive/negative errors in x/y dimension.
IErrorBarPolicy
Implementations have to implement the methods
.
internalGetNegativeXError(int, int, TracePoint2D)
internalGetNegativeYError(int, int, TracePoint2D)
internalGetPositiveXError(int, int, TracePoint2D)
internalGetPositiveYError(int, int, TracePoint2D)
Please see the class description of IErrorBarPixel
for
details.
Field Summary | |
---|---|
protected TracePoint2D |
m_lastPoint
The last trace point coordinate that was sent to paintPoint(int, int, int, int, Graphics2D, TracePoint2D) . |
protected int |
m_lastX
The last x coordinate that was sent to paintPoint(int, int, int, int, Graphics2D, TracePoint2D) . |
protected int |
m_lastY
The last y coordinate that was sent to paintPoint(int, int, int, int, Graphics2D, TracePoint2D) . |
protected PropertyChangeSupport |
m_propertyChangeSupport
The instance that add support for firing PropertyChangeEvents and maintaining
PropertyChangeListeners . |
Fields inherited from interface info.monitorenter.gui.chart.IErrorBarPolicy |
---|
PROPERTY_CONFIGURATION, PROPERTY_ERRORBARPAINTER |
Constructor Summary | |
---|---|
AErrorBarPolicyConfigurable()
Defcon. |
Method Summary | |
---|---|
void |
addErrorBarPainter(IErrorBarPainter painter)
Adds the given error bar painter to the list of painters of this instance. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Adds a property change listener. |
void |
calculateErrorBar(int xPixel,
int yPixel,
ErrorBarPixel errorBar,
TracePoint2D original)
Calculates the errors of the given errorbar according to the point to render and the configuration of this instance. |
int |
compareTo(Object arg0)
|
void |
discontinue(Graphics2D g2d,
ITrace2D trace)
Invoked to inform the painter that a discontinue in the trace to # paint has occured. |
void |
endPaintIteration(Graphics2D g2d)
Invoked to inform implementations that a paint iteration ends for the corresponding ITrace2D . |
protected void |
firePropertyChange(String property,
Object oldvalue,
Object newvalue)
Fires a property change event to the registered listeners. |
JComponent |
getCustomConfigurator()
Allows an implementation to return a JComponent that takes care of custom
configuration properties for the UI support of error bar policies. |
Set |
getErrorBarPainters()
Returns the set of IErrorBarPainter to use. |
protected ITrace2D |
getTrace()
Returns the trace error bars have to be rendered for. |
protected abstract int |
internalGetNegativeXError(int xPixel,
int yPixel,
TracePoint2D 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,
TracePoint2D 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,
TracePoint2D 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,
TracePoint2D 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,
Graphics2D g,
TracePoint2D original)
Paint the point given by absolute coordinates on the given graphic context. |
void |
propertyChange(PropertyChangeEvent evt)
Just turns the property change event of subsequent configuration (like to
and informs outer
addes with
. |
boolean |
removeErrorBarPainter(IErrorBarPainter painter)
Removes the given error bar painter. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deregisters a property change listener that has been registerd for listening on all properties. |
void |
removePropertyChangeListener(String property,
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(Graphics2D g2d,
ITrace2D trace)
Invoked to inform implementations that a paint iteration starts for the corresponding ITrace2D . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface info.monitorenter.gui.chart.IErrorBarPolicy |
---|
getXError, getYError |
Field Detail |
---|
protected TracePoint2D m_lastPoint
paintPoint(int, int, int, int, Graphics2D, TracePoint2D)
.
It will be needed at endPaintIteration(Graphics2D)
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, Graphics2D, TracePoint2D)
.
It will be needed at endPaintIteration(Graphics2D)
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, Graphics2D, TracePoint2D)
.
It will be needed at endPaintIteration(Graphics2D)
as the former method only uses the
first set of coordinates to store in the internal list to avoid duplicates.
protected PropertyChangeSupport m_propertyChangeSupport
PropertyChangeEvents
and maintaining
PropertyChangeListeners
. PropertyChangeListener
instances.
Constructor Detail |
---|
public AErrorBarPolicyConfigurable()
Method Detail |
---|
public void addErrorBarPainter(IErrorBarPainter painter)
IErrorBarPolicy
addErrorBarPainter
in interface IErrorBarPolicy
painter
- the painter to use.IErrorBarPolicy.addErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)
public final void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener
in interface IErrorBarPolicy
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, TracePoint2D original)
IErrorBarPolicy
calculateErrorBar
in interface IErrorBarPolicy
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.TracePoint2D)
public int compareTo(Object arg0)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
public void discontinue(Graphics2D g2d, ITrace2D trace)
ITracePainter
This only has to be implemented by painters that collect several points of
IPointPainter.paintPoint(int, int, int, int, Graphics2D, TracePoint2D)
to draw them as polygons
(e.g.: Graphics.drawPolyline(int[], int[], int)
).
discontinue
in interface ITracePainter
g2d
- provided in case pending paint operations have to be performed.trace
- the trace to discontinue painting of.ITracePainter.discontinue(java.awt.Graphics2D,
info.monitorenter.gui.chart.ITrace2D)
public void endPaintIteration(Graphics2D g2d)
ITracePainter
ITrace2D
.
endPaintIteration
in interface ITracePainter
g2d
- provided in case pending paint operations have to be performed.ITracePainter.endPaintIteration(java.awt.Graphics2D)
protected final void firePropertyChange(String property, Object oldvalue, 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 JComponent getCustomConfigurator()
IErrorBarPolicy
JComponent
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
JComponent
that - stand alone - takes care of configuring custom
properties or null if nothing is required.IErrorBarPolicy.getCustomConfigurator()
public Set getErrorBarPainters()
IErrorBarPolicy
IErrorBarPainter
to use.
getErrorBarPainters
in interface IErrorBarPolicy
IErrorBarPainter
to use.IErrorBarPolicy.getErrorBarPainters()
protected final ITrace2D getTrace()
protected abstract int internalGetNegativeXError(int xPixel, int yPixel, TracePoint2D 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, TracePoint2D 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, TracePoint2D 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, TracePoint2D 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()
IErrorBarPolicy
isShowNegativeXErrors
in interface IErrorBarPolicy
IErrorBarPolicy.isShowNegativeXErrors()
public final boolean isShowNegativeYErrors()
IErrorBarPolicy
isShowNegativeYErrors
in interface IErrorBarPolicy
IErrorBarPolicy.isShowNegativeYErrors()
public final boolean isShowPositiveXErrors()
IErrorBarPolicy
isShowPositiveXErrors
in interface IErrorBarPolicy
IErrorBarPolicy.isShowPositiveXErrors()
public final boolean isShowPositiveYErrors()
IErrorBarPolicy
isShowPositiveYErrors
in interface IErrorBarPolicy
IErrorBarPolicy.isShowPositiveYErrors()
public void paintPoint(int absoluteX, int absoluteY, int nextX, int nextY, Graphics2D g, TracePoint2D original)
IPointPainter
The next coordinates are also provided to allow to check how much distance is available for the graphic representation of the current point.
Note that by contract the
argument is
only guaranteed to be non-null in case the instance is used as a painter
for TracePoint2D
subtypes. If you plan to use your
implementation also for a subcomponent of an
ITracePainter
(e.g.
IErrorBarPainter
)
then you have to implement "null - safe" for that argument.
IErrorBarPainter.setConnectionPainter(IPointPainter)
paintPoint
in interface IPointPainter
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.Graphics2D, info.monitorenter.gui.chart.TracePoint2D)
public void propertyChange(PropertyChangeEvent evt)
IErrorBarPainter.PROPERTY_CONNECTION
to
IErrorBarPolicy.PROPERTY_CONFIGURATION
and informs outer
PropertyChangeListener
addes with
addPropertyChangeListener(String, PropertyChangeListener)
.
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public boolean removeErrorBarPainter(IErrorBarPainter painter)
IErrorBarPolicy
removeErrorBarPainter
in interface IErrorBarPolicy
painter
- the error bar painter to remove.
IErrorBarPolicy.removeErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)
public void removePropertyChangeListener(PropertyChangeListener listener)
IErrorBarPolicy
removePropertyChangeListener
in interface IErrorBarPolicy
listener
- a listener that will only be informed if the property identified by the argument
propertyName
changesIErrorBarPolicy.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
IErrorBarPolicy
removePropertyChangeListener
in interface IErrorBarPolicy
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)
IErrorBarPolicy
setErrorBarPainter
in interface IErrorBarPolicy
painter
- the painter to use.IErrorBarPolicy.setErrorBarPainter(info.monitorenter.gui.chart.IErrorBarPainter)
public final void setShowNegativeXErrors(boolean showNegativeXErrors)
IErrorBarPolicy
setShowNegativeXErrors
in interface IErrorBarPolicy
showNegativeXErrors
- if true negative errors in x dimension will be shown.IErrorBarPolicy.setShowNegativeXErrors(boolean)
public final void setShowNegativeYErrors(boolean showNegativeYErrors)
IErrorBarPolicy
setShowNegativeYErrors
in interface IErrorBarPolicy
showNegativeYErrors
- if true negative errors in y dimension will be shown.IErrorBarPolicy.setShowNegativeYErrors(boolean)
public final void setShowPositiveXErrors(boolean showPositiveXErrors)
IErrorBarPolicy
setShowPositiveXErrors
in interface IErrorBarPolicy
showPositiveXErrors
- if true positive errors in x dimension will be shown.IErrorBarPolicy.setShowPositiveXErrors(boolean)
public final void setShowPositiveYErrors(boolean showPositiveYErrors)
IErrorBarPolicy
setShowPositiveYErrors
in interface IErrorBarPolicy
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
trace
- the trace error bars are rendered for.public void startPaintIteration(Graphics2D g2d, ITrace2D trace)
ITracePainter
ITrace2D
.
startPaintIteration
in interface ITracePainter
g2d
- provided in case pending paint operations have to be performed.trace
- the TracePoint2D
to paint in this iteration.ITracePainter.startPaintIteration(java.awt.Graphics2D,
info.monitorenter.gui.chart.ITrace2D)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |