Axis
org.jfree.chart.axis

Class Axis

    • Field Detail

      • DEFAULT_AXIS_VISIBLE

        public static final boolean DEFAULT_AXIS_VISIBLE
        The default axis visibility.
        See Also:
        Constant Field Values
      • DEFAULT_AXIS_LABEL_FONT

        public static final Font DEFAULT_AXIS_LABEL_FONT
        The default axis label font.
      • DEFAULT_AXIS_LABEL_PAINT

        public static final Paint DEFAULT_AXIS_LABEL_PAINT
        The default axis label paint.
      • DEFAULT_AXIS_LABEL_INSETS

        public static final org.jfree.ui.RectangleInsets DEFAULT_AXIS_LABEL_INSETS
        The default axis label insets.
      • DEFAULT_AXIS_LINE_PAINT

        public static final Paint DEFAULT_AXIS_LINE_PAINT
        The default axis line paint.
      • DEFAULT_AXIS_LINE_STROKE

        public static final Stroke DEFAULT_AXIS_LINE_STROKE
        The default axis line stroke.
      • DEFAULT_TICK_LABELS_VISIBLE

        public static final boolean DEFAULT_TICK_LABELS_VISIBLE
        The default tick labels visibility.
        See Also:
        Constant Field Values
      • DEFAULT_TICK_LABEL_FONT

        public static final Font DEFAULT_TICK_LABEL_FONT
        The default tick label font.
      • DEFAULT_TICK_LABEL_PAINT

        public static final Paint DEFAULT_TICK_LABEL_PAINT
        The default tick label paint.
      • DEFAULT_TICK_LABEL_INSETS

        public static final org.jfree.ui.RectangleInsets DEFAULT_TICK_LABEL_INSETS
        The default tick label insets.
      • DEFAULT_TICK_MARKS_VISIBLE

        public static final boolean DEFAULT_TICK_MARKS_VISIBLE
        The default tick marks visible.
        See Also:
        Constant Field Values
      • DEFAULT_TICK_MARK_STROKE

        public static final Stroke DEFAULT_TICK_MARK_STROKE
        The default tick stroke.
      • DEFAULT_TICK_MARK_PAINT

        public static final Paint DEFAULT_TICK_MARK_PAINT
        The default tick paint.
      • DEFAULT_TICK_MARK_INSIDE_LENGTH

        public static final float DEFAULT_TICK_MARK_INSIDE_LENGTH
        The default tick mark inside length.
        See Also:
        Constant Field Values
      • DEFAULT_TICK_MARK_OUTSIDE_LENGTH

        public static final float DEFAULT_TICK_MARK_OUTSIDE_LENGTH
        The default tick mark outside length.
        See Also:
        Constant Field Values
    • Method Detail

      • isVisible

        public boolean isVisible()
        Returns true if the axis is visible, and false otherwise.
        Returns:
        A boolean.
        See Also:
        setVisible(boolean)
      • setVisible

        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.
        Parameters:
        flag - the flag.
        See Also:
        isVisible()
      • getLabelFont

        public Font getLabelFont()
        Returns the font for the axis label.
        Returns:
        The font (never null).
        See Also:
        setLabelFont(Font)
      • setLabelFont

        public void setLabelFont(Font font)
        Sets the font for the axis label and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        font - the font (null not permitted).
        See Also:
        getLabelFont()
      • getLabelPaint

        public Paint getLabelPaint()
        Returns the color/shade used to draw the axis label.
        Returns:
        The paint (never null).
        See Also:
        setLabelPaint(Paint)
      • setLabelPaint

        public void setLabelPaint(Paint paint)
        Sets the paint used to draw the axis label and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getLabelPaint()
      • getLabelInsets

        public org.jfree.ui.RectangleInsets getLabelInsets()
        Returns the insets for the label (that is, the amount of blank space that should be left around the label).
        Returns:
        The label insets (never null).
        See Also:
        setLabelInsets(RectangleInsets)
      • setLabelInsets

        public void setLabelInsets(org.jfree.ui.RectangleInsets insets)
        Sets the insets for the axis label, and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        insets - the insets (null not permitted).
        See Also:
        getLabelInsets()
      • setLabelInsets

        public void setLabelInsets(org.jfree.ui.RectangleInsets insets,                  boolean notify)
        Sets the insets for the axis label, and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        insets - the insets (null not permitted).
        notify - notify listeners?
      • getLabelAngle

        public double getLabelAngle()
        Returns the angle of the axis label.
        Returns:
        The angle (in radians).
        See Also:
        setLabelAngle(double)
      • setLabelAngle

        public void setLabelAngle(double angle)
        Sets the angle for the label and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        angle - the angle (in radians).
        See Also:
        getLabelAngle()
      • getAxisLinePaint

        public Paint getAxisLinePaint()
        Returns the paint used to draw the axis line.
        Returns:
        The paint (never null).
        See Also:
        setAxisLinePaint(Paint)
      • setAxisLinePaint

        public void setAxisLinePaint(Paint paint)
        Sets the paint used to draw the axis line and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getAxisLinePaint()
      • getAxisLineStroke

        public Stroke getAxisLineStroke()
        Returns the stroke used to draw the axis line.
        Returns:
        The stroke (never null).
        See Also:
        setAxisLineStroke(Stroke)
      • setAxisLineStroke

        public void setAxisLineStroke(Stroke stroke)
        Sets the stroke used to draw the axis line and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getAxisLineStroke()
      • isMinorTickMarksVisible

        public boolean isMinorTickMarksVisible()
        Returns the flag that indicates whether or not the minor tick marks are showing.
        Returns:
        The flag that indicates whether or not the minor tick marks are showing.
        See Also:
        setMinorTickMarksVisible(boolean)
      • setMinorTickMarksVisible

        public void setMinorTickMarksVisible(boolean flag)
        Sets the flag that indicates whether or not the minor tick marks are showing and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        flag - the flag.
        See Also:
        isMinorTickMarksVisible()
      • getTickLabelFont

        public Font getTickLabelFont()
        Returns the font used for the tick labels (if showing).
        Returns:
        The font (never null).
        See Also:
        setTickLabelFont(Font)
      • setTickLabelFont

        public void setTickLabelFont(Font font)
        Sets the font for the tick labels and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        font - the font (null not allowed).
        See Also:
        getTickLabelFont()
      • getTickLabelPaint

        public Paint getTickLabelPaint()
        Returns the color/shade used for the tick labels.
        Returns:
        The paint used for the tick labels.
        See Also:
        setTickLabelPaint(Paint)
      • setTickLabelPaint

        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.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getTickLabelPaint()
      • getTickLabelInsets

        public org.jfree.ui.RectangleInsets getTickLabelInsets()
        Returns the insets for the tick labels.
        Returns:
        The insets (never null).
        See Also:
        setTickLabelInsets(RectangleInsets)
      • setTickLabelInsets

        public void setTickLabelInsets(org.jfree.ui.RectangleInsets insets)
        Sets the insets for the tick labels and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        insets - the insets (null not permitted).
        See Also:
        getTickLabelInsets()
      • isTickMarksVisible

        public boolean isTickMarksVisible()
        Returns the flag that indicates whether or not the tick marks are showing.
        Returns:
        The flag that indicates whether or not the tick marks are showing.
        See Also:
        setTickMarksVisible(boolean)
      • setTickMarksVisible

        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.
        Parameters:
        flag - the flag.
        See Also:
        isTickMarksVisible()
      • setTickMarkInsideLength

        public void setTickMarkInsideLength(float length)
        Sets the inside length of the tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        length - the new length.
        See Also:
        getTickMarkInsideLength()
      • setTickMarkOutsideLength

        public void setTickMarkOutsideLength(float length)
        Sets the outside length of the tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        length - the new length.
        See Also:
        getTickMarkInsideLength()
      • getTickMarkStroke

        public Stroke getTickMarkStroke()
        Returns the stroke used to draw tick marks.
        Returns:
        The stroke (never null).
        See Also:
        setTickMarkStroke(Stroke)
      • setTickMarkStroke

        public void setTickMarkStroke(Stroke stroke)
        Sets the stroke used to draw tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        See Also:
        getTickMarkStroke()
      • getTickMarkPaint

        public Paint getTickMarkPaint()
        Returns the paint used to draw tick marks (if they are showing).
        Returns:
        The paint (never null).
        See Also:
        setTickMarkPaint(Paint)
      • setTickMarkPaint

        public void setTickMarkPaint(Paint paint)
        Sets the paint used to draw tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getTickMarkPaint()
      • setMinorTickMarkInsideLength

        public void setMinorTickMarkInsideLength(float length)
        Sets the inside length of the minor tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        length - the new length.
        See Also:
        getMinorTickMarkInsideLength()
      • setMinorTickMarkOutsideLength

        public void setMinorTickMarkOutsideLength(float length)
        Sets the outside length of the minor tick marks and sends an AxisChangeEvent to all registered listeners.
        Parameters:
        length - the new length.
        See Also:
        getMinorTickMarkInsideLength()
      • getPlot

        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.
        Returns:
        The plot that the axis is assigned to (possibly null).
        See Also:
        setPlot(Plot)
      • setPlot

        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.

        Parameters:
        plot - the plot.
        See Also:
        getPlot()
      • getFixedDimension

        public double getFixedDimension()
        Returns the fixed dimension for the axis.
        Returns:
        The fixed dimension.
        See Also:
        setFixedDimension(double)
      • setFixedDimension

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

        Parameters:
        dimension - the fixed dimension.
        See Also:
        getFixedDimension()
      • configure

        public abstract void configure()
        Configures the axis to work with the current plot. Override this method to perform any special processing (such as auto-rescaling).
      • reserveSpace

        public abstract AxisSpace reserveSpace(Graphics2D g2,                     Plot plot,                     Rectangle2D plotArea,                     org.jfree.ui.RectangleEdge edge,                     AxisSpace space)
        Estimates the space (height or width) required to draw the axis.
        Parameters:
        g2 - the graphics device.
        plot - the plot that the axis belongs to.
        plotArea - the area within which the plot (including axes) should be drawn.
        edge - the axis location.
        space - space already reserved.
        Returns:
        The space required to draw the axis (including pre-reserved space).
      • draw

        public abstract 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).
        Parameters:
        g2 - the graphics device (null not permitted).
        cursor - the cursor location (determines where to draw the axis).
        plotArea - the area within which the axes and plot should be drawn.
        dataArea - the area within which the data should be drawn.
        edge - the axis location (null not permitted).
        plotState - collects information about the plot (null permitted).
        Returns:
        The axis state (never null).
      • refreshTicks

        public abstract List refreshTicks(Graphics2D g2,                AxisState state,                Rectangle2D dataArea,                org.jfree.ui.RectangleEdge edge)
        Calculates the positions of the ticks for the axis, storing the results in the tick list (ready for drawing).
        Parameters:
        g2 - the graphics device.
        state - the axis state.
        dataArea - the area inside the axes.
        edge - the edge on which the axis is located.
        Returns:
        The list of ticks.
      • hasListener

        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.
        Parameters:
        listener - the listener.
        Returns:
        A boolean.
      • equals

        public boolean equals(Object obj)
        Tests this axis for equality with another object.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object (null permitted).
        Returns:
        true or false.

SCaVis 1.7 © jWork.org