public abstract class ValueAxis extends Axis implements Cloneable, org.jfree.util.PublicCloneable, Serializable
double
primitive. The two key subclasses are
DateAxis
and NumberAxis
.Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_AUTO_RANGE
The default auto-range value.
|
static double |
DEFAULT_AUTO_RANGE_MINIMUM_SIZE
The default minimum auto range.
|
static boolean |
DEFAULT_AUTO_TICK_UNIT_SELECTION
The default auto-tick-unit-selection value.
|
static boolean |
DEFAULT_INVERTED
The default inverted flag setting.
|
static double |
DEFAULT_LOWER_BOUND
Deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see
getDefaultAutoRange() ). |
static double |
DEFAULT_LOWER_MARGIN
The default value for the lower margin (0.05 = 5%).
|
static Range |
DEFAULT_RANGE
The default axis range.
|
static double |
DEFAULT_UPPER_BOUND
Deprecated.
From 1.0.5 onwards, the axis defines a defaultRange
attribute (see
getDefaultAutoRange() ). |
static double |
DEFAULT_UPPER_MARGIN
The default value for the upper margin (0.05 = 5%).
|
static int |
MAXIMUM_TICK_COUNT
The maximum tick count.
|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_LINE_PAINT, DEFAULT_AXIS_LINE_STROKE, DEFAULT_AXIS_VISIBLE, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABELS_VISIBLE, DEFAULT_TICK_MARK_INSIDE_LENGTH, DEFAULT_TICK_MARK_OUTSIDE_LENGTH, DEFAULT_TICK_MARK_PAINT, DEFAULT_TICK_MARK_STROKE, DEFAULT_TICK_MARKS_VISIBLE
Modifier and Type | Method and Description |
---|---|
void |
centerRange(double value)
Centers the axis range about the specified value and sends an
AxisChangeEvent to all registered listeners. |
Object |
clone()
Returns a clone of the object.
|
boolean |
equals(Object obj)
Tests the axis for equality with an arbitrary object.
|
double |
getAutoRangeMinimumSize()
Returns the minimum size allowed for the axis range when it is
automatically calculated.
|
Range |
getDefaultAutoRange()
Returns the default auto range.
|
Shape |
getDownArrow()
Returns a shape that can be displayed as an arrow pointing downwards at
the end of an axis line.
|
double |
getFixedAutoRange()
Returns the fixed auto range.
|
Shape |
getLeftArrow()
Returns a shape that can be displayed as an arrow pointing left at the
end of an axis line.
|
double |
getLowerBound()
Returns the lower bound of the axis range.
|
double |
getLowerMargin()
Returns the lower margin for the axis, expressed as a percentage of the
axis range.
|
int |
getMinorTickCount()
Returns the number of minor tick marks to display.
|
Range |
getRange()
Returns the range for the axis.
|
Shape |
getRightArrow()
Returns a shape that can be displayed as an arrow pointing right at the
end of an axis line.
|
TickUnitSource |
getStandardTickUnits()
Returns the source for obtaining standard tick units for the axis.
|
Shape |
getUpArrow()
Returns a shape that can be displayed as an arrow pointing upwards at
the end of an axis line.
|
double |
getUpperBound()
Returns the upper bound for the axis range.
|
double |
getUpperMargin()
Returns the upper margin for the axis, expressed as a percentage of the
axis range.
|
boolean |
isAutoRange()
Returns the flag that controls whether or not the axis range is
automatically adjusted to fit the data values.
|
boolean |
isAutoTickUnitSelection()
Returns a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
|
boolean |
isInverted()
Returns a flag that controls the direction of values on the axis.
|
boolean |
isNegativeArrowVisible()
Returns a flag that controls whether or not the axis line has an arrow
drawn that points in the negative direction for the axis.
|
boolean |
isPositiveArrowVisible()
Returns a flag that controls whether or not the axis line has an arrow
drawn that points in the positive direction for the axis.
|
boolean |
isVerticalTickLabels()
Returns
true if the tick labels should be rotated (to
vertical), and false otherwise. |
abstract double |
java2DToValue(double java2DValue,
Rectangle2D area,
org.jfree.ui.RectangleEdge edge)
Converts a coordinate in Java2D space to the corresponding data value,
assuming that the axis runs along one edge of the specified dataArea.
|
double |
lengthToJava2D(double length,
Rectangle2D area,
org.jfree.ui.RectangleEdge edge)
Converts a length in data coordinates into the corresponding length in
Java2D coordinates.
|
void |
pan(double percent)
Slides the axis range by the specified percentage.
|
AxisSpace |
reserveSpace(Graphics2D g2,
Plot plot,
Rectangle2D plotArea,
org.jfree.ui.RectangleEdge edge,
AxisSpace space)
Returns the space required to draw the axis.
|
void |
resizeRange(double percent)
Increases or decreases the axis range by the specified percentage about
the central value and sends an
AxisChangeEvent to all registered
listeners. |
void |
resizeRange(double percent,
double anchorValue)
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an
AxisChangeEvent to all
registered listeners. |
void |
resizeRange2(double percent,
double anchorValue)
Increases or decreases the axis range by the specified percentage about
the specified anchor value and sends an
AxisChangeEvent to all
registered listeners. |
void |
setAutoRange(boolean auto)
Sets a flag that determines whether or not the axis range is
automatically adjusted to fit the data, and notifies registered
listeners that the axis has been modified.
|
void |
setAutoRangeMinimumSize(double size)
Sets the auto range minimum size and sends an
AxisChangeEvent
to all registered listeners. |
void |
setAutoRangeMinimumSize(double size,
boolean notify)
Sets the minimum size allowed for the axis range when it is
automatically calculated.
|
void |
setAutoTickUnitSelection(boolean flag)
Sets a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
|
void |
setAutoTickUnitSelection(boolean flag,
boolean notify)
Sets a flag indicating whether or not the tick unit is automatically
selected from a range of standard tick units.
|
void |
setDefaultAutoRange(Range range)
Sets the default auto range and sends an
AxisChangeEvent to all
registered listeners. |
void |
setDownArrow(Shape arrow)
Sets the shape that can be displayed as an arrow pointing downwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. |
void |
setFixedAutoRange(double length)
Sets the fixed auto range for the axis.
|
void |
setInverted(boolean flag)
Sets a flag that controls the direction of values on the axis, and
notifies registered listeners that the axis has changed.
|
void |
setLeftArrow(Shape arrow)
Sets the shape that can be displayed as an arrow pointing left at the
end of an axis line and sends an
AxisChangeEvent to all
registered listeners. |
void |
setLowerBound(double min)
Sets the lower bound for the axis range.
|
void |
setLowerMargin(double margin)
Sets the lower margin for the axis (as a percentage of the axis range)
and sends an
AxisChangeEvent to all registered listeners. |
void |
setMinorTickCount(int count)
Sets the number of minor tick marks to display, and sends an
AxisChangeEvent to all registered listeners. |
void |
setNegativeArrowVisible(boolean visible)
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the negative direction for the axis, and sends an
AxisChangeEvent to all registered listeners. |
void |
setPositiveArrowVisible(boolean visible)
Sets a flag that controls whether or not the axis lines has an arrow
drawn that points in the positive direction for the axis, and sends an
AxisChangeEvent to all registered listeners. |
void |
setRange(double lower,
double upper)
Sets the range for the axis and sends a change event to all registered
listeners.
|
void |
setRange(Range range)
Sets the range for the axis and sends a change event to all registered
listeners.
|
void |
setRange(Range range,
boolean turnOffAutoRange,
boolean notify)
Sets the range for the axis and, if requested, sends a change event to
all registered listeners.
|
void |
setRangeAboutValue(double value,
double length)
Sets the axis range, where the new range is 'size' in length, and
centered on 'value'.
|
void |
setRangeWithMargins(double lower,
double upper)
Sets the axis range (after first adding the current margins to the
range) and sends an
AxisChangeEvent to all registered listeners. |
void |
setRangeWithMargins(Range range)
Sets the range for the axis (after first adding the current margins to
the specified range) and sends an
AxisChangeEvent to all
registered listeners. |
void |
setRangeWithMargins(Range range,
boolean turnOffAutoRange,
boolean notify)
Sets the range for the axis after first adding the current margins to
the range and, if requested, sends an
AxisChangeEvent to all
registered listeners. |
void |
setRightArrow(Shape arrow)
Sets the shape that can be displayed as an arrow pointing rightwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. |
void |
setStandardTickUnits(TickUnitSource source)
Sets the source for obtaining standard tick units for the axis and sends
an
AxisChangeEvent to all registered listeners. |
void |
setUpArrow(Shape arrow)
Sets the shape that can be displayed as an arrow pointing upwards at
the end of an axis line and sends an
AxisChangeEvent to all
registered listeners. |
void |
setUpperBound(double max)
Sets the upper bound for the axis range, and sends an
AxisChangeEvent to all registered listeners. |
void |
setUpperMargin(double margin)
Sets the upper margin for the axis (as a percentage of the axis range)
and sends an
AxisChangeEvent to all registered listeners. |
void |
setVerticalTickLabels(boolean flag)
Sets the flag that controls whether the tick labels are displayed
vertically (that is, rotated 90 degrees from horizontal).
|
abstract double |
valueToJava2D(double value,
Rectangle2D area,
org.jfree.ui.RectangleEdge edge)
Converts a data value to a coordinate in Java2D space, assuming that the
axis runs along one edge of the specified dataArea.
|
void |
zoomRange(double lowerPercent,
double upperPercent)
Zooms in on the current range.
|
addChangeListener, configure, createAttributedLabel, draw, getAttributedLabel, getAxisLinePaint, getAxisLineStroke, getFixedDimension, getLabel, getLabelAngle, getLabelFont, getLabelInsets, getLabelLocation, getLabelPaint, getMinorTickMarkInsideLength, getMinorTickMarkOutsideLength, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, hashCode, hasListener, isAxisLineVisible, isMinorTickMarksVisible, isTickLabelsVisible, isTickMarksVisible, isVisible, refreshTicks, removeChangeListener, setAttributedLabel, setAttributedLabel, setAxisLinePaint, setAxisLineStroke, setAxisLineVisible, setFixedDimension, setLabel, setLabelAngle, setLabelFont, setLabelInsets, setLabelInsets, setLabelLocation, setLabelPaint, setMinorTickMarkInsideLength, setMinorTickMarkOutsideLength, setMinorTickMarksVisible, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkInsideLength, setTickMarkOutsideLength, setTickMarkPaint, setTickMarkStroke, setTickMarksVisible, setVisible
public static final Range DEFAULT_RANGE
public static final boolean DEFAULT_AUTO_RANGE
public static final boolean DEFAULT_INVERTED
public static final double DEFAULT_AUTO_RANGE_MINIMUM_SIZE
public static final double DEFAULT_LOWER_MARGIN
public static final double DEFAULT_UPPER_MARGIN
public static final double DEFAULT_LOWER_BOUND
getDefaultAutoRange()
).public static final double DEFAULT_UPPER_BOUND
getDefaultAutoRange()
).public static final boolean DEFAULT_AUTO_TICK_UNIT_SELECTION
public static final int MAXIMUM_TICK_COUNT
public boolean isVerticalTickLabels()
true
if the tick labels should be rotated (to
vertical), and false
otherwise.true
or false
.setVerticalTickLabels(boolean)
public void setVerticalTickLabels(boolean flag)
AxisChangeEvent
is sent to all registered
listeners.flag
- the flag.isVerticalTickLabels()
public boolean isPositiveArrowVisible()
setPositiveArrowVisible(boolean)
public void setPositiveArrowVisible(boolean visible)
AxisChangeEvent
to all registered listeners.visible
- the flag.isPositiveArrowVisible()
public boolean isNegativeArrowVisible()
setNegativeArrowVisible(boolean)
public void setNegativeArrowVisible(boolean visible)
AxisChangeEvent
to all registered listeners.visible
- the flag.setNegativeArrowVisible(boolean)
public Shape getUpArrow()
null
).setUpArrow(Shape)
public void setUpArrow(Shape arrow)
AxisChangeEvent
to all
registered listeners.arrow
- the arrow shape (null
not permitted).getUpArrow()
public Shape getDownArrow()
null
).setDownArrow(Shape)
public void setDownArrow(Shape arrow)
AxisChangeEvent
to all
registered listeners.arrow
- the arrow shape (null
not permitted).getDownArrow()
public Shape getLeftArrow()
null
).setLeftArrow(Shape)
public void setLeftArrow(Shape arrow)
AxisChangeEvent
to all
registered listeners.arrow
- the arrow shape (null
not permitted).getLeftArrow()
public Shape getRightArrow()
null
).setRightArrow(Shape)
public void setRightArrow(Shape arrow)
AxisChangeEvent
to all
registered listeners.arrow
- the arrow shape (null
not permitted).getRightArrow()
public AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, org.jfree.ui.RectangleEdge edge, AxisSpace space)
reserveSpace
in class Axis
g2
- the graphics device.plot
- the plot that the axis belongs to.plotArea
- the area within which the plot should be drawn.edge
- the axis location.space
- the space already reserved (for other axes).public boolean isInverted()
For a regular axis, values increase from left to right (for a horizontal axis) and bottom to top (for a vertical axis). When the axis is 'inverted', the values increase in the opposite direction.
setInverted(boolean)
public void setInverted(boolean flag)
flag
- the flag.isInverted()
public boolean isAutoRange()
setAutoRange(boolean)
public void setAutoRange(boolean auto)
auto
- the new value of the flag.isAutoRange()
public double getAutoRangeMinimumSize()
setAutoRangeMinimumSize(double)
public void setAutoRangeMinimumSize(double size)
AxisChangeEvent
to all registered listeners.size
- the size.getAutoRangeMinimumSize()
public void setAutoRangeMinimumSize(double size, boolean notify)
If requested, an AxisChangeEvent
is forwarded to all registered
listeners.
size
- the new minimum.notify
- notify listeners?public Range getDefaultAutoRange()
null
).setDefaultAutoRange(Range)
public void setDefaultAutoRange(Range range)
AxisChangeEvent
to all
registered listeners.range
- the range (null
not permitted).getDefaultAutoRange()
public double getLowerMargin()
setLowerMargin(double)
public void setLowerMargin(double margin)
AxisChangeEvent
to all registered listeners. This
margin is added only when the axis range is auto-calculated - if you set
the axis range manually, the margin is ignored.margin
- the margin percentage (for example, 0.05 is five percent).getLowerMargin()
,
setUpperMargin(double)
public double getUpperMargin()
setUpperMargin(double)
public void setUpperMargin(double margin)
AxisChangeEvent
to all registered listeners. This
margin is added only when the axis range is auto-calculated - if you set
the axis range manually, the margin is ignored.margin
- the margin percentage (for example, 0.05 is five percent).getLowerMargin()
,
setLowerMargin(double)
public double getFixedAutoRange()
setFixedAutoRange(double)
public void setFixedAutoRange(double length)
length
- the range length.getFixedAutoRange()
public double getLowerBound()
setLowerBound(double)
public void setLowerBound(double min)
AxisChangeEvent
is
sent to all registered listeners.min
- the new minimum.getLowerBound()
public double getUpperBound()
setUpperBound(double)
public void setUpperBound(double max)
AxisChangeEvent
to all registered listeners.max
- the new maximum.getUpperBound()
public Range getRange()
null
).setRange(Range)
public void setRange(Range range)
false
.range
- the range (null
not permitted).getRange()
public void setRange(Range range, boolean turnOffAutoRange, boolean notify)
turnOffAutoRange
is true
, the auto-range flag is set to false
(normally when setting the axis range manually the caller expects that
range to remain in force).range
- the range (null
not permitted).turnOffAutoRange
- a flag that controls whether or not the auto
range is turned off.notify
- a flag that controls whether or not listeners are
notified.getRange()
public void setRange(double lower, double upper)
false
.lower
- the lower axis limit.upper
- the upper axis limit.getRange()
,
setRange(Range)
public void setRangeWithMargins(Range range)
AxisChangeEvent
to all
registered listeners.range
- the range (null
not permitted).public void setRangeWithMargins(Range range, boolean turnOffAutoRange, boolean notify)
AxisChangeEvent
to all
registered listeners. As a side-effect, the auto-range flag is set to
false
(optional).range
- the range (excluding margins, null
not
permitted).turnOffAutoRange
- a flag that controls whether or not the auto
range is turned off.notify
- a flag that controls whether or not listeners are
notified.public void setRangeWithMargins(double lower, double upper)
AxisChangeEvent
to all registered listeners.
As a side-effect, the auto-range flag is set to false
.lower
- the lower axis limit.upper
- the upper axis limit.public void setRangeAboutValue(double value, double length)
value
- the central value.length
- the range length.public boolean isAutoTickUnitSelection()
setAutoTickUnitSelection(boolean)
public void setAutoTickUnitSelection(boolean flag)
flag
- the new value of the flag.isAutoTickUnitSelection()
public void setAutoTickUnitSelection(boolean flag, boolean notify)
flag
- the new value of the flag.notify
- notify listeners?isAutoTickUnitSelection()
public TickUnitSource getStandardTickUnits()
null
).setStandardTickUnits(TickUnitSource)
public void setStandardTickUnits(TickUnitSource source)
AxisChangeEvent
to all registered listeners. The axis will
try to select the smallest tick unit from the source that does not cause
the tick labels to overlap (see also the
setAutoTickUnitSelection(boolean)
method.source
- the source for standard tick units (null
permitted).getStandardTickUnits()
public int getMinorTickCount()
setMinorTickCount(int)
public void setMinorTickCount(int count)
AxisChangeEvent
to all registered listeners.count
- the count.getMinorTickCount()
public abstract double valueToJava2D(double value, Rectangle2D area, org.jfree.ui.RectangleEdge edge)
Note that it is possible for the coordinate to fall outside the area.
value
- the data value.area
- the area for plotting the data.edge
- the edge along which the axis lies.java2DToValue(double, Rectangle2D, RectangleEdge)
public double lengthToJava2D(double length, Rectangle2D area, org.jfree.ui.RectangleEdge edge)
length
- the length.area
- the plot area.edge
- the edge along which the axis lies.public abstract double java2DToValue(double java2DValue, Rectangle2D area, org.jfree.ui.RectangleEdge edge)
java2DValue
- the coordinate in Java2D space.area
- the area in which the data is plotted.edge
- the edge along which the axis lies.valueToJava2D(double, Rectangle2D, RectangleEdge)
public void centerRange(double value)
AxisChangeEvent
to all registered listeners.value
- the center value.public void resizeRange(double percent)
AxisChangeEvent
to all registered
listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent
- the resize factor.resizeRange(double, double)
public void resizeRange(double percent, double anchorValue)
AxisChangeEvent
to all
registered listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent
- the resize factor.anchorValue
- the new central value after the resize.resizeRange(double)
public void resizeRange2(double percent, double anchorValue)
AxisChangeEvent
to all
registered listeners.
To double the length of the axis range, use 200% (2.0). To halve the length of the axis range, use 50% (0.5).
percent
- the resize factor.anchorValue
- the new central value after the resize.resizeRange(double)
public void zoomRange(double lowerPercent, double upperPercent)
lowerPercent
- the new lower bound.upperPercent
- the new upper bound.public void pan(double percent)
percent
- the percentage.public boolean equals(Object obj)
public Object clone() throws CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class Axis
CloneNotSupportedException
- if some component of the axis does
not support cloning.Jas4pp 1.5 © Java Analysis Studio for Particle Physics