Package jcckit.plot
Class ErrorBarFactory
- java.lang.Object
-
- jcckit.plot.ErrorBarFactory
-
- All Implemented Interfaces:
SymbolFactory
public class ErrorBarFactory extends java.lang.Object implements SymbolFactory
Symbol factory for creating symbols with error bars. It wraps aSymbolFactoryfor creating the symbol. The error bars areRectangles.Curves with error bars are based on two
DataCurves:- The plain curve.
- An instance which stores the errors in x and y. It is assumed that the errors are positive values defining the error symmetrically around the curve points.
The ErrorBarFactory needs an instance of
PositionHintas initialHintfor the next curve. Its origin must be the origin of the data coordinate system in device-independent coordinates. The position of PositionHint must be undefined.- Author:
- Franz-Josef Elmer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSYMBOL_FACTORY_KEYConfiguration parameter key.-
Fields inherited from interface jcckit.plot.SymbolFactory
ATTRIBUTES_KEY, DEFAULT_SIZE, SIZE_KEY
-
-
Constructor Summary
Constructors Constructor Description ErrorBarFactory(ConfigParameters config)Creates an instance from the specified configuration parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphicalElementcreateLegendSymbol(GraphPoint centerPosition, double size)Creates the legend symbol.SymbolcreateSymbol(GraphPoint point, Hint hintFromPreviousPoint, Hint hintFromPreviousCurve)Creates either the curve symbol or the error bars.
-
-
-
Field Detail
-
SYMBOL_FACTORY_KEY
public static final java.lang.String SYMBOL_FACTORY_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ErrorBarFactory
public ErrorBarFactory(ConfigParameters config)
Creates an instance from the specified configuration parameters.Key & Default Value Type Mandatory Description symbolFactory = null ConfigParameters no Definition of the wrapped SymbolFactorywhich generates the curve symbol without bars. By default an emptyGraphicalCompositewill be created.size = 0 double no Width of the error bars. attributes = null ConfigParameters no Definition of the GraphicAttributesof the error bars.
-
-
Method Detail
-
createLegendSymbol
public GraphicalElement createLegendSymbol(GraphPoint centerPosition, double size)
Creates the legend symbol. Calls the wrappedSymbolFactoryor returns an empty instance ofGraphicalCompositeif undefined.- Specified by:
createLegendSymbolin interfaceSymbolFactory- Parameters:
centerPosition- Center position of the symbol.size- The size of the symbol. Will not be used if the symbol of the curve points have all the same size. In this case the symbol for the legend has the size of the curve symbols.
-
createSymbol
public Symbol createSymbol(GraphPoint point, Hint hintFromPreviousPoint, Hint hintFromPreviousCurve)
Creates either the curve symbol or the error bars. Error bars are created when hintFromPreviousCurve is an instance ofPositionHintand its position attribute is not null. Otherwise the curve symbol is created. The position attributes stores the curve point (in device-independent coordinates). The origin is always as set in the initial PositionHint. The hint for the next curve wrapped by the returned Symbol is always a PositionHint.- Specified by:
createSymbolin interfaceSymbolFactory- Parameters:
point- The position of the symbol. In general it is a transformation of a correspondingDataPointinto aGraphPoint.hintFromPreviousPoint- Hint from the previous point of the sameCurveor null.hintFromPreviousCurve- Hint from the previousCurveor null.
-
-