Class SubCategoryAxis

All Implemented Interfaces:
Serializable, Cloneable

public class SubCategoryAxis
extends CategoryAxis
implements Cloneable, Serializable
A specialised category axis that can display sub-categories.
See Also:
Serialized Form
  • Constructor Details

    • SubCategoryAxis

      public SubCategoryAxis​(String label)
      Creates a new axis.
      Parameters:
      label - the axis label.
  • Method Details

    • addSubCategory

      public void addSubCategory​(Comparable subCategory)
      Adds a sub-category to the axis.
      Parameters:
      subCategory - the sub-category.
    • getSubLabelFont

      public Font getSubLabelFont()
      Returns the font used to display the sub-category labels.
      Returns:
      The font (never null).
    • setSubLabelFont

      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).
    • getSubLabelPaint

      public Paint getSubLabelPaint()
      Returns the paint used to display the sub-category labels.
      Returns:
      The paint (never null).
    • setSubLabelPaint

      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).
    • reserveSpace

      public AxisSpace reserveSpace​(Graphics2D g2, Plot plot, Rectangle2D plotArea, org.jfree.ui.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.
    • draw

      public 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).
      Overrides:
      draw in class CategoryAxis
      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).
    • equals

      public boolean equals​(Object obj)
      Tests the axis for equality with an arbitrary object.
      Overrides:
      equals in class CategoryAxis
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.