Package jcckit.plot
Class SimpleCurve
- java.lang.Object
-
- jcckit.plot.SimpleCurve
-
-
Field Summary
Fields Modifier and Type Field Description static StringINITIAL_HINT_FOR_NEXT_POINT_KEYConfiguration parameter key.static StringLINE_ATTRIBUTES_KEYConfiguration parameter key.static StringSOFT_CLIPPING_KEYConfiguration parameter key.static StringSYMBOL_FACTORY_KEYConfiguration parameter key.static StringWITH_LINE_KEYConfiguration parameter key.
-
Constructor Summary
Constructors Constructor Description SimpleCurve(ConfigParameters config, int curveIndex, int numberOfCurves, ClippingShape clippingShape, Legend legend)Creates a new curve.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HintaddPoint(GraphPoint point, Hint hintFromPreviousCurve)Appends a new point to the curve if inside the clipping shape.GraphicalElementgetLegendSymbol()Returns the legend symbol.GraphicalElementgetView()Returns the graphical representation of a curve.voidremoveAllPoints()Removes all points from the curve.
-
-
-
Field Detail
-
SYMBOL_FACTORY_KEY
public static final String SYMBOL_FACTORY_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
WITH_LINE_KEY
public static final String WITH_LINE_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
SOFT_CLIPPING_KEY
public static final String SOFT_CLIPPING_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
LINE_ATTRIBUTES_KEY
public static final String LINE_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
INITIAL_HINT_FOR_NEXT_POINT_KEY
public static final String INITIAL_HINT_FOR_NEXT_POINT_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleCurve
public SimpleCurve(ConfigParameters config, int curveIndex, int numberOfCurves, ClippingShape clippingShape, Legend legend)
Creates a new curve. The parameter config contains:Key & Default Value Type Mandatory Description initialHintForNextPoint = null ConfigParameters no Definition of an initial Hintfor the first curve point.lineAttributes = a ShapeAttributesinstances with default values and line colors based on the formula Color.getHSBColor(curveIndex/6,1,0.8)ConfigParameters no Configuration parameters of an instances of GraphicAttributesfor thePolygonsconnecting curve points.symbolFactory = null ConfigParameters no Configuration parameters defining an instances of SymbolFactoryfor theSymbolsdecorating curve points.softClipping = true boolean no If true no explicit clipping takes place but the symbol is not drawn if the corresponding curve point is outside the axis box.
If false the symbol is drawn in any case but it may be clipped by the axis box. Soft-clipping should be set to false if the symbols are not located around the curve point (like for bars).withLine = true boolean no If true curve points are connected by a Polygon.- Parameters:
config- Configuration parameters described above.curveIndex- Index of this curve in the collection of curves defining aPlot.numberOfCurves- Number of curves in this collection.clippingShape- Clipping shape. Can be null.legend- Legend. Will be used to calculate the legend symbol.- Throws:
IllegalArgumentException- if symbolFactory == null and withLine == false.
-
-
Method Detail
-
getView
public GraphicalElement getView()
Returns the graphical representation of a curve.
-
getLegendSymbol
public GraphicalElement getLegendSymbol()
Returns the legend symbol.- Specified by:
getLegendSymbolin interfaceCurve
-
addPoint
public Hint addPoint(GraphPoint point, Hint hintFromPreviousCurve)
Appends a new point to the curve if inside the clipping shape.- Specified by:
addPointin interfaceCurve- Parameters:
point- Position in device-independent coordinates.hintFromPreviousCurve- Hint which may be used to calculate the correspondingGraphicalElement.- Returns:
- hint for next curve.
-
removeAllPoints
public void removeAllPoints()
Description copied from interface:CurveRemoves all points from the curve.- Specified by:
removeAllPointsin interfaceCurve
-
-