All Packages Class Hierarchy This Package Previous Next Index
Class jclass.chart.JCAxis
java.lang.Object
|
+----jclass.chart.TrackChange
|
+----jclass.chart.ChartRegion
|
+----jclass.chart.JCAxis
- public class JCAxis
- extends ChartRegion
- implements JCSerializable
JCAxis controls all attributes relating to
rendering axes.
Properties
Name |
Method |
Font
|
The Font property determines what font is used to render text inside
the chart region. Note that the Font property is inherited from the
parent ChartCanvas.
|
Foreground
|
The Foreground property determines the foreground color used to draw
inside the chart region. Note that the Foreground property is inherited
from the parent ChartCanvas.
|
Background
|
The Background property determines the foreground color used to draw
inside the chart region. Note that the Background property is inherited
from the parent ChartCanvas.
|
Top
|
The Top property determines the location of the
top of the ChartRegion. The default value is calculated.
|
TopIsDefault
|
The TopIsDefault property determines whether the top
position of the chart region is calculated by Chart (true) or
taken from the Top property (false). Default value is true.
|
Left
|
The Left property determines the location of the
left of the ChartRegion. The default value is calculated.
|
LeftIsDefault
|
The LeftIsDefault property determines whether the left
position of the chart region is calculated by Chart (true) or
taken from the Left property (false). Default value is true.
|
Width
|
The Width property determines the width of the
ChartRegion. The default value is calculated.
|
WidthIsDefault
|
The WidthIsDefault property determines whether the width
of the chart region is calculated by Chart (true) or
taken from the Width property (false). Default value is true.
|
Height
|
The Height property determines the height of the
ChartRegion. The default value is calculated.
|
HeightIsDefault
|
The HeightIsDefault property determines whether the height
of the chart region is calculated by Chart (true) or
taken from the Height property (false). Default value is true.
|
BorderType
|
Determines the style of border drawn around the ChartRegion. Valid
values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN,
SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN,
SHADOW_FRAME_OUT. Default value is BWTEnum.SHADOW_IN.
|
BorderWidth
|
The BorderWidth property determines the width of the border drawn
around the region. Default value is 2.
|
Min
|
The Min property controls the minimum value shown on the axis. The Datamin is determined by JCChart.
|
MinIsDefault
|
The MinIsDefault property determines whether Chart is
responsible for calculating the minimum axis value. If true, Chart will
calculate the axis min. If false, Chart will use the provided axis min. Default value is true.
|
Max
|
The Max property controls the maximum value shown on the axis. The Datamax is determined by JCChart.
|
MaxIsDefault
|
The MaxIsDefault property determines whether Chart is
responsible for calculating the maximum axis value. If true, Chart
calculates the axis max. If false, Chart uses the provided axis max. Default value is true.
|
Origin
|
The Origin property controls location of the origin along the axis. The default value is calculated.
|
OriginIsDefault
|
The OriginIsDefault property determines whether Chart is
responsible for positioning the axis origin. If true, Chart
calculates the axis origin. If false, Chart uses the provided
axis origin value. Default value is true.
|
OriginPlacement
|
The OriginPlacement property specifies where the origin is placed.
Note that the OriginPlacement property is only active if the Origin
property has not been set. Valid values include AUTOMATIC
(places origin at minimum value or at zero if there are negative and
positive values), ZERO (places origin at zero),
MIN (places origin at minimum value on axis) or
MAX (places origin at maximum value on axis). Default value is AUTOMATIC.
|
OriginPlacementIsDefault
|
The OriginPlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis origin.
If true, Chart calculates the origin positioning. If false,
Chart uses the provided origin placement.
|
GridIsShowing
|
The GridIsShowing property determines whether a grid is drawn
for the axis. Default value is false.
|
GridSpacing
|
The GridSpacing property controls the spacing between grid lines
relative to the axis. Default value is 0.0.
|
GridSpacingIsDefault
|
The GridSpacingIsDefault property determines whether Chart is
responsible for calculating the grid spacing value. If true, Chart will
calculate the grid spacing. If false, Chart will use the provided grid
spacing. Default value is true.
|
GridStyle
|
The GridStyle property controls how grids are drawn. The default value is generated.
|
IsEditable
|
The IsEditable property determines whether the axis can
be affected by edit/translation/zooming. Default value is true.
|
IsLogarithmic
|
The IsLogarithmic property determines whether the axis will be
logarithmic (true) or linear (false). Default value is false.
|
Title
|
The Title property controls the appearance of the axis title.
|
IsReversed
|
The IsReversed property of JCAxis determines if the axis order is
reversed. Default value is false.
|
IsShowing
|
The IsShowing property determines whether the associated Axis
is currently visible. Default value is true.
|
Formula
|
The Formula property determines how an axis is related to another axis
object. If set, the Formula property overrides all other axis properties.
See JCAxisFormula for details.
|
AnnotationRotation
|
The AnnotationRotation property specifies the rotation of each axis
label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180,
JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE. Default value is JCAxis.ROTATE_NONE.
|
Placement
|
The Placement property determines the method used to place the axis.
Valid values include JCAxis.AUTOMATIC (Chart chooses an appropriate
location), JCAxis.ORIGIN (appears at the origin of another axis,
specified via the PlacementAxis property), JCAxis.MIN (appears at the
minimum axis value), JCAxis.MAX (appears at the maximum axis value) or
JCAxis.VALUE_ANCHORED (appears at a particular value along another axis,
specified via the PlacementAxis property). Default value is AUTOMATIC.
|
PlacementIsDefault
|
The PlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis.
If true, Chart calculates the axis positioning. If false,
Chart uses the provided axis placement.
|
PlacementAxis
|
The PlacementAxis property determines the axis that controls the
placement of this axis. In JCChart, it is possible to position an
axis at a particular position on another axis (in conjunction with the
PlacementLocation property or the Placement property). Default value is null.
|
PlacementLocation
|
The PlacementLocation property is used with the PlacementAxis
property to position the current axis object at a particular point
on another axis. Default value is 0.0.
|
AnnotationMethod
|
The AnnotationMethod property determines how axis annotations are
generated. Valid values include JCAxis.VALUE (axis annotations are
generated by chart, with possible callbacks to a label generator),
JCAxis.VALUE_LABELS (axis annotations are taken from a list of value
labels provided by the user. Note that a value label is a label that is
to appear at a particular value along the axis), JCAxis.POINT_LABELS
(axis annotations come from the data source in the form of point labels
ie labels associated with particular data points) and
JCAxis.TIME_LABELS (chart generates time/date/labels based on the
TimeUnit, TimeBase and TimeFormat properties). Default value is JCAxis.VALUE.
|
Precision
|
The Precision property controls the number of zeros that appear
after the decimal place in chart-generated axis labels. The default value is calculated.
|
PrecisionIsDefault
|
The PrecisionIsDefault determines whether Chart is responsible for
calculating the numbering precision. If true, Chart will calculate the
precision. If false, Chart will use the provided precision. Default value is true.
|
NumSpacing
|
The NumSpacing property controls the interval between axis labels. The default value is calculated.
|
NumSpacingIsDefault
|
The NumSpacingIsDefault property determines whether Chart is
responsible for calculating the numbering spacing. If true, Chart will
calculate the spacing. If false, Chart will use the provided numbering
spacing. Default value is true.
|
TickSpacing
|
The TickSpacing property controls the interval between tick lines
on the axis. Note: if the AnnotationMethod property is set to
POINT_LABELS, tick lines appear at point values. The default value is calculated.
|
TickSpacingIsDefault
|
The TickSpacingIsDefault property determines whether Chart is
responsible for calculating the tick spacing. If true, Chart will
calculate the tick spacing. If false, Chart will use the provided
tick spacing. Default value is true.
|
TimeUnit
|
The TimeUnit property controls the unit of time used for labelling
a time labelled axis. Valid TimeUnit values include JCAxis.SECONDS,
JCAxis.MINUTES, JCAxis.HOURS, JCAxis.DAYS, JCAxis.WEEKS, JCAxis.MONTHS
and JCAxis.YEARS. Default value is JCAxis.SECONDS.
|
TimeBase
|
The TimeBase property defines the start time for the axis. Default value is the current time.
|
TimeFormat
|
The TimeFormat property controls the format used to generate time
labels for time labelled axes. The formats supported are similar to
those supported by the C function strftime(). Default value is calculated based on TimeUnit.
|
TimeFormatIsDefault
|
The TimeFormatIsDefault property determines whether a time label
format is generated automatically, or the user value for TimeFormat is
used. Default value is true.
|
LabelGenerator
|
The LabelGenerator property holds a reference to an object that
implements the JCLabelGenerator interface. This interface is used to
externally generate labels if the AnnotationMethod property is set to
JCAxis.VALUE. Default value is null.
|
Gap
|
The Gap property determines the amount of space left between
adjacent axis annotations.
|
-
AUTOMATIC
-
-
DAYS
-
-
formula
-
-
HOURS
-
-
MAX
-
-
MIN
-
-
MINUTES
-
-
MONTHS
-
-
ORIGIN
-
-
POINT_LABELS
-
-
ROTATE_180
-
-
ROTATE_270
-
-
ROTATE_90
-
-
ROTATE_NONE
-
-
SECONDS
-
-
TIME_LABELS
-
-
title
-
-
VALUE
-
-
VALUE_ANCHORED
-
-
VALUE_LABELS
-
-
WEEKS
-
-
YEARS
-
-
ZERO
-
-
JCAxis()
- Default constructor
-
JCAxis(JCChartArea, boolean, int)
- Constructs a JCAxis object given the parent JCChartArea and a
boolean indicating whether the axis is vertical or horizontal.
-
addValueLabel(JCValueLabel)
- Adds the provided value label to the list of value labels.
-
adjustPlotRect()
- Adjusts the plot area of the parent ChartArea to account for
this axis.
-
dateToValue(Date)
-
-
draw(Graphics)
- Overrides ChartRegion.draw() to ensure that a border is not
drawn around the axis.
-
getAnnotationMethod()
- Gets the value of the AnnotationMethod property.
-
getAnnotationRotation()
- Gets the AnnotationRotation property of the JCAxis.
-
getFormula()
- Retrieves the JCAxisFormula object, which specifies a relationship
between this JCAxis object and another JCAxis object.
-
getGap()
- Gets the value of the Gap property.
-
getGridIsShowing()
- Gets the value of the GridIsShowing property.
-
getGridSpacing()
- Gets the GridSpacing property.
-
getGridSpacingIsDefault()
- Gets the GridSpacingIsDefault property of JCAxisBounds.
-
getGridStyle()
- Gets the GridStyle property.
-
getIsEditable()
- Gets the IsEditable property.
-
getIsLogarithmic()
- Gets the IsLogarithmic property of JCAxis, which determines
whether the axis will be logarithmic (true) or linear (false).
-
getIsReversed()
- Gets the IsReversed property of JCAxis, which determines if the
axis order is reversed.
-
getIsVertical()
- Gets the value of the IsVertical property.
-
getLabelGenerator()
- Gets the value of the LabelGenerator property.
-
getMax()
- Gets the Max property of the JCAxis, which controls the
maximum value shown on the axis.
-
getMaxIsDefault()
- Gets the MaxIsDefault property.
-
getMin()
- Gets the Min property of the JCAxis, which controls the
minimum value shown on the axis.
-
getMinIsDefault()
- Gets the MinIsDefault property.
-
getNumSpacing()
- Gets the NumSpacing property of the Axis, which controls
the interval between axis labels.
-
getNumSpacingIsDefault()
- Gets the NumSpacingIsDefault property of JCAxis.
-
getOrigin()
- Gets the Origin property of the Axis, which controls the
location of the origin along the axis.
-
getOriginIsDefault()
- Gets the OriginIsDefault property.
-
getOriginPlacement()
- Gets the OriginPlacement property of the JCAxis, which
specifies where the origin is placed.
-
getOriginPlacementIsDefault()
- Gets the OriginPlacementIsDefault property.
-
getPlacement()
- Gets the Placement property of the JCAxis, which
controls where the axis is placed.
-
getPlacementAxis()
- Gets the PlacementAxis property of the axis.
-
getPlacementIsDefault()
- Gets the PlacementIsDefault property.
-
getPlacementLocation()
- Gets the value of the PlacementLocation property.
-
getPrecision()
- Gets the Precision property of the Axis, which controls
the number of zeros that appear after the decimal place in
the axis label.
-
getPrecisionIsDefault()
- Gets the PrecisionIsDefault property of JCAxis.
-
getTickSpacing()
- Gets the TickSpacing property, which controls the interval
between tick lines on the axis.
-
getTickSpacingIsDefault()
- Gets the TickSpacingIsDefault property of JCAxis.
-
getTimeBase()
- Gets the value of the TimeBase property.
-
getTimeFormat()
- Gets the value of the TimeFormat property
The TimeFormat property controls the format used to
generate time labels for time labelled axes.
-
getTimeFormatIsDefault()
- Gets the value of the TimeFormatIsDefault property.
-
getTimeUnit()
- Gets the value of the TimeUnit property.
-
getTitle()
- Retrieves the JCAxisTitle object, which controls the
appearance of the axis title.
-
getValueLabel(double)
- Retrieves the value label for the specified value.
-
getValueLabels()
- Gets the value of the ValueLabels property.
-
getValueLabels(int)
-
-
recalc()
- Recalculates the axis parameters.
-
reshape(int, int, int, int)
- Overridden reshape() method that makes sure the scale and shift
values are recalculated when the axis size or position changes.
-
setAnnotationMethod(int)
- Sets the value of the AnnotationMethod property.
-
setAnnotationRotation(int)
- Sets the AnnotationRotation property of the JCAxis.
-
setGap(int)
- Sets the value of the Gap property.
-
setGridIsShowing(boolean)
- Sets the value of the GridIsShowing property.
-
setGridSpacing(double)
- Gets the GridSpacing property.
-
setGridSpacingIsDefault(boolean)
- Sets the GridSpacingIsDefault property of JCAxisBounds.
-
setGridStyle(JCChartStyle)
- Sets the GridStyle property.
-
setIsEditable(boolean)
- Sets the IsEditable property.
-
setIsLogarithmic(boolean)
- Sets the IsLogarithmic property of JCAxis, which determines
whether the axis will be logarithmic (true) or linear (false).
-
setIsReversed(boolean)
- Sets the IsReversed property of JCAxis, which determines if the
axis order is reversed.
-
setIsVertical(boolean)
- Sets the value of the IsVertical property.
-
setLabelGenerator(JCLabelGenerator)
- Sets the value of the LabelGenerator property.
-
setMax(double)
- Sets the Max property of the Axis, which controls the
maximum value shown on the axis.
-
setMaxIsDefault(boolean)
- Sets the MaxIsDefault property.
-
setMin(double)
- Sets the Min property of the JCAxis, which controls the
minimum value shown on the axis.
-
setMinIsDefault(boolean)
- Sets the MinIsDefault property.
-
setNumSpacing(double)
- Sets the NumSpacing property of the Axis, which controls
the interval between axis labels.
-
setNumSpacingIsDefault(boolean)
- Sets the NumSpacingIsDefault property of JCAxis.
-
setOrigin(double)
- Sets the Origin property of the Axis, which controls the
location of the origin along the axis.
-
setOriginIsDefault(boolean)
- Sets the OriginIsDefault property.
-
setOriginPlacement(int)
- Sets the OriginPlacement property of the JCAxis, which
specifies where the origin is placed.
-
setOriginPlacementIsDefault(boolean)
- Sets the OriginPlacementIsDefault property.
-
setParent(ChartCanvas)
- Connects the chart region to a ChartCanvas.
-
setPlacement(int)
- Sets the Placement property of the JCAxis, which
controls where the axis is placed.
-
setPlacement(JCAxis)
- Convenience method that sets the Placement property to
ORIGIN, and sets the PlacementAxis property to the
provided value
-
setPlacement(JCAxis, double)
- Convenience method that sets the Placement property to
VALUE_ANCHORED, the PlacementAxis property to the provided axis,
and the PlacementLocation property to the provided floating-
point value.
-
setPlacementAxis(JCAxis)
- Sets the PlacementAxis property of the axis.
-
setPlacementIsDefault(boolean)
- Sets the PlacementIsDefault property.
-
setPlacementLocation(double)
- Sets the value of the PlacementLocation property.
-
setPrecision(int)
- Sets the Precision property of the Axis, which controls
the number of zeros that appear after the decimal place in
the axis label.
-
setPrecisionIsDefault(boolean)
- Sets the PrecisionIsDefault property of JCAxis.
-
setTickSpacing(double)
- Sets the TickSpacing property, which controls the interval
between tick lines on the axis.
-
setTickSpacingIsDefault(boolean)
- Sets the TickSpacingIsDefault property of JCAxis.
-
setTimeBase(Date)
- Sets the value of the TimeBase property.
-
setTimeFormat(String)
- Sets the value of the TimeFormat property
The TimeFormat property controls the format used to
generate time labels for time labelled axes.
-
setTimeFormatIsDefault(boolean)
- Sets the value of the TimeFormatIsDefault property.
-
setTimeUnit(long)
- Sets the value of the TimeUnit property.
-
setTitle(JCAxisTitle)
- Sets the JCAxisTitle object associated with the JCAxis.
-
setValueLabels(int, JCValueLabel)
-
-
setValueLabels(JCValueLabel[])
- Sets the value of the ValueLabels property.
-
toData(int)
- Converts a pixel value relative to the parent JCChartArea to
a value in the data space.
-
toPixel(double)
- Converts a data value along the axis to a pixel value.
-
toString()
- String representation of the axis.
-
valueToDate(double)
-
title
protected JCAxisTitle title
formula
protected JCAxisFormula formula
SECONDS
public static final long SECONDS
MINUTES
public static final long MINUTES
HOURS
public static final long HOURS
DAYS
public static final long DAYS
WEEKS
public static final long WEEKS
MONTHS
public static final long MONTHS
YEARS
public static final long YEARS
AUTOMATIC
public static final int AUTOMATIC
MIN
public static final int MIN
MAX
public static final int MAX
ZERO
public static final int ZERO
VALUE_ANCHORED
public static final int VALUE_ANCHORED
ORIGIN
public static final int ORIGIN
VALUE
public static final int VALUE
VALUE_LABELS
public static final int VALUE_LABELS
TIME_LABELS
public static final int TIME_LABELS
POINT_LABELS
public static final int POINT_LABELS
ROTATE_NONE
public static final int ROTATE_NONE
ROTATE_90
public static final int ROTATE_90
ROTATE_180
public static final int ROTATE_180
ROTATE_270
public static final int ROTATE_270
JCAxis
public JCAxis(JCChartArea parent,
boolean vert,
int meth)
- Constructs a JCAxis object given the parent JCChartArea and a
boolean indicating whether the axis is vertical or horizontal.
- Parameters:
- parent - parent JCChartArea object. All axes must be attached
to a JCChartArea, as they are derived from ChartRegion.
- vert - if true, the axis is a vertical axis. Otherwise, the
axis is considered horizontal.
- type - Axis
JCAxis
public JCAxis()
- Default constructor
setParent
public void setParent(ChartCanvas p)
- Connects the chart region to a ChartCanvas.
- Overrides:
- setParent in class ChartRegion
getGridIsShowing
public boolean getGridIsShowing()
- Gets the value of the GridIsShowing property.
The GridIsShowing property determines whether a grid is drawn
for the axis.
- Returns:
- true if the grid should appear, false otherwise
setGridIsShowing
public void setGridIsShowing(boolean nis)
- Sets the value of the GridIsShowing property.
The GridIsShowing property determines whether a grid is drawn
for the axis.
- Returns:
- true if the grid should appear, false otherwise
getGridSpacing
public double getGridSpacing()
- Gets the GridSpacing property.
The GridSpacing property controls the spacing between grid
lines relative to the axis.
- Returns:
- floating-point number representing the axis
value spacing between grid lines. A value of 0.0 indicates that
grid lines will not be shown.
setGridSpacing
public synchronized void setGridSpacing(double space)
- Gets the GridSpacing property.
The GridSpacing property controls the spacing between grid
lines relative to the axis.
- Parameters:
- space - floating-point number representing the axis
value spacing between grid lines. A value of 0.0 indicates that
grid lines will not be shown.
setGridSpacingIsDefault
public synchronized void setGridSpacingIsDefault(boolean useDef)
- Sets the GridSpacingIsDefault property of JCAxisBounds.
The GridSpacingIsDefault property determines whether Chart is responsible
for calculating the grid spacing value. If true, Chart will
calculate the grid spacing. If false, Chart will use the provided
grid spacing.
- Parameters:
- useDef - true indicates that chart calculates the GridSpacing property.
If false, the GridSpacing property is already specified.
getGridSpacingIsDefault
public boolean getGridSpacingIsDefault()
- Gets the GridSpacingIsDefault property of JCAxisBounds.
The GridSpacingIsDefault property determines whether Chart is responsible
for calculating the grid spacing value. If true, Chart will
calculate the grid spacing. If false, Chart will use the provided
grid spacing.
- Returns:
- true indicates that chart calculates the GridSpacing property.
If false, the GridSpacing property is already specified.
getGridStyle
public JCChartStyle getGridStyle()
- Gets the GridStyle property.
The GridStyle property controls the appearance of the grid.
- Returns:
- JCChartStyle object that controls the grid's
appearance
setGridStyle
public synchronized void setGridStyle(JCChartStyle style)
- Sets the GridStyle property.
The GridStyle property controls the appearance of the grid.
- Parameters:
- style - JCChartStyle object that controls the grid's
appearance
setIsLogarithmic
public synchronized void setIsLogarithmic(boolean log)
- Sets the IsLogarithmic property of JCAxis, which determines
whether the axis will be logarithmic (true) or linear (false).
- Parameters:
- log - If true, the axis will be logarithmic (base 10).
Otherwise, the axis will be linear.
getIsLogarithmic
public boolean getIsLogarithmic()
- Gets the IsLogarithmic property of JCAxis, which determines
whether the axis will be logarithmic (true) or linear (false).
- Returns:
- if true, the axis will be logarithmic (base 10).
Otherwise, the axis will be linear.
setIsEditable
public synchronized void setIsEditable(boolean b)
- Sets the IsEditable property.
The IsEditable property determines whether the axis can
be affected by edit/translation/zooming.
- Parameters:
- b - if true, the axis can be affected by an edit, translation
or zoom action. If false, the axis is static.
getIsEditable
public boolean getIsEditable()
- Gets the IsEditable property.
The IsEditable property determines whether the axis can
be affected by edit/translation/zooming.
- Returns:
- if true, the axis can be affected by an edit, translation
or zoom action. If false, the axis is static.
setMin
public synchronized void setMin(double nmin)
- Sets the Min property of the JCAxis, which controls the
minimum value shown on the axis.
- Parameters:
- min - minimum value
getMin
public double getMin()
- Gets the Min property of the JCAxis, which controls the
minimum value shown on the axis.
- Returns:
- minimum value
setMinIsDefault
public synchronized void setMinIsDefault(boolean useDef)
- Sets the MinIsDefault property.
The MinIsDefault property determines whether Chart is responsible
for calculating the minimum axis value. If true, Chart will
calculate the axis min. If false, Chart will use the provided
axis min.
- Parameters:
- useDef - if true, Chart calculates the Min property. If
false, the Min property is already specified.
getMinIsDefault
public boolean getMinIsDefault()
- Gets the MinIsDefault property.
The MinIsDefault property determines whether Chart is responsible
for calculating the minimum axis value. If true, Chart will
calculate the axis min. If false, Chart will use the provided
axis min.
- Returns:
- true Chart calculates the Min property.
If false, the Min property is already specified.
setMax
public synchronized void setMax(double nmax)
- Sets the Max property of the Axis, which controls the
maximum value shown on the axis.
- Parameters:
- max - maximum value
getMax
public double getMax()
- Gets the Max property of the JCAxis, which controls the
maximum value shown on the axis.
- Returns:
- maximum value
setMaxIsDefault
public synchronized void setMaxIsDefault(boolean useDef)
- Sets the MaxIsDefault property.
The MaxIsDefault property determines whether Chart is responsible
for calculating the maximum axis value. If true, Chart
calculates the axis max. If false, Chart uses the provided
axis max.
- Parameters:
- useDef - if true, Chart calculates the Max property.
If false, the Max property is already specified.
getMaxIsDefault
public boolean getMaxIsDefault()
- Gets the MaxIsDefault property.
The MaxIsDefault property determines whether Chart is responsible
for calculating the maximum axis value. If true, Chart
calculates the axis max. If false, Chart uses the provided
axis max.
- Returns:
- true Chart calculates the Max property.
If false, the Max property is already specified.
setOrigin
public synchronized void setOrigin(double oval)
- Sets the Origin property of the Axis, which controls the
location of the origin along the axis.
- Parameters:
- oval - origin value
getOrigin
public double getOrigin()
- Gets the Origin property of the Axis, which controls the
location of the origin along the axis.
- Returns:
- origin value
setOriginIsDefault
public synchronized void setOriginIsDefault(boolean useDef)
- Sets the OriginIsDefault property.
The OriginIsDefault property determines whether Chart is responsible
for positioning the axis origin. If true, Chart
calculates the axis origin. If false, Chart uses the provided
axis origin value.
- Parameters:
- useDef - if true Chart calculates the Origin property.
If false, the Origin property is already specified.
getOriginIsDefault
public boolean getOriginIsDefault()
- Gets the OriginIsDefault property.
The OriginIsDefault property determines whether Chart is responsible
for positioning the axis origin. If true, Chart will
calculate the axis origin. If false, Chart will use the provided
axis origin value.
- Returns:
- true Chart calculates the Origin property.
If false, the Origin property is already specified.
setOriginPlacement
public synchronized void setOriginPlacement(int place)
- Sets the OriginPlacement property of the JCAxis, which
specifies where the origin is placed. Note that the OriginPlacement
property is only active if the Origin property has not been set.
- Parameters:
- place - one of AUTOMATIC (places origin at minimum value
or at zero if there are negative and positive values), ZERO (places
origin at zero), MIN (places origin at minimum value on axis) or
MAX (places origin at maximum value on axis)
- Throws: IllegalArgumentException
- If OriginPlacement isn't one of
AUTOMATIC, ZERO, MIN or MAX.
getOriginPlacement
public int getOriginPlacement()
- Gets the OriginPlacement property of the JCAxis, which
specifies where the origin is placed.
- Returns:
- one of AUTOMATIC (places origin at minimum value
or at zero if there are negative and positive values), ZERO (places
origin at zero), MIN (places origin at minimum value on axis) or
MAX (places origin at maximum value on axis)
setOriginPlacementIsDefault
public synchronized void setOriginPlacementIsDefault(boolean useDef)
- Sets the OriginPlacementIsDefault property.
The OriginPlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis origin.
If true, Chart calculates the origin positioning. If false,
Chart uses the provided origin placement.
- Parameters:
- useDef - if true, Chart calculates the OriginPlacement property.
If false, the OriginPlacement property is already specified.
getOriginPlacementIsDefault
public boolean getOriginPlacementIsDefault()
- Gets the OriginPlacementIsDefault property.
The OriginPlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis origin.
If true, Chart calculates the origin positioning. If false,
Chart uses the provided origin placement.
- Returns:
- true Chart calculates the OriginPlacement property.
If false, the OriginPlacement property is already specified.
getTitle
public JCAxisTitle getTitle()
- Retrieves the JCAxisTitle object, which controls the
appearance of the axis title.
- Returns:
- JCAxisTitle object
- See Also:
- JCAxisTitle
setTitle
public synchronized void setTitle(JCAxisTitle props)
- Sets the JCAxisTitle object associated with the JCAxis.
JCAxisTitle controls the appearance of the axis title.
This method is only accessible inside the chart package.
- Parameters:
- props - new JCAxisTitle object.
- See Also:
- JCAxisTitle
setIsReversed
public synchronized void setIsReversed(boolean rev)
- Sets the IsReversed property of JCAxis, which determines if the
axis order is reversed.
- Parameters:
- rev - true if the axis is reversed, false otherwise
getIsReversed
public boolean getIsReversed()
- Gets the IsReversed property of JCAxis, which determines if the
axis order is reversed.
- Returns:
- true if the axis is reversed, false otherwise
getFormula
public JCAxisFormula getFormula()
- Retrieves the JCAxisFormula object, which specifies a relationship
between this JCAxis object and another JCAxis object.
- Returns:
- JCAxisFormula object
- See Also:
- JCAxisFormula
setAnnotationRotation
public synchronized void setAnnotationRotation(int rot)
- Sets the AnnotationRotation property of the JCAxis.
The AnnotationRotation property specifies the rotation of each axis
label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180,
JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE
- Parameters:
- rot - one of ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_NONE
- Throws: IllegalArgumentException
- If the provided rotation value is
not part of the ROTATE_ enum.
getAnnotationRotation
public int getAnnotationRotation()
- Gets the AnnotationRotation property of the JCAxis.
The AnnotationRotation property specifies the rotation of each axis
label. Valid values are JCAxis.ROTATE_90, JCAxis.ROTATE_180,
JCAxis.ROTATE_270 or JCAxis.ROTATE_NONE.
- Returns:
- one of ROTATE_90, ROTATE_180, ROTATE_270 or ROTATE_NONE
setPlacement
public synchronized void setPlacement(int place)
- Sets the Placement property of the JCAxis, which
controls where the axis is placed.
- Parameters:
- place - one of AUTOMATIC (Chart chooses an appropriate
location), ORIGIN (appears at the origin value), MIN (appears at
the minimum axis value), MAX (appears at the maximum axis
value) or VALUE_ANCHORED (appears at a particular value along another axis.
Note that x axis labels, for example, will be placed at
either the y axis origin, y axis max or y
axis min value.
- Throws: IllegalArgumentException
- If the Placement value is not one
of AUTOMATIC, ORIGIN, MIN, MAX or VALUE_ANCHORED.
setPlacement
public synchronized void setPlacement(JCAxis ax)
- Convenience method that sets the Placement property to
ORIGIN, and sets the PlacementAxis property to the
provided value
- Parameters:
- ax - new value for PlacementAxis.
setPlacement
public synchronized void setPlacement(JCAxis ax,
double v)
- Convenience method that sets the Placement property to
VALUE_ANCHORED, the PlacementAxis property to the provided axis,
and the PlacementLocation property to the provided floating-
point value.
- Parameters:
- ax - new value for PlacementAxis
- v - new value for PlacementLocation
getPlacement
public int getPlacement()
- Gets the Placement property of the JCAxis, which
controls where the axis is placed.
- Returns:
- one of AUTOMATIC (Chart chooses an appropriate
location), ORIGIN (appears at the origin value), MIN (Appears at
the minimum axis value) and MAX (appears at the maximum axis
value). Note that x axis labels, for example, will be placed at
either the y axis origin, y axis max or y axis min value.
setPlacementIsDefault
public synchronized void setPlacementIsDefault(boolean useDef)
- Sets the PlacementIsDefault property.
The PlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis.
If true, Chart calculates the origin positioning. If false,
Chart uses the provided axus placement.
- Parameters:
- useDef - if true, Chart calculates the Placement property.
If false, the Placement property is already specified.
getPlacementIsDefault
public boolean getPlacementIsDefault()
- Gets the PlacementIsDefault property.
The PlacementIsDefault property determines whether Chart
is responsible for determining the location of the axis.
If true, Chart calculates the axis positioning. If false,
Chart uses the provided placement.
- Returns:
- true Chart calculates the Placement property.
If false, the Placement property is already specified.
setPlacementAxis
public synchronized void setPlacementAxis(JCAxis ax)
- Sets the PlacementAxis property of the axis. The PlacementAxis
property determines the axis that controls the placement of
this axis. In JCChart, it is possible to position an axis
at a particular position on another axis (in conjunction with
the PlacementLocation property or the Placement property).
- Parameters:
- ax - axis to be used to position this axis.
getPlacementAxis
public JCAxis getPlacementAxis()
- Gets the PlacementAxis property of the axis. The PlacementAxis
property determines the axis that controls the placement of
this axis. In JCChart, it is possible to position an axis
at a particular position on another axis (in conjunction with
the PlacementLocation property or the Placement property).
- Returns:
- axis to be used to position this axis.
setPlacementLocation
public synchronized void setPlacementLocation(double v)
- Sets the value of the PlacementLocation property. The
PlacementLocation property is used with the PlacementAxis
property to position the current axis object at a particular
point on another axis.
- Parameters:
- v - Floating-point data value on PlacementAxis at which to
place the current axis.
getPlacementLocation
public double getPlacementLocation()
- Gets the value of the PlacementLocation property. The
PlacementLocation property is used with the PlacementAxis
property to position the current axis object at a particular
point on another axis.
- Returns:
- Floating-point data value on PlacementAxis at which to
place the current axis.
setAnnotationMethod
public synchronized void setAnnotationMethod(int newMethod)
- Sets the value of the AnnotationMethod property. The
AnnotationMethod property determines how axis annotations
are generated.
- Parameters:
- newMethod - one of VALUE, VALUE_LABELS,
TIME_LABELS or POINT_LABELS
- Throws: IllegalArgumentException
- If the AnnotationMethod value
is not one of VALUE, VALUE_LABELS, TIME_LABELS or
POINT_LABELS.
getAnnotationMethod
public int getAnnotationMethod()
- Gets the value of the AnnotationMethod property. The
AnnotationMethod property determines how axis annotations
are generated.
- Returns:
- One of VALUE, VALUE_LABELS,
TIME_LABELS or POINT_LABELS
setPrecision
public synchronized void setPrecision(int prec)
- Sets the Precision property of the Axis, which controls
the number of zeros that appear after the decimal place in
the axis label.
- Parameters:
- prec - number of zeros after the decimal place. If negative,
it specifies the number of zeros that appear before the decimal place.
getPrecision
public int getPrecision()
- Gets the Precision property of the Axis, which controls
the number of zeros that appear after the decimal place in
the axis label.
- Returns:
- number of zeros after the decimal place. If negative,
specifies the number of zeros that appear before the decimal place.
setPrecisionIsDefault
public synchronized void setPrecisionIsDefault(boolean useDef)
- Sets the PrecisionIsDefault property of JCAxis. The
PrecisionIsDefault determines whether Chart is responsible
for calculating the numbering precision. If true, Chart will
calculate the precision. If false, Chart will use the provided
precision.
- Parameters:
- useDef - true tells Chart to calculate the Precision property,
whereas false means that the Precision property is already specified
getPrecisionIsDefault
public boolean getPrecisionIsDefault()
- Gets the PrecisionIsDefault property of JCAxis. The
PrecisionIsDefault determines whether Chart is responsible
for calculating the numbering precision. If true, Chart will
calculate the precision. If false, Chart will use the provided
precision.
- Returns:
- true tells Chart to calculate the Precision property,
whereas false means that the Precision property is already specified
setNumSpacing
public synchronized void setNumSpacing(double inc)
- Sets the NumSpacing property of the Axis, which controls
the interval between axis labels.
- Parameters:
- inc - interval between axis labels
getNumSpacing
public double getNumSpacing()
- Gets the NumSpacing property of the Axis, which controls
the interval between axis labels.
- Returns:
- interval between axis labels
setNumSpacingIsDefault
public synchronized void setNumSpacingIsDefault(boolean useDef)
- Sets the NumSpacingIsDefault property of JCAxis. The
NumSpacingIsDefault determines whether Chart is responsible
for calculating the numbering spacing. If true, Chart will
calculate the spacing. If false, Chart will use the provided
numbering spacing.
- Parameters:
- useDef - true tells Chart to calculate the NumSpacing property,
whereas false means the NumSpacing property is already specified
getNumSpacingIsDefault
public boolean getNumSpacingIsDefault()
- Gets the NumSpacingIsDefault property of JCAxis. The
NumSpacingIsDefault determines whether Chart is responsible
for calculating the numbering spacing. If true, Chart will
calculate the spacing. If false, Chart will use the provided
numbering spacing.
- Returns:
- true tells Chart to calculate the NumSpacing property,
whereas false means the NumSpacing property is already specified
getTickSpacing
public double getTickSpacing()
- Gets the TickSpacing property, which controls the interval
between tick lines on the axis. Note: if the
AnnotationMethod property is set to POINT_LABELS, tick
lines appear at point values.
- Returns:
- interval between ticks
setTickSpacing
public synchronized void setTickSpacing(double tick)
- Sets the TickSpacing property, which controls the interval
between tick lines on the axis.
- Parameters:
- tick - interval between ticks
setTickSpacingIsDefault
public synchronized void setTickSpacingIsDefault(boolean useDef)
- Sets the TickSpacingIsDefault property of JCAxis. The
TickSpacingIsDefault determines whether Chart is responsible
for calculating the tick spacing. If true, Chart will
calculate the tick spacing. If false, Chart will use the provided
tick spacing.
- Parameters:
- useDef - true tells Chart to calculate the TickSpacing property,
whereas false means that the TickSpacing property is already specified
getTickSpacingIsDefault
public boolean getTickSpacingIsDefault()
- Gets the TickSpacingIsDefault property of JCAxis. The
TickSpacingIsDefault determines whether Chart is responsible
for calculating the tick spacing. If true, Chart will
calculate the tick spacing. If false, Chart will use the provided
tick spacing.
- Returns:
- true tells Chart to calculate the TickSpacing property,
whereas false means that the TickSpacing property is already specified
setLabelGenerator
public synchronized void setLabelGenerator(JCLabelGenerator lg)
- Sets the value of the LabelGenerator property. The LabelGenerator
property holds a reference to an object that implements the
JCLabelGenerator interface. This interface is used to externally
generate labels.
- Parameters:
- lg - reference to object instance used to generate labels.
getLabelGenerator
public JCLabelGenerator getLabelGenerator()
- Gets the value of the LabelGenerator property. The LabelGenerator
property holds a reference to an object that implements the
JCLabelGenerator interface. This interface is used to externally
generate labels.
- Returns:
- reference to object instance used to generate labels.
setTimeUnit
public synchronized void setTimeUnit(long tu)
- Sets the value of the TimeUnit property.
The TimeUnit property controls the unit of time
used for labelling a time labelled axis.
- Parameters:
- tu - Unit of time; one of SECONDS, MINUTES,
HOURS, DAYS, WEEKS, MONTHS or YEARS.
getTimeUnit
public long getTimeUnit()
- Gets the value of the TimeUnit property.
The TimeUnit property controls the unit of time
used for labelling a time labelled axis.
- Returns:
- Unit of time; one of SECONDS, MINUTES,
HOURS, DAYS, WEEKS, MONTHS or YEARS.
setTimeBase
public synchronized void setTimeBase(Date nb)
- Sets the value of the TimeBase property.
The TimeBase property defines the start time for the
axis.
- Parameters:
- nb - Date object representing the start time for the
axis.
getTimeBase
public Date getTimeBase()
- Gets the value of the TimeBase property.
The TimeBase property defines the start time for the
axis.
- Returns:
- Date object representing the start time for the
axis.
setTimeFormat
public synchronized void setTimeFormat(String tf)
- Sets the value of the TimeFormat property
The TimeFormat property controls the format used to
generate time labels for time labelled axes.
- Parameters:
- tf - format string for time labels.
getTimeFormat
public String getTimeFormat()
- Gets the value of the TimeFormat property
The TimeFormat property controls the format used to
generate time labels for time labelled axes.
- Returns:
- format string for time labels.
setTimeFormatIsDefault
public synchronized void setTimeFormatIsDefault(boolean ud)
- Sets the value of the TimeFormatIsDefault property.
The TimeFormatIsDefault property determines whether
a time label format is generated automatically, or the
user value for TimeFormat is used.
- Parameters:
- ud - true if a default will be generated, false if
the user value will be used.
getTimeFormatIsDefault
public boolean getTimeFormatIsDefault()
- Gets the value of the TimeFormatIsDefault property.
The TimeFormatIsDefault property determines whether
a time label format is generated automatically, or the
user value for TimeFormat is used.
- Returns:
- true if a default will be generated, false if
the user value will be used.
setIsVertical
public synchronized void setIsVertical(boolean v)
- Sets the value of the IsVertical property. The IsVertical
property determines whether the axis is vertically oriented
or horizontally oriented.
- Parameters:
- v - If true, the axis is vertical. Otherwise, it is horizontal.
getIsVertical
public boolean getIsVertical()
- Gets the value of the IsVertical property. The IsVertical
property determines whether the axis is vertically oriented
or horizontally oriented.
- Returns:
- If true, the axis is vertical. Otherwise, it is horizontal.
setGap
public synchronized void setGap(int gp)
- Sets the value of the Gap property.
The Gap property determines the amount of space left between
adjacent axis annotations.
- Parameters:
- gp - Space between labels. Must be >= 0
getGap
public int getGap()
- Gets the value of the Gap property.
The Gap property determines the amount of space left between
adjacent axis annotations.
- Returns:
- Space between labels. Must be >= 0
getValueLabel
public JCValueLabel getValueLabel(double val)
- Retrieves the value label for the specified value. Note
that floating point does not allow an exact match, so the
closest value within a specified error is found
- Parameters:
- val - data value for which to find the value label
- Returns:
- JCValueLabel instance
addValueLabel
public void addValueLabel(JCValueLabel vl)
- Adds the provided value label to the list of value labels.
If the AnnotationMethod is VALUE_LABELS, then the value
label will appear at the appropriate point along the axis.
- Parameters:
- vl - JCValueLabel instance to add
toPixel
public int toPixel(double v)
- Converts a data value along the axis to a pixel value. The
pixel value is valid inside the parent JCChartArea.
- Parameters:
- v - data value to convert to a screen location
- Returns:
- screen location in pixels
toData
public double toData(int v)
- Converts a pixel value relative to the parent JCChartArea to
a value in the data space. In effect, this routine performs
mapping along a particular axis.
- Parameters:
- v - screen value (in pixels) to convert to a data value. Must
be relative to the plot area.
- Returns:
- data value corresponding to the screen location
getValueLabels
public JCValueLabel[] getValueLabels()
- Gets the value of the ValueLabels property.
The ValueLabels property is an indexed property containing
a list of all annotations for an axis.
setValueLabels
public void setValueLabels(JCValueLabel vl[])
- Sets the value of the ValueLabels property.
The ValueLabels property is an indexed property containing
a list of all annotations for an axis.
getValueLabels
public JCValueLabel getValueLabels(int indx)
setValueLabels
public synchronized void setValueLabels(int index,
JCValueLabel vl)
toString
public String toString()
- String representation of the axis. Used by
jclass.beans.IndexedPropertyEditor to name the
axis.
- Overrides:
- toString in class Object
draw
public void draw(Graphics gc)
- Overrides ChartRegion.draw() to ensure that a border is not
drawn around the axis.
- Overrides:
- draw in class ChartRegion
reshape
public void reshape(int newx,
int newy,
int neww,
int newh)
- Overridden reshape() method that makes sure the scale and shift
values are recalculated when the axis size or position changes.
- Overrides:
- reshape in class ChartRegion
recalc
public void recalc()
- Recalculates the axis parameters. This method is just a placeholder
for now, since axis recalculation is distributed inside recalc()
for JCChartArea.
- Overrides:
- recalc in class ChartRegion
dateToValue
public double dateToValue(Date d)
valueToDate
public Date valueToDate(double v)
adjustPlotRect
protected void adjustPlotRect()
- Adjusts the plot area of the parent ChartArea to account for
this axis. Takes the axis placement into account.
All Packages Class Hierarchy This Package Previous Next Index