Documentation of 'sgtplot.Axis' Java class
Axis
sgtplot

Class Axis

  • All Implemented Interfaces:
    Selectable
    Direct Known Subclasses:
    SpaceAxis, TimeAxis


    public abstract class Axis
    extends java.lang.Object
    implements Selectable
    Abstract base class for Cartesian axes. Cartesian axes are designed to be used with the CartesianGraph class. Axes and AxisTransforms can be registed with an Axis. This allows changes in both the physical range and user range to be immediatedly updated for the registered AxisTransforms and axes.

    Cartesian axes can have their user coordinates be double values or time (as GeoDate objects). These have been separated into two child objects.

    Since:
    1.0
    See Also:
    SpaceAxis, TimeAxis
    • Field Detail

      • POSITIVE_SIDE

        public static final int POSITIVE_SIDE
        Place the label and/or tic on the positive side of the axis. The right side of VERTICAL axes and the top of HORIZONTAL axes.
        See Also:
        Constant Field Values
      • NEGATIVE_SIDE

        public static final int NEGATIVE_SIDE
        Place the label and/or tic on the negative side of the axis. The left side of VERTICAL axes and the bottom of HORIZONTAL axes.
        See Also:
        Constant Field Values
      • NO_LABEL

        public static final int NO_LABEL
        Do not draw a label and/or tic.
        See Also:
        Constant Field Values
      • BOTH_SIDES

        public static final int BOTH_SIDES
        Draw the tics on both sides of the axes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Axis

        public Axis()
        Default constructor for Axis.
      • Axis

        public Axis(java.lang.String id)
        Constructor for Axis. Sets the axis identifier and initializes the defaults. Default values are:
            numberSmallTics = 0
            largeTicHeightP = 0.1
            smallTicHeightP = 0.05
             thickTicWidth_ = 0.025
                ticPosition = NEGATIVE_SIDE
              labelPosition = NEGATIVE_SIDE
              labelInterval = 2
                  labelFont = Font("Helvetica", Font.ITALIC, 10);
                 labelColor = Color.black;
               labelHeightP = 0.15
          significantDigits = 2;
                labelFormat = ""
                      title = null
                orientation = HORIZONTAL
                 selectable = true
                    visible = true
          
        Parameters:
        id - axis identifier
    • Method Detail

      • copy

        public abstract Axis copy()
        Create a copy of the axis.
        Returns:
        the copy
      • getGraph

        public CartesianGraph getGraph()
        Get the Graph associated with the axis.
        Returns:
        Graph object.
      • getPane

        public AbstractPane getPane()
        Get the parent pane.
        Returns:
        AbstractPane
        Since:
        2.0
      • modified

        public void modified(java.lang.String mess)
        Used internally by sgtplot.
        Since:
        2.0
      • register

        public void register(Axis axis)
        Register an axis. Registered axes will be notified of changes to the user coordinate range.
        Parameters:
        axis - An Axis object.
      • register

        public void register(AxisTransform trns)
        Register an AxisTransform. Registered AxisTransforms will be notified of changes to the user coordinate range and physical coordinate range.
        Parameters:
        trns - A AxisTransform object.
      • clear

        public void clear(Axis axis)
        Unregister an axis. Axis will no longer be notified of changes in the user range.
        Parameters:
        axis - An Axis object.
      • clear

        public void clear(AxisTransform trns)
        Unregister an AxisTransform. The AxisTransform will no longer be notified of changes to the user or physical coordinate range.
        Parameters:
        trns - A AxisTransform ojbect.
      • clearAllRegisteredAxes

        public void clearAllRegisteredAxes()
        Unregister all axes. No axes will be notified of changes in the user range.
      • clearAllRegisteredTransforms

        public void clearAllRegisteredTransforms()
        Unregister all AxisTransforms. No AxisTransforms will be notified of changes in the user of physical range.
      • getNumberRegisteredTransforms

        public int getNumberRegisteredTransforms()
        Get the number of currently registered transforms.
        Returns:
        number of registered transforms
      • getNumberRegisteredAxes

        public int getNumberRegisteredAxes()
        Get the number of currently registered axes.
        Returns:
        number of registered axes
      • setLargeTicHeightP

        public void setLargeTicHeightP(double lthgt)
        Set the large tic height in physical units.
        Parameters:
        lthgt - large tic height.
      • getLargeTicHeightP

        public double getLargeTicHeightP()
        Get the large tic height.
        Returns:
        large tic height in physcial units.
      • setNumberSmallTics

        public void setNumberSmallTics(int nstic)
        Set the number of small tics between large tics.
        Parameters:
        nstic - number of small tics.
      • getNumberSmallTics

        public int getNumberSmallTics()
        Get the number of small tics between large tics.
        Returns:
        number of small tics.
      • setSmallTicHeightP

        public void setSmallTicHeightP(double sthgt)
        Set the small tic height in physical units.
        Parameters:
        sthgt - small tic height.
      • getSmallTicHeightP

        public double getSmallTicHeightP()
        Get the small tic height.
        Returns:
        small tic height in physical units.
      • setThickTicWidthP

        public void setThickTicWidthP(double wid)
        Set the thick tic width in physical units. Minimum thickness is 3 pixels.
        Parameters:
        wid - thick tic width.
      • getThickTicWidthP

        public double getThickTicWidthP()
        Get the thick tic width.
        Returns:
        thick tic width in physical units.
      • setTicPosition

        public void setTicPosition(int tpos)
        Set the tic position. Tic position can be POSITIVE_SIDE, NEGATIVE_SIDE, or BOTH_SIDES.
        Parameters:
        tpos - tic position
      • getTicPosition

        public int getTicPosition()
        Get the tic position.
        Returns:
        tic position
      • setLabelPosition

        public void setLabelPosition(int labp)
        Set the label position. Label position can be POSITIVE_SIDE, NEGATIVE_SIDE, and NO_LABEL.
        Parameters:
        labp - label position.
      • getLabelPosition

        public int getLabelPosition()
        Get the label position.
        Returns:
        label position
      • setLabelFont

        public void setLabelFont(java.awt.Font fnt)
        Set the label font.
        Parameters:
        fnt - label font
      • getLabelFont

        public java.awt.Font getLabelFont()
        Get the label font.
        Returns:
        label font
      • setLineColor

        public void setLineColor(java.awt.Color color)
        Set the line and tick color.
        Parameters:
        color - line and tick color
        Since:
        3.0
      • getLineColor

        public java.awt.Color getLineColor()
        Get the line color.
        Returns:
        color
        Since:
        3.0
      • setLabelColor

        public void setLabelColor(java.awt.Color color)
        Set the label color.
        Parameters:
        color - label color
        Since:
        2.0
      • getLabelColor

        public java.awt.Color getLabelColor()
        Get the label color.
        Returns:
        color
        Since:
        2.0
      • setLabelHeightP

        public void setLabelHeightP(double lhgt)
        Set the label height in physical units.
        Parameters:
        lhgt - label height.
      • getLabelHeightP

        public double getLabelHeightP()
        Get the label height.
        Returns:
        label height
      • setTitle

        public void setTitle(SGLabel title)
        Set the axis title.
        Parameters:
        title - axis title
      • getTitle

        public SGLabel getTitle()
        Get the axis title.
        Returns:
        axis title
      • setRangeP

        public void setRangeP(Range2D pr)
        Set the physical range. This method updates any registered Transforms. If no Transforms are registered, the setRangeP method has no effect.
        Parameters:
        pr - physcial range
      • getRangeP

        public Range2D getRangeP()
        Get the physical range. Obtains the physical range from the associated CartesianGraph object and attached Transform.
        Returns:
        physical range
      • setId

        public void setId(java.lang.String id)
        Set the axis identifier.
        Parameters:
        id - identifier
      • getId

        public java.lang.String getId()
        Get the axis identifier.
        Returns:
        identifier
      • setOrientation

        public void setOrientation(int or)
        Set axis orientation. Allowed orientations are HORIZONATAL and VERTICAL.
        Parameters:
        or - orientation
      • getOrientation

        public int getOrientation()
        Get axis orientation
        Returns:
        axis orientation
      • isSpace

        public boolean isSpace()
        Tests if axis is space.
        Returns:
        true if space
      • isTime

        public boolean isTime()
        Tests if axis is time.
        Returns:
        true if time
      • getBounds

        public abstract java.awt.Rectangle getBounds()
        Get the bounding box for the axis in device units.
        Specified by:
        getBounds in interface Selectable
        Returns:
        bounding box
      • toString

        public java.lang.String toString()
        Get a String representation of the Axis.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation
      • setSelected

        public void setSelected(boolean sel)
        Description copied from interface: Selectable
        Sets the selected property.
        Specified by:
        setSelected in interface Selectable
        Parameters:
        sel - true if selected, false if not.
      • isSelected

        public boolean isSelected()
        Determines if the axis has been selected.
        Specified by:
        isSelected in interface Selectable
        Returns:
        true, if selected
        Since:
        2.0
      • setSelectable

        public void setSelectable(boolean select)
        Set the selectable state.
        Specified by:
        setSelectable in interface Selectable
        Parameters:
        select - if true object is selectable
        Since:
        2.0
      • isSelectable

        public boolean isSelectable()
        Determines if the axis is selectable.
        Specified by:
        isSelectable in interface Selectable
        Returns:
        true if selectable
        Since:
        2.0
      • isVisible

        public boolean isVisible()
        Determines if the axis is visible.
        Since:
        2.0
      • setVisible

        public void setVisible(boolean visible)
        Set the visibility state.
        Since:
        2.0
      • setLocationU

        public abstract void setLocationU(SoTPoint pt)
        Set the axis location.
        Since:
        2.0
      • getSoTLocationU

        public abstract SoTPoint getSoTLocationU()
        Get current axis location.
        Since:
        2.0
      • setRangeU

        public abstract void setRangeU(SoTRange range)
        Set user range.
        Since:
        2.0
      • getSoTRangeU

        public abstract SoTRange getSoTRangeU()
        Get user range.
        Since:
        2.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.