Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » axis » [javadoc | source]
org.jfree.chart.axis
abstract public class: Axis [javadoc | source]
java.lang.Object
   org.jfree.chart.axis.Axis

All Implemented Interfaces:
    Cloneable, Serializable

Direct Known Subclasses:
    SubCategoryAxis, ExtendedCategoryAxis, NumberAxis3D, PeriodAxis, CategoryAxis, ValueAxis, LogarithmicAxis, ModuloAxis, CyclicNumberAxis, SymbolicAxis, SymbolAxis, NumberAxis, LogAxis, DateAxis, CategoryAxis3D

The base class for all axes in JFreeChart. Subclasses are divided into those that display values (ValueAxis ) and those that display categories (CategoryAxis ).
Field Summary
public static final  boolean DEFAULT_AXIS_VISIBLE    The default axis visibility. 
public static final  Font DEFAULT_AXIS_LABEL_FONT    The default axis label font. 
public static final  Paint DEFAULT_AXIS_LABEL_PAINT    The default axis label paint. 
public static final  RectangleInsets DEFAULT_AXIS_LABEL_INSETS    The default axis label insets. 
public static final  Paint DEFAULT_AXIS_LINE_PAINT    The default axis line paint. 
public static final  Stroke DEFAULT_AXIS_LINE_STROKE    The default axis line stroke. 
public static final  boolean DEFAULT_TICK_LABELS_VISIBLE    The default tick labels visibility. 
public static final  Font DEFAULT_TICK_LABEL_FONT    The default tick label font. 
public static final  Paint DEFAULT_TICK_LABEL_PAINT    The default tick label paint. 
public static final  RectangleInsets DEFAULT_TICK_LABEL_INSETS    The default tick label insets. 
public static final  boolean DEFAULT_TICK_MARKS_VISIBLE    The default tick marks visible. 
public static final  Stroke DEFAULT_TICK_MARK_STROKE    The default tick stroke. 
public static final  Paint DEFAULT_TICK_MARK_PAINT    The default tick paint. 
public static final  float DEFAULT_TICK_MARK_INSIDE_LENGTH    The default tick mark inside length. 
public static final  float DEFAULT_TICK_MARK_OUTSIDE_LENGTH    The default tick mark outside length. 
Constructor:
 protected Axis(String label) 
    Constructs an axis, using default values where necessary.
    Parameters:
    label - the axis label (null permitted).
