Documentation of 'sgtplot.Ruler' Java class
Ruler
sgtplot

Class Ruler

  • All Implemented Interfaces:
    java.lang.Cloneable, LayerChild, Selectable


    public class Ruler
    extends java.lang.Object
    implements java.lang.Cloneable, LayerChild
    Description of Class Ruler
    Since:
    1.0
    • Field Detail

      • HORIZONTAL

        public static final int HORIZONTAL
        Orient Key horizontally.
        See Also:
        Constant Field Values
      • 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

      • Ruler

        public Ruler()
        Default constructor for Ruler.
      • Ruler

        public Ruler(java.lang.String ident)
        Constructor for Ruler. Sets the ruler identifier and initializes the defaults. Default values are:
           numberSmallTics = 0
           largeTicHeightP = 0.1
           smallTicHeightP = 0.05
               ticPosition = NEGATIVE_SIDE
             labelPosition = NEGATIVE_SIDE
             labelInterval = 2
                 labelFont = Font("Helvetica", Font.ITALIC, 10);
              labelHeightP = 0.15
         significantDigits = 2;
               labelFormat = ""
                     title = null
               orientation = HORIZONTAL
                        Id = ""
         
        Parameters:
        id - axis identification
    • Method Detail

      • copy

        public LayerChild copy()
        Description copied from interface: LayerChild
        Create a copy of the LayerChild.
        Specified by:
        copy in interface LayerChild
        Returns:
        A copy of the LayerChild.
      • 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()
        Description copied from interface: Selectable
        Returns true if the object's selected property is set.
        Specified by:
        isSelected in interface Selectable
        Returns:
        true if selected, false if not.
      • setSelectable

        public void setSelectable(boolean select)
        Description copied from interface: Selectable
        Set the Selectable property.
        Specified by:
        setSelectable in interface Selectable
        Parameters:
        select - if true object is selectable
      • isSelectable

        public boolean isSelectable()
        Description copied from interface: Selectable
        Returns true if the current state is selectable.
        Specified by:
        isSelectable in interface Selectable
        Returns:
        true if selectable
      • 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.
      • 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:
        lapb - 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
      • 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
      • setId

        public void setId(java.lang.String id)
        Set the axis identifier.
        Specified by:
        setId in interface LayerChild
        Parameters:
        id - identifier
      • getId

        public java.lang.String getId()
        Set the axis identifier.
        Specified by:
        getId in interface LayerChild
        Parameters:
        id - identifier
        Returns:
        LayerChild identification.
      • setLayer

        public void setLayer(Layer l)
        Description copied from interface: LayerChild
        Associate a Layer with the LayerChild.
        Specified by:
        setLayer in interface LayerChild
        Parameters:
        l - Parent layer.
      • getLayer

        public Layer getLayer()
        Description copied from interface: LayerChild
        Get the associated Layer.
        Specified by:
        getLayer in interface LayerChild
        Returns:
        Associated layer
      • modified

        public void modified(java.lang.String mess)
        Description copied from interface: LayerChild
        Used by sgtplot internally.
        Specified by:
        modified in interface LayerChild
      • setRangeU

        public void setRangeU(Range2D range)
        Change the user unit range of Ruler
      • getRangeU

        public Range2D getRangeU()
      • setBoundsP

        public void setBoundsP(Rectangle2D.Double bounds)
        Set the bounding box for the axis in physical units.
      • getBoundsP

        public Rectangle2D.Double getBoundsP()
        Get the bounding box for the axis in physical units.
        Returns:
        bounding box
      • setOrientation

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

        public int getOrientation()
        Get axis orientation
        Returns:
        axis orientation
      • 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
      • getBounds

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

        public void setBounds(java.awt.Rectangle r)
      • setBounds

        public void setBounds(int x,
                              int y,
                              int width,
                              int height)
      • draw

        public void draw(org.freehep.graphics2d.VectorGraphics g)
        Description copied from interface: LayerChild
        Draw the LayerChild.
        Specified by:
        draw in interface LayerChild
        Parameters:
        g - Graphics context
      • isVisible

        public boolean isVisible()
        Description copied from interface: LayerChild
        Check if LayerChild is visible.
        Specified by:
        isVisible in interface LayerChild
        Returns:
        true if visible
      • setVisible

        public void setVisible(boolean visible)
        Description copied from interface: LayerChild
        Set visibility for a LayerChild.
        Specified by:
        setVisible in interface LayerChild
        Parameters:
        visible - visible if true
      • getLabelInterval

        public int getLabelInterval()
        Since:
        3.0
      • setLabelInterval

        public void setLabelInterval(int labelInterval)
        Since:
        3.0
      • getSignificantDigits

        public int getSignificantDigits()
        Since:
        3.0
      • setSignificantDigits

        public void setSignificantDigits(int sigDigits)
        Since:
        3.0
      • getLabelFormat

        public java.lang.String getLabelFormat()
        Since:
        3.0
      • setLabelFormat

        public void setLabelFormat(java.lang.String labelFormat)
        Since:
        3.0
      • getLabelColor

        public java.awt.Color getLabelColor()
        Since:
        3.0
      • setLabelColor

        public void setLabelColor(java.awt.Color labelColor)
        Since:
        3.0
      • getLineColor

        public java.awt.Color getLineColor()
        Since:
        3.0
      • setLineColor

        public void setLineColor(java.awt.Color lineColor)
        Since:
        3.0

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.