public abstract class Axis extends Object implements Cloneable, Serializable
ValueAxis
) and those that display
categories (CategoryAxis
).Modifier and Type | Field and Description |
---|---|
static Font |
DEFAULT_AXIS_LABEL_FONT
The default axis label font.
|
static org.jfree.ui.RectangleInsets |
DEFAULT_AXIS_LABEL_INSETS
The default axis label insets.
|
static Paint |
DEFAULT_AXIS_LABEL_PAINT
The default axis label paint.
|
static Paint |
DEFAULT_AXIS_LINE_PAINT
The default axis line paint.
|
static Stroke |
DEFAULT_AXIS_LINE_STROKE
The default axis line stroke.
|
static boolean |
DEFAULT_AXIS_VISIBLE
The default axis visibility.
|
static Font |
DEFAULT_TICK_LABEL_FONT
The default tick label font.
|
static org.jfree.ui.RectangleInsets |
DEFAULT_TICK_LABEL_INSETS
The default tick label insets.
|
static Paint |
DEFAULT_TICK_LABEL_PAINT
The default tick label paint.
|
static boolean |
DEFAULT_TICK_LABELS_VISIBLE
The default tick labels visibility.
|
static float |
DEFAULT_TICK_MARK_INSIDE_LENGTH
The default tick mark inside length.
|
static float |
DEFAULT_TICK_MARK_OUTSIDE_LENGTH
The default tick mark outside length.
|
static Paint |
DEFAULT_TICK_MARK_PAINT
The default tick paint.
|
static Stroke |
DEFAULT_TICK_MARK_STROKE
The default tick stroke.
|
static boolean |
DEFAULT_TICK_MARKS_VISIBLE
The default tick marks visible.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(AxisChangeListener listener)
Registers an object for notification of changes to the axis.
|
Object |
clone()
Returns a clone of the axis.
|
abstract void |
configure()
Configures the axis to work with the current plot.
|
AttributedString |
createAttributedLabel(String label)
Creates and returns an
AttributedString with the specified
text and the labelFont and labelPaint applied as attributes. |
abstract AxisState |
draw(Graphics2D g2,
double cursor,
Rectangle2D plotArea,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge,
PlotRenderingInfo plotState)
Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
|
boolean |
equals(Object obj)
Tests this axis for equality with another object.
|
AttributedString |
getAttributedLabel()
Returns the attributed label (the returned value is a copy, so
modifying it will not impact the state of the axis).
|
Paint |
getAxisLinePaint()
Returns the paint used to draw the axis line.
|
Stroke |
getAxisLineStroke()
Returns the stroke used to draw the axis line.
|
double |
getFixedDimension()
Returns the fixed dimension for the axis.
|
String |
getLabel()
Returns the label for the axis.
|
double |
getLabelAngle()
Returns the angle of the axis label.
|
Font |
getLabelFont()
Returns the font for the axis label.
|
org.jfree.ui.RectangleInsets |
getLabelInsets()
Returns the insets for the label (that is, the amount of blank space
that should be left around the label).
|
AxisLabelLocation |
getLabelLocation()
Returns the location of the axis label.
|
Paint |
getLabelPaint()
Returns the color/shade used to draw the axis label.
|
float |
getMinorTickMarkInsideLength()
Returns the inside length of the minor tick marks.
|
float |
getMinorTickMarkOutsideLength()
Returns the outside length of the minor tick marks.
|
Plot |
getPlot()
Returns the plot that the axis is assigned to.
|
Font |
getTickLabelFont()
Returns the font used for the tick labels (if showing).
|
org.jfree.ui.RectangleInsets |
getTickLabelInsets()
Returns the insets for the tick labels.
|
Paint |
getTickLabelPaint()
Returns the color/shade used for the tick labels.
|
float |
getTickMarkInsideLength()
Returns the inside length of the tick marks.
|
float |
getTickMarkOutsideLength()
Returns the outside length of the tick marks.
|
Paint |
getTickMarkPaint()
Returns the paint used to draw tick marks (if they are showing).
|
Stroke |
getTickMarkStroke()
Returns the stroke used to draw tick marks.
|
int |
hashCode()
Returns a hash code for this instance.
|
boolean |
hasListener(EventListener listener)
Returns
true if the specified object is registered with
the dataset as a listener. |
boolean |
isAxisLineVisible()
A flag that controls whether or not the axis line is drawn.
|
boolean |
isMinorTickMarksVisible()
Returns the flag that indicates whether or not the minor tick marks are
showing.
|
boolean |
isTickLabelsVisible()
Returns a flag indicating whether or not the tick labels are visible.
|
boolean |
isTickMarksVisible()
Returns the flag that indicates whether or not the tick marks are
showing.
|
boolean |
isVisible()
Returns
true if the axis is visible, and
false otherwise. |
abstract List |
refreshTicks(Graphics2D g2,
AxisState state,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
Calculates the positions of the ticks for the axis, storing the results
in the tick list (ready for drawing).
|
void |
removeChangeListener(AxisChangeListener listener)
Deregisters an object for notification of changes to the axis.
|
abstract AxisSpace |
reserveSpace(Graphics2D g2,
Plot plot,
Rectangle2D plotArea,
org.jfree.ui.RectangleEdge edge,
AxisSpace space)
Estimates the space (height or width) required to draw the axis.
|
void |
setAttributedLabel(AttributedString label)
Sets the attributed label for the axis and sends an
AxisChangeEvent to all registered listeners. |
void |
setAttributedLabel(String label)
Sets the attributed label for the axis and sends an
AxisChangeEvent to all registered listeners. |
void |
setAxisLinePaint(Paint paint)
Sets the paint used to draw the axis line and sends an
AxisChangeEvent to all registered listeners. |
void |
setAxisLineStroke(Stroke stroke)
Sets the stroke used to draw the axis line and sends an
AxisChangeEvent to all registered listeners. |
void |
setAxisLineVisible(boolean visible)
Sets a flag that controls whether or not the axis line is visible and
sends an
AxisChangeEvent to all registered listeners. |
void |
setFixedDimension(double dimension)
Sets the fixed dimension for the axis.
|
void |
setLabel(String label)
Sets the label for the axis and sends an
AxisChangeEvent to all
registered listeners. |
void |
setLabelAngle(double angle)
Sets the angle for the label and sends an
AxisChangeEvent to all
registered listeners. |
void |
setLabelFont(Font font)
Sets the font for the axis label and sends an
AxisChangeEvent
to all registered listeners. |
void |
setLabelInsets(org.jfree.ui.RectangleInsets insets)
Sets the insets for the axis label, and sends an
AxisChangeEvent
to all registered listeners. |
void |
setLabelInsets(org.jfree.ui.RectangleInsets insets,
boolean notify)
Sets the insets for the axis label, and sends an
AxisChangeEvent
to all registered listeners. |
void |
setLabelLocation(AxisLabelLocation location)
Sets the axis label location and sends an
AxisChangeEvent to
all registered listeners. |
void |
setLabelPaint(Paint paint)
Sets the paint used to draw the axis label and sends an
AxisChangeEvent to all registered listeners. |
void |
setMinorTickMarkInsideLength(float length)
Sets the inside length of the minor tick marks and sends
an
AxisChangeEvent to all registered listeners. |
void |
setMinorTickMarkOutsideLength(float length)
Sets the outside length of the minor tick marks and sends
an
AxisChangeEvent to all registered listeners. |
void |
setMinorTickMarksVisible(boolean flag)
Sets the flag that indicates whether or not the minor tick marks are
showing and sends an
AxisChangeEvent to all registered
listeners. |
void |
setPlot(Plot plot)
Sets a reference to the plot that the axis is assigned to.
|
void |
setTickLabelFont(Font font)
Sets the font for the tick labels and sends an
AxisChangeEvent
to all registered listeners. |
void |
setTickLabelInsets(org.jfree.ui.RectangleInsets insets)
Sets the insets for the tick labels and sends an
AxisChangeEvent
to all registered listeners. |
void |
setTickLabelPaint(Paint paint)
Sets the paint used to draw tick labels (if they are showing) and
sends an
AxisChangeEvent to all registered listeners. |
void |
setTickLabelsVisible(boolean flag)
Sets the flag that determines whether or not the tick labels are
visible and sends an
AxisChangeEvent to all registered
listeners. |
void |
setTickMarkInsideLength(float length)
Sets the inside length of the tick marks and sends
an
AxisChangeEvent to all registered listeners. |
void |
setTickMarkOutsideLength(float length)
Sets the outside length of the tick marks and sends
an
AxisChangeEvent to all registered listeners. |
void |
setTickMarkPaint(Paint paint)
Sets the paint used to draw tick marks and sends an
AxisChangeEvent to all registered listeners. |
void |
setTickMarkStroke(Stroke stroke)
Sets the stroke used to draw tick marks and sends
an
AxisChangeEvent to all registered listeners. |
void |
setTickMarksVisible(boolean flag)
Sets the flag that indicates whether or not the tick marks are showing
and sends an
AxisChangeEvent to all registered listeners. |
void |
setVisible(boolean flag)
Sets a flag that controls whether or not the axis is visible and sends
an
AxisChangeEvent to all registered listeners. |
public static final boolean DEFAULT_AXIS_VISIBLE
public static final Font DEFAULT_AXIS_LABEL_FONT
public static final Paint DEFAULT_AXIS_LABEL_PAINT
public static final org.jfree.ui.RectangleInsets DEFAULT_AXIS_LABEL_INSETS
public static final Paint DEFAULT_AXIS_LINE_PAINT
public static final Stroke DEFAULT_AXIS_LINE_STROKE
public static final boolean DEFAULT_TICK_LABELS_VISIBLE
public static final Font DEFAULT_TICK_LABEL_FONT
public static final Paint DEFAULT_TICK_LABEL_PAINT
public static final org.jfree.ui.RectangleInsets DEFAULT_TICK_LABEL_INSETS
public static final boolean DEFAULT_TICK_MARKS_VISIBLE
public static final Stroke DEFAULT_TICK_MARK_STROKE
public static final Paint DEFAULT_TICK_MARK_PAINT
public static final float DEFAULT_TICK_MARK_INSIDE_LENGTH
public static final float DEFAULT_TICK_MARK_OUTSIDE_LENGTH
public boolean isVisible()
true
if the axis is visible, and
false
otherwise.setVisible(boolean)
public void setVisible(boolean flag)
AxisChangeEvent
to all registered listeners.flag
- the flag.isVisible()
public String getLabel()
null
possible).getLabelFont()
,
getLabelPaint()
,
setLabel(String)
public void setLabel(String label)
AxisChangeEvent
to all
registered listeners.label
- the new label (null
permitted).getLabel()
,
setLabelFont(Font)
,
setLabelPaint(Paint)
public AttributedString getAttributedLabel()
null
.null
).public void setAttributedLabel(String label)
AxisChangeEvent
to all registered listeners. This is a
convenience method that converts the string into an
AttributedString
using the current font attributes.label
- the label (null
permitted).public void setAttributedLabel(AttributedString label)
AxisChangeEvent
to all registered listeners.label
- the label (null
permitted).public AttributedString createAttributedLabel(String label)
AttributedString
with the specified
text and the labelFont and labelPaint applied as attributes.label
- the label (null
permitted).null
.public Font getLabelFont()
null
).setLabelFont(Font)
public void setLabelFont(Font font)
AxisChangeEvent
to all registered listeners.font
- the font (null
not permitted).getLabelFont()
public Paint getLabelPaint()
null
).setLabelPaint(Paint)
public void setLabelPaint(Paint paint)
AxisChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getLabelPaint()
public org.jfree.ui.RectangleInsets getLabelInsets()
null
).setLabelInsets(RectangleInsets)
public void setLabelInsets(org.jfree.ui.RectangleInsets insets)
AxisChangeEvent
to all registered listeners.insets
- the insets (null
not permitted).getLabelInsets()
public void setLabelInsets(org.jfree.ui.RectangleInsets insets, boolean notify)
AxisChangeEvent
to all registered listeners.insets
- the insets (null
not permitted).notify
- notify listeners?public double getLabelAngle()
setLabelAngle(double)
public void setLabelAngle(double angle)
AxisChangeEvent
to all
registered listeners.angle
- the angle (in radians).getLabelAngle()
public AxisLabelLocation getLabelLocation()
AxisLabelLocation.MIDDLE
.null
).public void setLabelLocation(AxisLabelLocation location)
AxisChangeEvent
to
all registered listeners.location
- the new location (null
not permitted).public boolean isAxisLineVisible()
getAxisLinePaint()
,
getAxisLineStroke()
,
setAxisLineVisible(boolean)
public void setAxisLineVisible(boolean visible)
AxisChangeEvent
to all registered listeners.visible
- the flag.isAxisLineVisible()
,
setAxisLinePaint(Paint)
,
setAxisLineStroke(Stroke)
public Paint getAxisLinePaint()
null
).setAxisLinePaint(Paint)
public void setAxisLinePaint(Paint paint)
AxisChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getAxisLinePaint()
public Stroke getAxisLineStroke()
null
).setAxisLineStroke(Stroke)
public void setAxisLineStroke(Stroke stroke)
AxisChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getAxisLineStroke()
public boolean isTickLabelsVisible()
getTickLabelFont()
,
getTickLabelPaint()
,
setTickLabelsVisible(boolean)
public void setTickLabelsVisible(boolean flag)
AxisChangeEvent
to all registered
listeners.flag
- the flag.isTickLabelsVisible()
,
setTickLabelFont(Font)
,
setTickLabelPaint(Paint)
public boolean isMinorTickMarksVisible()
setMinorTickMarksVisible(boolean)
public void setMinorTickMarksVisible(boolean flag)
AxisChangeEvent
to all registered
listeners.flag
- the flag.isMinorTickMarksVisible()
public Font getTickLabelFont()
null
).setTickLabelFont(Font)
public void setTickLabelFont(Font font)
AxisChangeEvent
to all registered listeners.font
- the font (null
not allowed).getTickLabelFont()
public Paint getTickLabelPaint()
setTickLabelPaint(Paint)
public void setTickLabelPaint(Paint paint)
AxisChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getTickLabelPaint()
public org.jfree.ui.RectangleInsets getTickLabelInsets()
null
).setTickLabelInsets(RectangleInsets)
public void setTickLabelInsets(org.jfree.ui.RectangleInsets insets)
AxisChangeEvent
to all registered listeners.insets
- the insets (null
not permitted).getTickLabelInsets()
public boolean isTickMarksVisible()
setTickMarksVisible(boolean)
public void setTickMarksVisible(boolean flag)
AxisChangeEvent
to all registered listeners.flag
- the flag.isTickMarksVisible()
public float getTickMarkInsideLength()
getTickMarkOutsideLength()
,
setTickMarkInsideLength(float)
public void setTickMarkInsideLength(float length)
AxisChangeEvent
to all registered listeners.length
- the new length.getTickMarkInsideLength()
public float getTickMarkOutsideLength()
getTickMarkInsideLength()
,
setTickMarkOutsideLength(float)
public void setTickMarkOutsideLength(float length)
AxisChangeEvent
to all registered listeners.length
- the new length.getTickMarkInsideLength()
public Stroke getTickMarkStroke()
null
).setTickMarkStroke(Stroke)
public void setTickMarkStroke(Stroke stroke)
AxisChangeEvent
to all registered listeners.stroke
- the stroke (null
not permitted).getTickMarkStroke()
public Paint getTickMarkPaint()
null
).setTickMarkPaint(Paint)
public void setTickMarkPaint(Paint paint)
AxisChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getTickMarkPaint()
public float getMinorTickMarkInsideLength()
getMinorTickMarkOutsideLength()
,
setMinorTickMarkInsideLength(float)
public void setMinorTickMarkInsideLength(float length)
AxisChangeEvent
to all registered listeners.length
- the new length.getMinorTickMarkInsideLength()
public float getMinorTickMarkOutsideLength()
getMinorTickMarkInsideLength()
,
setMinorTickMarkOutsideLength(float)
public void setMinorTickMarkOutsideLength(float length)
AxisChangeEvent
to all registered listeners.length
- the new length.getMinorTickMarkInsideLength()
public Plot getPlot()
null
if the axis is not currently assigned to a plot.null
).setPlot(Plot)
public void setPlot(Plot plot)
This method is used internally, you shouldn't need to call it yourself.
plot
- the plot.getPlot()
public double getFixedDimension()
setFixedDimension(double)
public void setFixedDimension(double dimension)
This is used when combining more than one plot on a chart. In this case, there may be several axes that need to have the same height or width so that they are aligned. This method is used to fix a dimension for the axis (the context determines whether the dimension is horizontal or vertical).
dimension
- the fixed dimension.getFixedDimension()
public abstract void configure()
public abstract AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, org.jfree.ui.RectangleEdge edge, AxisSpace space)
g2
- the graphics device.plot
- the plot that the axis belongs to.plotArea
- the area within which the plot (including axes) should
be drawn.edge
- the axis location.space
- space already reserved.public abstract AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge, PlotRenderingInfo plotState)
g2
- the graphics device (null
not permitted).cursor
- the cursor location (determines where to draw the axis).plotArea
- the area within which the axes and plot should be drawn.dataArea
- the area within which the data should be drawn.edge
- the axis location (null
not permitted).plotState
- collects information about the plot
(null
permitted).null
).public abstract List refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, org.jfree.ui.RectangleEdge edge)
g2
- the graphics device.state
- the axis state.dataArea
- the area inside the axes.edge
- the edge on which the axis is located.public void addChangeListener(AxisChangeListener listener)
listener
- the object that is being registered.removeChangeListener(AxisChangeListener)
public void removeChangeListener(AxisChangeListener listener)
listener
- the object to deregister.addChangeListener(AxisChangeListener)
public boolean hasListener(EventListener listener)
true
if the specified object is registered with
the dataset as a listener. Most applications won't need to call this
method, it exists mainly for use by unit testing code.listener
- the listener.public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if some component of the axis does
not support cloning.public boolean equals(Object obj)
Jas4pp 1.5 © Java Analysis Studio for Particle Physics