|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Axis | +--com.jrefinery.chart.CategoryAxis | +--com.jrefinery.chart.VerticalCategoryAxis
A vertical axis that displays categories, used for horizontal bar charts.
The axis needs to rely on the plot for placement of labels, since the plot controls how the categories are distributed.
Field Summary | |
static boolean |
DEFAULT_VERTICAL_LABEL
The default setting for vertical axis label. |
Fields inherited from class com.jrefinery.chart.Axis |
fixedDimension, label, labelFont, labelInsets, labelPaint, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkPaint, tickMarkStroke, tickMarksVisible, ticks, visible |
Fields inherited from interface com.jrefinery.chart.AxisConstants |
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_PAINT, DEFAULT_TICK_STROKE |
Constructor Summary | |
VerticalCategoryAxis(java.lang.String label)
Constructs a new axis, using default attributes where necessary. |
|
VerticalCategoryAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean verticalLabel,
boolean categoryLabelsVisible,
java.awt.Font categoryLabelFont,
java.awt.Paint categoryLabelPaint,
java.awt.Insets categoryLabelInsets,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke,
java.awt.Paint tickMarkPaint)
Constructs a new axis. |
Method Summary | |
void |
configure()
Configures the axis against the current plot. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D dataArea)
Draws the axis on a Java 2D graphics device (such as the screen or a printer). |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if the specified plot is compatible with the axis, and false otherwise. |
boolean |
isVerticalLabel()
Returns a flag indicating whether or not the axis label is drawn vertically. |
void |
refreshTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
Creates a temporary list of ticks that can be used when drawing the axis. |
java.awt.geom.Rectangle2D |
reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedHeight)
Returns the area required to draw the axis in the specified draw area. |
double |
reserveWidth(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
Estimates the height required for the axis, given a specific drawing area, without any information about the width of the vertical axis. |
void |
setVerticalLabel(boolean flag)
Sets a flag indicating whether or not the axis label is drawn vertically. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean DEFAULT_VERTICAL_LABEL
Constructor Detail |
public VerticalCategoryAxis(java.lang.String label)
label
- the axis label (null permitted).public VerticalCategoryAxis(java.lang.String label, java.awt.Font labelFont, java.awt.Paint labelPaint, java.awt.Insets labelInsets, boolean verticalLabel, boolean categoryLabelsVisible, java.awt.Font categoryLabelFont, java.awt.Paint categoryLabelPaint, java.awt.Insets categoryLabelInsets, boolean tickMarksVisible, java.awt.Stroke tickMarkStroke, java.awt.Paint tickMarkPaint)
label
- the axis label (null permitted).labelFont
- the font for displaying the axis label.labelPaint
- the paint used to draw the axis label.labelInsets
- determines the amount of blank space around the label.verticalLabel
- flag indicating whether or not the axis label is drawn vertically.categoryLabelsVisible
- a flag indicating whether or not category labels are visible.categoryLabelFont
- the font used to display category labels.categoryLabelPaint
- the paint used to draw category labels.categoryLabelInsets
- the insets for the category labels.tickMarksVisible
- flag indicating whether or not tick marks are visible.tickMarkStroke
- the stroke used to draw tick marks (if visible).tickMarkPaint
- the paint used to draw tick marks (if visible).Method Detail |
public boolean isVerticalLabel()
public void setVerticalLabel(boolean flag)
flag
- the flag.public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D dataArea)
draw
in class Axis
g2
- the graphics device.drawArea
- the area within which the axis should be drawn.dataArea
- the area within which the plot is being drawn.public void refreshTicks(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D drawArea, java.awt.geom.Rectangle2D plotArea)
refreshTicks
in class Axis
g2
- the graphics device (used to get font measurements).drawArea
- the area where the plot and axes will be drawn.plotArea
- the area inside the axes.public double reserveWidth(java.awt.Graphics2D g2, Plot plot, java.awt.geom.Rectangle2D drawArea)
Supports the VerticalAxis interface.
reserveWidth
in interface VerticalAxis
g2
- the graphics device (used to obtain font information).drawArea
- the area within which the axis should be drawn.plot
- the plot that the axis belongs to.public java.awt.geom.Rectangle2D reserveAxisArea(java.awt.Graphics2D g2, Plot plot, java.awt.geom.Rectangle2D drawArea, double reservedHeight)
reserveAxisArea
in interface VerticalAxis
g2
- the graphics device.plot
- the plot that the axis belongs to.drawArea
- the area within which the plot should be drawn.reservedHeight
- the height reserved by the horizontal axis.protected boolean isCompatiblePlot(Plot plot)
isCompatiblePlot
in class Axis
plot
- the plot.public void configure()
configure
in class Axis
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |