Class ErrorBarPolicyRelative
- java.lang.Object
-
- info.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable
-
- info.monitorenter.gui.chart.errorbars.ErrorBarPolicyRelative
-
- All Implemented Interfaces:
IErrorBarPolicy<AErrorBarPolicyConfigurable>,IPointPainter<AErrorBarPolicyConfigurable>,ITracePainter<AErrorBarPolicyConfigurable>,java.beans.PropertyChangeListener,java.io.Serializable,java.lang.Comparable<AErrorBarPolicyConfigurable>,java.util.EventListener
public class ErrorBarPolicyRelative extends AErrorBarPolicyConfigurable
Configurablethat adds a relative error (relative to the absolute values) to the points to render.IErrorBarPolicyYou should not use this if you have a small value range but very high values: The relative value will cause exteremely long lines (be much higher than the value range to display) and fold the trace to a minimum line.
- Version:
- $Revision: 1.23 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class info.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable
m_lastPoint, m_lastX, m_lastY, m_propertyChangeSupport
-
Fields inherited from interface info.monitorenter.gui.chart.IErrorBarPolicy
PROPERTY_CONFIGURATION, PROPERTY_ERRORBARPAINTER
-
-
Constructor Summary
Constructors Constructor Description ErrorBarPolicyRelative(double relativeError)Creates an instance with the given relative errors.ErrorBarPolicyRelative(double relativeXError, double relativeYError)Creates an instance with the given relative errors.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)javax.swing.JComponentgetCustomConfigurator()Allows an implementation to return aJComponentthat takes care of custom configuration properties for the UI support of error bar policies.doublegetRelativeXError()Returns the relative x error between 0 and 1.doublegetRelativeYError()Returns the relative y error between 0 and 1.doublegetXError(double xValue)Returns the relative x error (value domain) that is added to / subtracted from the values to display.doublegetYError(double yValue)Returns the relative y error (value domain) that is added to / subtracted from the values to display.inthashCode()protected 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 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 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 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).voidsetRelativeXError(double relativeXError)Sets the relative X error to add to each error bar.voidsetRelativeYError(double relativeYError)Sets the relative Y error to add to each error bar.-
Methods inherited from class info.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable
addErrorBarPainter, addPropertyChangeListener, calculateErrorBar, compareTo, discontinue, endPaintIteration, firePropertyChange, getErrorBarPainters, getTrace, isShowNegativeXErrors, isShowNegativeYErrors, isShowPositiveXErrors, isShowPositiveYErrors, paintPoint, propertyChange, removeErrorBarPainter, removePropertyChangeListener, removePropertyChangeListener, setErrorBarPainter, setShowNegativeXErrors, setShowNegativeYErrors, setShowPositiveXErrors, setShowPositiveYErrors, setTrace, startPaintIteration
-
-
-
-
Constructor Detail
-
ErrorBarPolicyRelative
public ErrorBarPolicyRelative(double relativeError) throws java.lang.IllegalArgumentExceptionCreates an instance with the given relative errors.The relative error is related to the absolut x and y values to render. It has to be between 0.0 and 1.0.
- Parameters:
relativeError- the relative error value between 0.0 and 1.0 for x and y dimension.- Throws:
java.lang.IllegalArgumentException- if the argument is not between 0.0 and 1.0.- See Also:
ErrorBarPolicyRelative(double, double)
-
ErrorBarPolicyRelative
public ErrorBarPolicyRelative(double relativeXError, double relativeYError) throws java.lang.IllegalArgumentExceptionCreates an instance with the given relative errors.The relative error is related to the absolut x and y values to render. It has to be between 0.0 and 1.0.
- Parameters:
relativeXError- the relative x error value between 0.0 and 1.0.relativeYError- the relative y error value between 0.0 and 1.0.- Throws:
java.lang.IllegalArgumentException- if the argument is not between 0.0 and 1.0.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAErrorBarPolicyConfigurable- See Also:
Object.equals(java.lang.Object)
-
getCustomConfigurator
public javax.swing.JComponent 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>- Overrides:
getCustomConfiguratorin classAErrorBarPolicyConfigurable- Returns:
- a
JComponentthat - stand alone - takes care of configuring custom properties or null if nothing is required. - See Also:
AErrorBarPolicyConfigurable.getCustomConfigurator()
-
getRelativeXError
public final double getRelativeXError()
Returns the relative x error between 0 and 1.- Returns:
- the relative x error.
-
getRelativeYError
public final double getRelativeYError()
Returns the relative y error between 0 and 1.- Returns:
- the relative y Error.
-
getXError
public final double getXError(double xValue)
Description copied from interface:IErrorBarPolicyReturns 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.
- See Also:
IErrorBarPolicy.getXError(double)
-
getYError
public final double getYError(double yValue)
Description copied from interface:IErrorBarPolicyReturns 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.
- See Also:
IErrorBarPolicy.getYError(double)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAErrorBarPolicyConfigurable- See Also:
Object.hashCode()
-
internalGetNegativeXError
protected int internalGetNegativeXError(int xPixel, int yPixel, ITracePoint2D original)Description copied from class:AErrorBarPolicyConfigurableInternally compute the negative x error for the given point as a pixel value (not relative to the the origin value).- Specified by:
internalGetNegativeXErrorin classAErrorBarPolicyConfigurable- 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).
- See Also:
AErrorBarPolicyConfigurable.internalGetNegativeXError(int, int, info.monitorenter.gui.chart.ITracePoint2D)
-
internalGetNegativeYError
protected int internalGetNegativeYError(int xPixel, int yPixel, ITracePoint2D original)Description copied from class:AErrorBarPolicyConfigurableInternally compute the negative y error for the given point as a pixel value (not relative to the the origin value).- Specified by:
internalGetNegativeYErrorin classAErrorBarPolicyConfigurable- 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).
- See Also:
AErrorBarPolicyConfigurable.internalGetNegativeYError(int, int, info.monitorenter.gui.chart.ITracePoint2D)
-
internalGetPositiveXError
protected int internalGetPositiveXError(int xPixel, int yPixel, ITracePoint2D original)Description copied from class:AErrorBarPolicyConfigurableInternally compute the positive x error in pixel for the given point as an absolute value (not relative to the the origin value).- Specified by:
internalGetPositiveXErrorin classAErrorBarPolicyConfigurable- 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).
- See Also:
AErrorBarPolicyConfigurable.internalGetPositiveXError(int, int, info.monitorenter.gui.chart.ITracePoint2D)
-
internalGetPositiveYError
protected int internalGetPositiveYError(int xPixel, int yPixel, ITracePoint2D original)Description copied from class:AErrorBarPolicyConfigurableInternally compute the positive y error in pixel for the given point as an absolute value (not relative to the the origin value).- Specified by:
internalGetPositiveYErrorin classAErrorBarPolicyConfigurable- 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).
- See Also:
AErrorBarPolicyConfigurable.internalGetPositiveYError(int, int, info.monitorenter.gui.chart.ITracePoint2D)
-
setRelativeXError
public final void setRelativeXError(double relativeXError) throws java.lang.IllegalArgumentExceptionSets the relative X error to add to each error bar.The relative error is related to the absolute x values to render. It has to be between 0.0 and 1.0.
- Parameters:
relativeXError- a value between 0.0 and 1.0.- Throws:
java.lang.IllegalArgumentException- if the argument is not between 0.0 and 1.0.
-
setRelativeYError
public final void setRelativeYError(double relativeYError) throws java.lang.IllegalArgumentExceptionSets the relative Y error to add to each error bar.The relative error is related to the absolut y values to render. It has to be between 0.0 and 1.0.
- Parameters:
relativeYError- a value between 0.0 and 1.0.- Throws:
java.lang.IllegalArgumentException- if the argument is not between 0.0 and 1.0.
-
-