Class AxisParameters
- java.lang.Object
-
- jcckit.plot.AxisParameters
-
public class AxisParameters extends Object
Helper class with various parameters defining an axis. This helper class is used byCartesianCoordinateSystem
to set up a coordinate systems.This class holds more than a dozen parameters. There are two factory methods creating instances for x- and y-axis based on
ConfigParameters
. They differ in their default parameters for those axes.Note, that there is a direct access of these parameters without getters and setters but only for classes in the package jcckit.plot.
- Author:
- Franz-Josef Elmer
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUTOMATIC_TIC_CALCULATION_KEY
Configuration parameter key.static String
AXIS_ATTRIBUTES_KEY
Configuration parameter key.static String
AXIS_LABEL_ATTRIBUTES_KEY
Configuration parameter key.static String
AXIS_LABEL_KEY
Configuration parameter key.static String
AXIS_LABEL_POSITION_KEY
Configuration parameter key.static String
AXIS_LENGTH_KEY
Configuration parameter key.static String
GRID_ATTRIBUTES_KEY
Configuration parameter key.static String
GRID_KEY
Configuration parameter key.static String
LOG_SCALE_KEY
Configuration parameter key.static String
MAXIMUM_KEY
Configuration parameter key.static String
MAXIMUM_TIC_KEY
Configuration parameter key.static String
MINIMUM_KEY
Configuration parameter key.static String
MINIMUM_TIC_KEY
Configuration parameter key.static String
NUMBER_OF_TICS_KEY
Configuration parameter key.static String
TIC_ATTRIBUTES_KEY
Configuration parameter key.static String
TIC_LABEL_ATTRIBUTES_KEY
Configuration parameter key.static String
TIC_LABEL_FORMAT_KEY
Configuration parameter key.static String
TIC_LABEL_POSITION_KEY
Configuration parameter key.static String
TIC_LENGTH_KEY
Configuration parameter key.
-
Constructor Summary
Constructors Constructor Description AxisParameters()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AxisParameters
createXAxis(ConfigParameters config)
Creates an x axis based on the specified configuration parameters.static AxisParameters
createYAxis(ConfigParameters config)
Creates an y axis based on the specified configuration parameters.
-
-
-
Field Detail
-
LOG_SCALE_KEY
public static final String LOG_SCALE_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
MINIMUM_KEY
public static final String MINIMUM_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
MAXIMUM_KEY
public static final String MAXIMUM_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AXIS_LENGTH_KEY
public static final String AXIS_LENGTH_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AXIS_ATTRIBUTES_KEY
public static final String AXIS_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AXIS_LABEL_KEY
public static final String AXIS_LABEL_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AXIS_LABEL_POSITION_KEY
public static final String AXIS_LABEL_POSITION_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AXIS_LABEL_ATTRIBUTES_KEY
public static final String AXIS_LABEL_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
AUTOMATIC_TIC_CALCULATION_KEY
public static final String AUTOMATIC_TIC_CALCULATION_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
MINIMUM_TIC_KEY
public static final String MINIMUM_TIC_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
MAXIMUM_TIC_KEY
public static final String MAXIMUM_TIC_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
NUMBER_OF_TICS_KEY
public static final String NUMBER_OF_TICS_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
TIC_LENGTH_KEY
public static final String TIC_LENGTH_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
TIC_ATTRIBUTES_KEY
public static final String TIC_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
TIC_LABEL_FORMAT_KEY
public static final String TIC_LABEL_FORMAT_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
TIC_LABEL_POSITION_KEY
public static final String TIC_LABEL_POSITION_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
TIC_LABEL_ATTRIBUTES_KEY
public static final String TIC_LABEL_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
GRID_KEY
public static final String GRID_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
GRID_ATTRIBUTES_KEY
public static final String GRID_ATTRIBUTES_KEY
Configuration parameter key.- See Also:
- Constant Field Values
-
-
Method Detail
-
createXAxis
public static AxisParameters createXAxis(ConfigParameters config)
Creates an x axis based on the specified configuration parameters. All numbers (lengths, fontsizes, linethicknesses, etc.) are in device-independent units.Key & Default Value Type Mandatory Description automaticTicCalculation = true boolean no Has to be true if the tics should be calculated automatically. axisAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the axis box. axisLabel = x String no Axis label. axisLabelAttributes = default values of BasicGraphicAttributes
with a text anchor CENTER TOP.ConfigParameters no Text attributes of axis label. axisLabelPosition = 0 -0.05 double[] no Position of the anchor of the axis label relative to the center of the x-axis line. axisLength = 0.8 double no Length of the x-axis. grid = false boolean no If true grid lines will be drawn through the axis tics. gridAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the grid lines. logScale = false boolean no If true the axis will be logarithmic. Otherwise the axis is linear. maximum = 1 double no The corresponding data value of one end of the axis. maximumTic = result from automatic calculation double no The corresponding data value of the tic nearest the maximum end of the axis. minimum = 0 double no The corresponding data value of one end of the axis. minimumTic = result from automatic calculation double no The corresponding data value of the tic nearest the minimum end of the axis. numberOfTics = result from automatic calculation int no Number of tics. The tics between the minimum and maximum tic are spaced equidistantly. ticAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the tics. ticLabelAttributes = default values of BasicGraphicAttributes
with a text anchor CENTER TOP.ConfigParameters no Text attributes of tic labels. ticLabelFormat = %1.1f String or ConfigParameters no Defines rendering of the tic label. By default a printf-like format string is given (see Format
). Note, that an empty string means that tic labels are dropped.For non-numerical rendering an implementation of a
TicLabelFormat
can be specified (e.g.TicLabelMap
). Note, that a configuration sub tree with a className key-value pair overwrites any string definition.ticLabelPosition = 0 -0.01 double[] no Position of the anchor of the tic label relative to the tic position on the axis. ticLength = 0.01 double no Length of the tics. Negative/positive values mean tics inside/outside the box.
-
createYAxis
public static AxisParameters createYAxis(ConfigParameters config)
Creates an y axis based on the specified configuration parameters. All numbers (lengths, fontsizes, linethicknesses, etc.) are in device-independent units.Key & Default Value Type Mandatory Description automaticTicCalculation = true boolean no Has to be true if the tics should be calculated automatically. axisAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the axis box. axisLabel = y String no Axis label. axisLabelAttributes = default values of BasicGraphicAttributes
with a text anchor CENTER BOTTOM and the text rotated by 90 degree.ConfigParameters no Text attributes of axis label. axisLabelPosition = -0.1 0 double[] no Position of the anchor of the axis label relative to the center of the y-axis line. axisLength = 0.45 double no Length of the y-axis. grid = false boolean no If true grid lines will be drawn through the axis tics. gridAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the grid lines. logScale = false boolean no If true the axis will be logarithmic. Otherwise the axis is linear. maximum = 1 double no The corresponding data value of one end of the axis. maximumTic = result from automatic calculation double no The corresponding data value of the tic nearest the maximum end of the axis. minimum = 0 double no The corresponding data value of one end of the axis. minimumTic = result from automatic calculation double no The corresponding data value of the tic nearest the minimum end of the axis. numberOfTics = result from automatic calculation int no Number of tics. The tics between the minimum and maximum tic are spaced equidistantly. ticAttributes = default values of ShapeAttributes
ConfigParameters no Attributes of the tics. ticLabelAttributes = default values of BasicGraphicAttributes
with a text anchor RIGHT CENTER.ConfigParameters no Text attributes of tic labels. ticLabelFormat = %1.1f String no Defines rendering of the tic label. By default a printf-like format string is given (see Format
). Note, that an empty string means that tic labels are dropped.For non-numerical rendering an implementation of a
TicLabelFormat
can be specified (e.g.TicLabelMap
). Note, that a configuration sub tree with a className key-value pair overwrites any string definition.ticLabelPosition = -0.01 0 double[] no Position of the anchor of the tic label relative to the tic position on the axis. ticLength = 0.01 double no Length of the tics. Negative/positive values mean tics inside/outside the box.
-
-