Package jcckit.plot
Class AbstractSymbolFactory
java.lang.Object
jcckit.plot.AbstractSymbolFactory
- All Implemented Interfaces:
SymbolFactory
- Direct Known Subclasses:
BarFactory
,CircleSymbolFactory
,SquareSymbolFactory
Abstract superclass of all
SymbolFactories
.
Subclasses have to implement createPlainSymbol()
.-
Field Summary
Modifier and TypeFieldDescriptionprotected final GraphicAttributes
Attributes of all symbols.protected final double
Size of all symbols.Fields inherited from interface jcckit.plot.SymbolFactory
ATTRIBUTES_KEY, DEFAULT_SIZE, SIZE_KEY
-
Constructor Summary
ConstructorDescriptionCreates 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 abstract GraphicalElement
createPlainSymbol
(GraphPoint centerPosition, double size, GraphicAttributes attributes) Creates the graphical element of the plain symbol.protected Symbol
createSymbol
(GraphPoint point, GraphicAttributes attributes, Hint hintForNextPoint, Hint hintFromPreviousCurve) Creates a symbol.createSymbol
(GraphPoint point, Hint hintFromPreviousPoint, Hint hintFromPreviousCurve) Creates a symbol.
-
Field Details
-
_size
protected final double _sizeSize of all symbols. -
_attributes
Attributes of all symbols.
-
-
Constructor Details
-
AbstractSymbolFactory
Creates an instance from the specified configuration parameters.Key & Default Value Type Mandatory Description size = 0.01 double no Size of the symbol in device-independent units. attributes ConfigParameters no Configuration parameters for the attributes of the symbol. className has to be a class which is an instance of GraphicAttributes
.
-
-
Method Details
-
createSymbol
public Symbol createSymbol(GraphPoint point, Hint hintFromPreviousPoint, Hint hintFromPreviousCurve) Creates a symbol. Evaluate hintFromPreviousPoint if it is aAttributesHint
. CallscreateSymbol(GraphPoint, GraphicAttributes, Hint, Hint)
.- Specified by:
createSymbol
in interfaceSymbolFactory
- Parameters:
point
- Symbol position.hintFromPreviousPoint
- Hint from the previous point.hintFromPreviousCurve
- Hint from the previous curve.
-
createSymbol
protected Symbol createSymbol(GraphPoint point, GraphicAttributes attributes, Hint hintForNextPoint, Hint hintFromPreviousCurve) Creates a symbol. UsescreatePlainSymbol()
.- Parameters:
point
- Symbol position.attributes
- Symbol attributes.hintForNextPoint
- Hint for the next point. Will be delivered unchanged in the return Symbol object.hintFromPreviousCurve
- Hint from the previous curve. Will be delivered unchanged in the return Symbol object. Subclasses may override this behavior.
-
createLegendSymbol
Creates a symbol for the legend at the specified position. UsescreatePlainSymbol()
- Specified by:
createLegendSymbol
in interfaceSymbolFactory
- Parameters:
centerPosition
- Center position of the symbol.size
- The size of the symbol. Will be ignored because the value given in the constructor will be used.
-
createPlainSymbol
protected abstract GraphicalElement createPlainSymbol(GraphPoint centerPosition, double size, GraphicAttributes attributes) Creates the graphical element of the plain symbol.- Parameters:
centerPosition
- Center position of the symbol.size
- The size of the symbol.attributes
- The attributes of the symbol.
-