Documentation of 'edu.rit.numeric.plot.impl.LinearAxis' Java class
LinearAxis
edu.rit.numeric.plot.impl

Class LinearAxis



  • public class LinearAxis
    extends NumericalAxis
    Class LinearAxis provides a linear axis on a plot. The axis goes from a starting value to an ending value in a linear fashion.
    • Constructor Summary

      Constructors 
      Constructor and Description
      LinearAxis(double theStart, double theEnd, int theMajorDivisionCount, int theMinorDivisionCount, double theCrossing, double theLength)
      Construct a new linear axis.
      LinearAxis(double theStart, double theEnd, int theMajorDivisionCount, int theMinorDivisionCount, double theCrossing, double theLength, java.awt.Stroke theStroke, java.awt.Paint thePaint)
      Construct a new linear axis.
      LinearAxis(double theStart, double theEnd, int theMajorDivisionCount, int theMinorDivisionCount, double theCrossing, double theLength, java.awt.Stroke theStroke, java.awt.Paint thePaint, Ticks theTicksBelowOrLeft, Ticks theTicksAboveOrRight)
      Construct a new linear axis.
      LinearAxis(double theStart, double theEnd, int theMajorDivisionCount, int theMinorDivisionCount, double theCrossing, double theLength, Ticks theTicksBelowOrLeft, Ticks theTicksAboveOrRight)
      Construct a new linear axis.
    • Constructor Detail

      • LinearAxis

        public LinearAxis(double theStart,
                          double theEnd,
                          int theMajorDivisionCount,
                          int theMinorDivisionCount,
                          double theCrossing,
                          double theLength)
        Construct a new linear axis. The axis is drawn with the default stroke (solid, width=1) and paint (black). There are no tick marks.
        Parameters:
        theStart - Starting value for this axis.
        theEnd - Ending value for this axis. It can be greater than or less than theStart.
        theMajorDivisionCount - Number of major divisions for this axis.
        theMinorDivisionCount - Number of minor divisions per major division for this axis.
        theCrossing - Point at which the perpendicular axis crosses this axis.
        theLength - Length of this axis on the display.
        Throws:
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theStart equals theEnd. Thrown if theMajorDivisionCount is less than 1. Thrown if theMinorDivisionCount is less than 1. Thrown if theCrossing does not fall between theStart and theEnd inclusive. Thrown if theLength is less than or equal to 0.
      • LinearAxis

        public LinearAxis(double theStart,
                          double theEnd,
                          int theMajorDivisionCount,
                          int theMinorDivisionCount,
                          double theCrossing,
                          double theLength,
                          java.awt.Stroke theStroke,
                          java.awt.Paint thePaint)
        Construct a new linear axis. The axis is drawn with the given stroke and paint. There are no tick marks.
        Parameters:
        theStart - Starting value for this axis.
        theEnd - Ending value for this axis. It can be greater than or less than theStart.
        theMajorDivisionCount - Number of major divisions for this axis.
        theMinorDivisionCount - Number of minor divisions per major division for this axis.
        theCrossing - Point at which the perpendicular axis crosses this axis.
        theLength - Length of this axis on the display.
        theStroke - Stroke for drawing this axis on the display.
        thePaint - Paint for drawing this axis on the display.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theStroke is null or thePaint is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theStart equals theEnd. Thrown if theMajorDivisionCount is less than 1. Thrown if theMinorDivisionCount is less than 1. Thrown if theCrossing does not fall between theStart and theEnd inclusive. Thrown if theLength is less than or equal to 0.
      • LinearAxis

        public LinearAxis(double theStart,
                          double theEnd,
                          int theMajorDivisionCount,
                          int theMinorDivisionCount,
                          double theCrossing,
                          double theLength,
                          Ticks theTicksBelowOrLeft,
                          Ticks theTicksAboveOrRight)
        Construct a new linear axis. The axis is drawn with the default stroke (solid, width=1) and paint (black). There are tick marks on either or both sides of the axis.
        Parameters:
        theStart - Starting value for this axis.
        theEnd - Ending value for this axis. It can be greater than or less than theStart.
        theMajorDivisionCount - Number of major divisions for this axis.
        theMinorDivisionCount - Number of minor divisions per major division for this axis.
        theCrossing - Point at which the perpendicular axis crosses this axis.
        theLength - Length of this axis on the display.
        theTicksBelowOrLeft - Ticks to draw below or to the left of the axis (for a horizontal or vertical axis, respectively). If null, no ticks are drawn below or to the left.
        theTicksAboveOrRight - Ticks to draw above or to the right of the axis (for a horizontal or vertical axis, respectively). If null, no ticks are drawn above or to the right.
        Throws:
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theStart equals theEnd. Thrown if theMajorDivisionCount is less than 1. Thrown if theMinorDivisionCount is less than 1. Thrown if theCrossing does not fall between theStart and theEnd inclusive. Thrown if theLength is less than or equal to 0.
      • LinearAxis

        public LinearAxis(double theStart,
                          double theEnd,
                          int theMajorDivisionCount,
                          int theMinorDivisionCount,
                          double theCrossing,
                          double theLength,
                          java.awt.Stroke theStroke,
                          java.awt.Paint thePaint,
                          Ticks theTicksBelowOrLeft,
                          Ticks theTicksAboveOrRight)
        Construct a new linear axis. The axis is drawn with the given stroke and paint. There are tick marks on either or both sides of the axis.
        Parameters:
        theStart - Starting value for this axis.
        theEnd - Ending value for this axis. It can be greater than or less than theStart.
        theMajorDivisionCount - Number of major divisions for this axis.
        theMinorDivisionCount - Number of minor divisions per major division for this axis.
        theCrossing - Point at which the perpendicular axis crosses this axis.
        theLength - Length of this axis on the display.
        theStroke - Stroke for drawing this axis on the display.
        thePaint - Paint for drawing this axis on the display.
        theTicksBelowOrLeft - Ticks to draw below or to the left of the axis (for a horizontal or vertical axis, respectively). If null, no ticks are drawn below or to the left.
        theTicksAboveOrRight - Ticks to draw above or to the right of the axis (for a horizontal or vertical axis, respectively). If null, no ticks are drawn above or to the right.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theStroke is null or thePaint is null.
        java.lang.IllegalArgumentException - (unchecked exception) Thrown if theStart equals theEnd. Thrown if theMajorDivisionCount is less than 1. Thrown if theMinorDivisionCount is less than 1. Thrown if theCrossing does not fall between theStart and theEnd inclusive. Thrown if theLength is less than or equal to 0.
    • Method Detail

      • getStart

        public double getStart()
        Returns the starting value of this axis. The starting value is the value at the left or bottom end of the axis for a horizontal or vertical orientation, respectively.
        Specified by:
        getStart in class NumericalAxis
      • getEnd

        public double getEnd()
        Returns the ending value of this axis. The ending value is the value at the right or top end of the axis for a horizontal or vertical orientation, respectively. Note that the ending value may be greater than or less than the starting value.
        Specified by:
        getEnd in class NumericalAxis
      • includesValue

        public boolean includesValue(double value)
        Returns true if the given value falls within the bounds of this axis, false otherwise.
        Specified by:
        includesValue in class NumericalAxis
      • getDisplayDistance

        public double getDisplayDistance(double value)
        Returns the distance on the display from the start of this axis to the given value.
        Specified by:
        getDisplayDistance in class NumericalAxis
      • getMajorDivisionCount

        public int getMajorDivisionCount()
        Returns the number of major divisions on this axis.
        Specified by:
        getMajorDivisionCount in class NumericalAxis
      • getMajorDivision

        public double getMajorDivision(int i)
        Returns the value of the given major division.
        Specified by:
        getMajorDivision in class NumericalAxis
        Parameters:
        i - Major division index in the range 0 .. getMajorDivisionCount().
      • getMinorDivisionCount

        public int getMinorDivisionCount()
        Returns the number of minor divisions on this axis.
        Specified by:
        getMinorDivisionCount in class NumericalAxis
      • getMinorDivision

        public double getMinorDivision(int i)
        Returns the value of the given minor division.
        Specified by:
        getMinorDivision in class NumericalAxis
        Parameters:
        i - Minor division index in the range 0 .. getMinorDivisionCount().
      • getCrossing

        public double getCrossing()
        Returns the value of the point where the perpendicular axis crosses this axis.
        Specified by:
        getCrossing in class NumericalAxis
      • autoscale

        public static double autoscale(double max)
        Determine a pleasing scale for a linear axis. The input, max, is the largest value to be displayed along the axis. The output is the smallest number of the form 1x10k, 2x10k, or 5x10k, k an integer, that is greater than or equal to max. This can then be used as the maximum value for the axis.

        Note: The autoscale() method works for negative inputs. If max < 0, then autoscale(max) = -autoscale(-max).

        Note: autoscale(0) = 0.

        Parameters:
        max - Maximum value to be displayed along the axis.
        Returns:
        Maximum value for the axis.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.