public class

SubCategoryAxis

extends CategoryAxis
implements Serializable Cloneable
java.lang.Object
   ↳ org.jfree.chart.axis.Axis
     ↳ org.jfree.chart.axis.CategoryAxis
       ↳ org.jfree.chart.axis.SubCategoryAxis

Class Overview

A specialised category axis that can display sub-categories.

Summary

[Expand]
Inherited Constants
From class org.jfree.chart.axis.CategoryAxis
From class org.jfree.chart.axis.Axis
[Expand]
Inherited Fields
From class org.jfree.chart.axis.Axis
Public Constructors
SubCategoryAxis(String label)
Creates a new axis.
Public Methods
void addSubCategory(Comparable subCategory)
Adds a sub-category to the axis and sends an AxisChangeEvent to all registered listeners.
AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, 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 the axis for equality with an arbitrary object.
Font getSubLabelFont()
Returns the font used to display the sub-category labels.
Paint getSubLabelPaint()
Returns the paint used to display the sub-category labels.
AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, RectangleEdge edge, AxisSpace space)
Estimates the space required for the axis, given a specific drawing area.
void setSubLabelFont(Font font)
Sets the font used to display the sub-category labels and sends an AxisChangeEvent to all registered listeners.
void setSubLabelPaint(Paint paint)
Sets the paint used to display the sub-category labels and sends an AxisChangeEvent to all registered listeners.
Protected Methods
AxisState drawSubCategoryLabels(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, AxisState state, PlotRenderingInfo plotState)
Draws the category labels and returns the updated axis state.
[Expand]
Inherited Methods
From class org.jfree.chart.axis.CategoryAxis
From class org.jfree.chart.axis.Axis
From class java.lang.Object

Public Constructors

public SubCategoryAxis (String label)

Creates a new axis.

Parameters
label the axis label.

Public Methods

public void addSubCategory (Comparable subCategory)

Adds a sub-category to the axis and sends an AxisChangeEvent to all registered listeners.

Parameters
subCategory the sub-category (null not permitted).

public AxisState draw (Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)

Draws the axis on a Java 2D graphics device (such as the screen or a printer).

Parameters
g2 the graphics device (null not permitted).
cursor the cursor location.
plotArea the area within which the axis should be drawn (null not permitted).
dataArea the area within which the plot is being drawn (null not permitted).
edge the location of the axis (null not permitted).
plotState collects information about the plot (null permitted).
Returns
  • The axis state (never null).

public boolean equals (Object obj)

Tests the axis for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Font getSubLabelFont ()

Returns the font used to display the sub-category labels.

Returns
  • The font (never null).

public Paint getSubLabelPaint ()

Returns the paint used to display the sub-category labels.

Returns
  • The paint (never null).

public AxisSpace reserveSpace (Graphics2D g2, Plot plot, Rectangle2D plotArea, RectangleEdge edge, AxisSpace space)

Estimates the space required for the axis, given a specific drawing area.

Parameters
g2 the graphics device (used to obtain font information).
plot the plot that the axis belongs to.
plotArea the area within which the axis should be drawn.
edge the axis location (top or bottom).
space the space already reserved.
Returns
  • The space required to draw the axis.

public void setSubLabelFont (Font font)

Sets the font used to display the sub-category labels and sends an AxisChangeEvent to all registered listeners.

Parameters
font the font (null not permitted).

public void setSubLabelPaint (Paint paint)

Sets the paint used to display the sub-category labels and sends an AxisChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).

Protected Methods

protected AxisState drawSubCategoryLabels (Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, AxisState state, PlotRenderingInfo plotState)

Draws the category labels and returns the updated axis state.

Parameters
g2 the graphics device (null not permitted).
plotArea the plot area (null not permitted).
dataArea the area inside the axes (null not permitted).
edge the axis location (null not permitted).
state the axis state (null not permitted).
plotState collects information about the plot (null permitted).
Returns
  • The updated axis state (never null).