Package jcckit.plot
Class BarFactory
java.lang.Object
jcckit.plot.AbstractSymbolFactory
jcckit.plot.BarFactory
- All Implemented Interfaces:
SymbolFactory
A factory of bars. The bars are
Rectangles
.
Depending on the configuration parameters the bars can be
horizontal or vertical. Bars of several curves can be side by side or
stacked. The bar length is determined by the x or y value of the
curve point in device-independent coordinates. If the value is negative
the bar goes into the negative direction. For stacked bars the values
should always be positive.
When used inside a SimpleCurve
soft clipping should always be
switched off (see
SimpleCurve(ConfigParameters, int, int, ClippingShape, Legend)
).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration parameter key.static final String
Configuration parameter key.Fields inherited from class jcckit.plot.AbstractSymbolFactory
_attributes, _size
Fields inherited from interface jcckit.plot.SymbolFactory
ATTRIBUTES_KEY, DEFAULT_SIZE, SIZE_KEY
-
Constructor Summary
ConstructorDescriptionBarFactory
(ConfigParameters config) Creates an instance from the specified configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateLegendSymbol
(GraphPoint centerPosition, double size) Creates a symbol for the legend at the specified position.protected GraphicalElement
createPlainSymbol
(GraphPoint centerPosition, double size, GraphicAttributes attributes) Returns null because this method isn't needed but has to be implemented.protected Symbol
createSymbol
(GraphPoint point, GraphicAttributes attributes, Hint hintForNextPoint, Hint hintFromPreviousCurve) Creates a bar at the specified point.Methods inherited from class jcckit.plot.AbstractSymbolFactory
createSymbol
-
Field Details
-
STACKED_KEY
Configuration parameter key.- See Also:
-
HORIZONTAL_BARS_KEY
Configuration parameter key.- See Also:
-
-
Constructor Details
-
BarFactory
Creates an instance from the specified configuration parameters.Key & Default Value Type Mandatory Description horizontalBars = false boolean no If true horizontal bars will be drawn. Otherwise vertical bars are drawn. stacked = false boolean no If true the bars of several curves will be stacked. AbstractSymbolFactory
apply.
-
-
Method Details
-
createSymbol
protected Symbol createSymbol(GraphPoint point, GraphicAttributes attributes, Hint hintForNextPoint, Hint hintFromPreviousCurve) Creates a bar at the specified point. If hintFromPreviousCurve is not an instance ofPositionHint
the values of origin and position will be (0,0).- Overrides:
createSymbol
in classAbstractSymbolFactory
- Parameters:
hintFromPreviousCurve
- Hint from previous curve. Will be used to calculate symbol shape and hint for the next curve.point
- Symbol position.attributes
- Symbol attributes.hintForNextPoint
- Hint for the next point. Will be delivered unchanged in the return Symbol object.
-
createLegendSymbol
Creates a symbol for the legend at the specified position.- Specified by:
createLegendSymbol
in interfaceSymbolFactory
- Overrides:
createLegendSymbol
in classAbstractSymbolFactory
- Parameters:
centerPosition
- Center position of the symbol.size
- The size of the symbol.
-
createPlainSymbol
protected GraphicalElement createPlainSymbol(GraphPoint centerPosition, double size, GraphicAttributes attributes) Returns null because this method isn't needed but has to be implemented.- Specified by:
createPlainSymbol
in classAbstractSymbolFactory
- Parameters:
centerPosition
- Center position of the symbol.size
- The size of the symbol.attributes
- The attributes of the symbol.
-