Method from org.jfree.chart.axis.Axis Summary:
addChangeListener,   clone,   configure,   draw,   drawAxisLine,   drawLabel,   equals,   getAxisLinePaint,   getAxisLineStroke,   getFixedDimension,   getLabel,   getLabelAngle,   getLabelEnclosure,   getLabelFont,   getLabelInsets,   getLabelPaint,   getPlot,   getTickLabelFont,   getTickLabelInsets,   getTickLabelPaint,   getTickMarkInsideLength,   getTickMarkOutsideLength,   getTickMarkPaint,   getTickMarkStroke,   hasListener,   isAxisLineVisible,   isTickLabelsVisible,   isTickMarksVisible,   isVisible,   notifyListeners,   refreshTicks,   removeChangeListener,   reserveSpace,   setAxisLinePaint,   setAxisLineStroke,   setAxisLineVisible,   setFixedDimension,   setLabel,   setLabelAngle,   setLabelFont,   setLabelInsets,   setLabelInsets,   setLabelPaint,   setPlot,   setTickLabelFont,   setTickLabelInsets,   setTickLabelPaint,   setTickLabelsVisible,   setTickMarkInsideLength,   setTickMarkOutsideLength,   setTickMarkPaint,   setTickMarkStroke,   setTickMarksVisible,   setVisible
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.axis.Axis Detail:
 public  void addChangeListener(AxisChangeListener listener) 
    Registers an object for notification of changes to the axis.
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the axis.
 abstract public  void configure()
    Configures the axis to work with the current plot. Override this method to perform any special processing (such as auto-rescaling).
 abstract 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).
 protected  void drawAxisLine(Graphics2D g2,
    double cursor,
    Rectangle2D dataArea,
    RectangleEdge edge) 
    Draws an axis line at the current cursor position and edge.
 protected AxisState drawLabel(String label,
    Graphics2D g2,
    Rectangle2D plotArea,
    Rectangle2D dataArea,
    RectangleEdge edge,
    AxisState state) 
    Draws the axis label.
 public boolean equals(Object obj) 
    Tests this axis for equality with another object.
 public Paint getAxisLinePaint() 
    Returns the paint used to draw the axis line.
 public Stroke getAxisLineStroke() 
    Returns the stroke used to draw the axis line.
 public double getFixedDimension() 
    Returns the fixed dimension for the axis.
 public String getLabel() 
    Returns the label for the axis.
 public double getLabelAngle() 
    Returns the angle of the axis label.
 protected Rectangle2D getLabelEnclosure(Graphics2D g2,
    RectangleEdge edge) 
    Returns a rectangle that encloses the axis label. This is typically used for layout purposes (it gives the maximum dimensions of the label).
 public Font getLabelFont() 
    Returns the font for the axis label.
 public RectangleInsets getLabelInsets() 
    Returns the insets for the label (that is, the amount of blank space that should be left around the label).
 public Paint getLabelPaint() 
    Returns the color/shade used to draw the axis label.
 public Plot getPlot() 
    Returns the plot that the axis is assigned to. This method will return null if the axis is not currently assigned to a plot.
 public Font getTickLabelFont() 
    Returns the font used for the tick labels (if showing).
 public RectangleInsets getTickLabelInsets() 
    Returns the insets for the tick labels.
 public Paint getTickLabelPaint() 
    Returns the color/shade used for the tick labels.
 public float getTickMarkInsideLength() 
    Returns the inside length of the tick marks.
 public float getTickMarkOutsideLength() 
    Returns the outside length of the tick marks.
 public Paint getTickMarkPaint() 
    Returns the paint used to draw tick marks (if they are showing).
 public Stroke getTickMarkStroke() 
    Returns the stroke used to draw tick marks.
 public boolean hasListener(EventListener listener) 
    Returns 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.
 public boolean isAxisLineVisible() 
    A flag that controls whether or not the axis line is drawn.
 public boolean isTickLabelsVisible() 
    Returns a flag indicating whether or not the tick labels are visible.
 public boolean isTickMarksVisible() 
    Returns the flag that indicates whether or not the tick marks are showing.
 public boolean isVisible() 
    Returns true if the axis is visible, and false otherwise.
 protected  void notifyListeners(AxisChangeEvent event) 
    Notifies all registered listeners that the axis has changed. The AxisChangeEvent provides information about the change.
 abstract public List refreshTicks(Graphics2D g2,
    AxisState state,
    Rectangle2D dataArea,
    RectangleEdge edge)
    Calculates the positions of the ticks for the axis, storing the results in the tick list (ready for drawing).
 public  void removeChangeListener(AxisChangeListener listener) 
    Deregisters an object for notification of changes to the axis.
 abstract public AxisSpace reserveSpace(Graphics2D g2,
    Plot plot,
    Rectangle2D plotArea,
    RectangleEdge edge,
    AxisSpace space)
    Estimates the space (height or width) required to draw the axis.
 public  void setAxisLinePaint(Paint paint) 
    Sets the paint used to draw the axis line and sends an AxisChangeEvent to all registered listeners.
 public  void setAxisLineStroke(Stroke stroke) 
    Sets the stroke used to draw the axis line and sends an AxisChangeEvent to all registered listeners.
 public  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.
 public  void setFixedDimension(double dimension) 
    Sets the fixed dimension for the axis.

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

 public  void setLabel(String label) 
    Sets the label for the axis and sends an AxisChangeEvent to all registered listeners.
 public  void setLabelAngle(double angle) 
    Sets the angle for the label and sends an AxisChangeEvent to all registered listeners.
 public  void setLabelFont(Font font) 
    Sets the font for the axis label and sends an AxisChangeEvent to all registered listeners.
 public  void setLabelInsets(RectangleInsets insets) 
    Sets the insets for the axis label, and sends an AxisChangeEvent to all registered listeners.
 public  void setLabelInsets(RectangleInsets insets,
    boolean notify) 
    Sets the insets for the axis label, and sends an AxisChangeEvent to all registered listeners.
 public  void setLabelPaint(Paint paint) 
    Sets the paint used to draw the axis label and sends an AxisChangeEvent to all registered listeners.
 public  void setPlot(Plot plot) 
    Sets a reference to the plot that the axis is assigned to.

    This method is used internally, you shouldn't need to call it yourself.

 public  void setTickLabelFont(Font font) 
    Sets the font for the tick labels and sends an AxisChangeEvent to all registered listeners.
 public  void setTickLabelInsets(RectangleInsets insets) 
    Sets the insets for the tick labels and sends an AxisChangeEvent to all registered listeners.
 public  void setTickLabelPaint(Paint paint) 
    Sets the paint used to draw tick labels (if they are showing) and sends an AxisChangeEvent to all registered listeners.
 public  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.
 public  void setTickMarkInsideLength(float length) 
    Sets the inside length of the tick marks and sends an AxisChangeEvent to all registered listeners.
 public  void setTickMarkOutsideLength(float length) 
    Sets the outside length of the tick marks and sends an AxisChangeEvent to all registered listeners.
 public  void setTickMarkPaint(Paint paint) 
    Sets the paint used to draw tick marks and sends an AxisChangeEvent to all registered listeners.
 public  void setTickMarkStroke(Stroke stroke) 
    Sets the stroke used to draw tick marks and sends an AxisChangeEvent to all registered listeners.
 public  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.
 public  void setVisible(boolean flag) 
    Sets a flag that controls whether or not the axis is visible and sends an AxisChangeEvent to all registered listeners.