|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.Axis
com.jrefinery.chart.CategoryAxis
com.jrefinery.chart.HorizontalCategoryAxis
public class HorizontalCategoryAxis
A horizontal axis that displays categories. Used for bar charts and line charts.
Note: the axis needs to rely on the plot for assistance with the placement of category labels, since the plot controls how the categories are distributed.
| Field Summary | |
|---|---|
protected boolean |
verticalCategoryLabels
A flag that indicates whether or not the category labels should be drawn vertically. |
| Fields inherited from class com.jrefinery.chart.Axis |
|---|
fixedDimension, label, labelFont, labelInsets, labelPaint, listeners, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, 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_STROKE |
| Constructor Summary | |
|---|---|
HorizontalCategoryAxis()
Constructs a HorizontalCategoryAxis, using default values where necessary. |
|
HorizontalCategoryAxis(java.lang.String label)
Constructs a HorizontalCategoryAxis, using default values where necessary. |
|
HorizontalCategoryAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean categoryLabelsVisible,
boolean verticalCategoryLabels,
java.awt.Font categoryLabelFont,
java.awt.Paint categoryLabelPaint,
java.awt.Insets categoryLabelInsets,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke)
Constructs a HorizontalCategoryAxis. |
|
| 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 plotArea)
Draws the HorizontalCategoryAxis on a Java 2D graphics device (such as the screen or a printer). |
protected double |
getMaxTickLabelWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
Returns the maximum width of the ticks in the working list (that is set up by refreshTicks()). |
boolean |
getVerticalCategoryLabels()
Returns a flag indicating whether the category labels are drawn 'vertically'. |
protected boolean |
isCompatiblePlot(Plot plot)
Returns true if the specified plot is compatible with the axis, and false otherwise. |
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 reservedWidth)
Returns the area required to draw the axis in the specified draw area. |
double |
reserveHeight(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 |
setVerticalCategoryLabels(boolean flag)
Sets the flag that determines whether the category labels are drawn 'vertically'. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean verticalCategoryLabels
| Constructor Detail |
|---|
public HorizontalCategoryAxis()
public HorizontalCategoryAxis(java.lang.String label)
label - The axis label.
public HorizontalCategoryAxis(java.lang.String label,
java.awt.Font labelFont,
java.awt.Paint labelPaint,
java.awt.Insets labelInsets,
boolean categoryLabelsVisible,
boolean verticalCategoryLabels,
java.awt.Font categoryLabelFont,
java.awt.Paint categoryLabelPaint,
java.awt.Insets categoryLabelInsets,
boolean tickMarksVisible,
java.awt.Stroke tickMarkStroke)
label - The axis label.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.categoryLabelsVisible - Flag indicating whether or not category labels are visible.verticalCategoryLabels - Flag indicating whether or not the category labels are drawn
vertically.categoryLabelFont - The font used to display category labels.categoryLabelPaint - The paint used to draw category labels.categoryLabelInsets - Determines the blank space around each category label.tickMarksVisible - Flag indicating whether or not tick marks are visible.tickMarkStroke - The stroke used to draw tick marks (if visible).| Method Detail |
|---|
public boolean getVerticalCategoryLabels()
public void setVerticalCategoryLabels(boolean flag)
flag - The new value of the flag.
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D drawArea,
java.awt.geom.Rectangle2D plotArea)
draw in class Axisg2 - The graphics device.drawArea - The area within which the axis should be drawn.plotArea - 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 Axisg2 - 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 reserveHeight(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea)
Supports the HorizontalAxis interface.
reserveHeight in interface HorizontalAxisg2 - The graphics device (used to obtain font information).plot - The plot that the axis belongs to.drawArea - The area within which the axis should be drawn.
public java.awt.geom.Rectangle2D reserveAxisArea(java.awt.Graphics2D g2,
Plot plot,
java.awt.geom.Rectangle2D drawArea,
double reservedWidth)
reserveAxisArea in interface HorizontalAxisg2 - The graphics device.plot - The plot that the axis belongs to.drawArea - The area within which the plot should be drawn.reservedWidth - The width reserved by the vertical axis.
protected double getMaxTickLabelWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea)
getMaxTickLabelWidth in class Axisg2 - The graphics device.plotArea - The area within which the plot is to be drawn.protected boolean isCompatiblePlot(Plot plot)
isCompatiblePlot in class Axisplot - The plot.
public void configure()
configure in class Axis
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||