public class BarFactory extends AbstractSymbolFactory
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.SimpleCurve(ConfigParameters, int, int, ClippingShape, Legend)
).
Modifier and Type | Field and Description |
---|---|
static String |
HORIZONTAL_BARS_KEY
Configuration parameter key.
|
static String |
STACKED_KEY
Configuration parameter key.
|
_attributes, _size
ATTRIBUTES_KEY, DEFAULT_SIZE, SIZE_KEY
Constructor and Description |
---|
BarFactory(ConfigParameters config)
Creates an instance from the specified configuration parameters.
|
Modifier and Type | Method and Description |
---|---|
GraphicalElement |
createLegendSymbol(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.
|
createSymbol
public static final String STACKED_KEY
public static final String HORIZONTAL_BARS_KEY
public BarFactory(ConfigParameters config)
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.protected Symbol createSymbol(GraphPoint point, GraphicAttributes attributes, Hint hintForNextPoint, Hint hintFromPreviousCurve)
PositionHint
the values of
origin and position will be (0,0).createSymbol
in class AbstractSymbolFactory
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.public GraphicalElement createLegendSymbol(GraphPoint centerPosition, double size)
createLegendSymbol
in interface SymbolFactory
createLegendSymbol
in class AbstractSymbolFactory
centerPosition
- Center position of the symbol.size
- The size of the symbol.protected GraphicalElement createPlainSymbol(GraphPoint centerPosition, double size, GraphicAttributes attributes)
createPlainSymbol
in class AbstractSymbolFactory
centerPosition
- Center position of the symbol.size
- The size of the symbol.attributes
- The attributes of the symbol.Copyright © 2014. All Rights Reserved.