Documentation of 'sgtplot.LabelDrawer2D' Java class
LabelDrawer2D
sgtplot

Class LabelDrawer2D

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, LabelDrawer


    public class LabelDrawer2D
    extends java.lang.Object
    implements LabelDrawer, java.lang.Cloneable
    Implements label drawing using Java2D functionality.
    Since:
    2.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      LabelDrawer2D(java.lang.String lbl, double hgt, Point2D.Double loc, int valign, int halign) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      LabelDrawer copy() 
      void draw(org.freehep.graphics2d.VectorGraphics g)
      Used internally by sgtplot.
      double getAngle()
      Get label drawing angle.
      java.awt.Rectangle getBounds()
      Get the label bounds in device units.
      Rectangle2D.Double getBoundsP()
      Get the label reference location in physcial coordinates.
      java.awt.Color getColor()
      Get the color.
      java.awt.Font getFont()
      Get the font.
      int getHAlign()
      Get the horizontal alignment.
      double getHeightP()
      Get the label height in physical coordinates.
      Layer getLayer()
      Get the layer.
      java.awt.Point getLocation()
      Get the label position in device coordinates.
      Point2D.Double getLocationP()
      Get the label reference location in physcial coordinates.
      int getOrientation()
      Get the origentation.
      float getStringHeight(org.freehep.graphics2d.VectorGraphics g2)
      Get the string height in device units.
      float getStringWidth(org.freehep.graphics2d.VectorGraphics g)
      Get the string width in device units.
      java.lang.String getText()
      Get the label text.
      int getVAlign()
      Get the vertical alignment.
      boolean isVisible()
      Is label visible?
      void setAngle(double angle)
      Draw label at arbitrary rotation.
      void setBounds(int x, int y, int width, int height)
      Set the label bounds in device units.
      void setColor(java.awt.Color clr)
      Set the color.
      void setFont(java.awt.Font font)
      Set the font.
      void setHAlign(int halign)
      Set the horizontal alignment.
      void setHeightP(double hgt)
      Set the height of the label in physical coordinates.
      void setLayer(Layer layer)
      Used internally by sgtplot.
      void setLocation(java.awt.Point loc)
      Set the label position in device coordinates.
      void setLocationP(Point2D.Double loc)
      Set the label reference location in physcial coordinates.
      void setOrientation(int orient)
      Set the orientation.
      void setText(java.lang.String lbl)
      Set the label text.
      void setVAlign(int valign)
      Set the vertical alignment.
      void setVisible(boolean vis)
      Set visibility of label.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LabelDrawer2D

        public LabelDrawer2D(java.lang.String lbl,
                             double hgt,
                             Point2D.Double loc,
                             int valign,
                             int halign)
    • Method Detail

      • setText

        public void setText(java.lang.String lbl)
        Description copied from interface: LabelDrawer
        Set the label text.
        Specified by:
        setText in interface LabelDrawer
        Parameters:
        lbl - the label text
      • getText

        public java.lang.String getText()
        Description copied from interface: LabelDrawer
        Get the label text.
        Specified by:
        getText in interface LabelDrawer
        Returns:
        the label text
      • setColor

        public void setColor(java.awt.Color clr)
        Description copied from interface: LabelDrawer
        Set the color.
        Specified by:
        setColor in interface LabelDrawer
        See Also:
        Color
      • getColor

        public java.awt.Color getColor()
        Description copied from interface: LabelDrawer
        Get the color.
        Specified by:
        getColor in interface LabelDrawer
        Returns:
        The current color of the label.
      • setFont

        public void setFont(java.awt.Font font)
        Description copied from interface: LabelDrawer
        Set the font.
        Specified by:
        setFont in interface LabelDrawer
        See Also:
        Font
      • getFont

        public java.awt.Font getFont()
        Description copied from interface: LabelDrawer
        Get the font.
        Specified by:
        getFont in interface LabelDrawer
        Returns:
        The current font for the label.
      • getLayer

        public Layer getLayer()
        Description copied from interface: LabelDrawer
        Get the layer.
        Specified by:
        getLayer in interface LabelDrawer
        Returns:
        the layer object.
      • setOrientation

        public void setOrientation(int orient)
        Description copied from interface: LabelDrawer
        Set the orientation. The orientation can be HORIZONTAL or VERTICAL.
        Specified by:
        setOrientation in interface LabelDrawer
        Parameters:
        orient - The orientation.
      • getOrientation

        public int getOrientation()
        Description copied from interface: LabelDrawer
        Get the origentation.
        Specified by:
        getOrientation in interface LabelDrawer
        Returns:
        the orientation
      • setHAlign

        public void setHAlign(int halign)
        Description copied from interface: LabelDrawer
        Set the horizontal alignment. The alignment can be LEFT, CENTER, or RIGHT.
        Specified by:
        setHAlign in interface LabelDrawer
      • getHAlign

        public int getHAlign()
        Description copied from interface: LabelDrawer
        Get the horizontal alignment.
        Specified by:
        getHAlign in interface LabelDrawer
        Returns:
        the horizontal alignment.
      • setVAlign

        public void setVAlign(int valign)
        Description copied from interface: LabelDrawer
        Set the vertical alignment. The alignment can be TOP, MIDDLE, or BOTTOM.
        Specified by:
        setVAlign in interface LabelDrawer
      • getVAlign

        public int getVAlign()
        Description copied from interface: LabelDrawer
        Get the vertical alignment.
        Specified by:
        getVAlign in interface LabelDrawer
        Returns:
        the vertical alignment.
      • setLocation

        public void setLocation(java.awt.Point loc)
        Description copied from interface: LabelDrawer
        Set the label position in device coordinates.
        Specified by:
        setLocation in interface LabelDrawer
        Parameters:
        loc - label position
      • getLocation

        public java.awt.Point getLocation()
        Description copied from interface: LabelDrawer
        Get the label position in device coordinates.
        Specified by:
        getLocation in interface LabelDrawer
        Returns:
        the label position
      • setBounds

        public void setBounds(int x,
                              int y,
                              int width,
                              int height)
        Description copied from interface: LabelDrawer
        Set the label bounds in device units.
        Specified by:
        setBounds in interface LabelDrawer
        Parameters:
        x - x location of label
        y - y location of label
        width - label width
        height - label height
      • getBounds

        public java.awt.Rectangle getBounds()
        Description copied from interface: LabelDrawer
        Get the label bounds in device units.
        Specified by:
        getBounds in interface LabelDrawer
        Returns:
        the label bounds
      • setLocationP

        public void setLocationP(Point2D.Double loc)
        Description copied from interface: LabelDrawer
        Set the label reference location in physcial coordinates.
        Specified by:
        setLocationP in interface LabelDrawer
        Parameters:
        loc - physical location of label
      • getLocationP

        public Point2D.Double getLocationP()
        Description copied from interface: LabelDrawer
        Get the label reference location in physcial coordinates.
        Specified by:
        getLocationP in interface LabelDrawer
        Returns:
        the labels position.
      • setAngle

        public void setAngle(double angle)
        Description copied from interface: LabelDrawer
        Draw label at arbitrary rotation. Warning: Rotated labels are not drawn very well when using JDK1.1. For best results use JDK1.2 or newer.
        Specified by:
        setAngle in interface LabelDrawer
      • getAngle

        public double getAngle()
        Description copied from interface: LabelDrawer
        Get label drawing angle.
        Specified by:
        getAngle in interface LabelDrawer
      • setHeightP

        public void setHeightP(double hgt)
        Description copied from interface: LabelDrawer
        Set the height of the label in physical coordinates.
        Specified by:
        setHeightP in interface LabelDrawer
        Parameters:
        hgt - The label height.
      • getHeightP

        public double getHeightP()
        Description copied from interface: LabelDrawer
        Get the label height in physical coordinates.
        Specified by:
        getHeightP in interface LabelDrawer
        Returns:
        The label height.
      • setVisible

        public void setVisible(boolean vis)
        Description copied from interface: LabelDrawer
        Set visibility of label.
        Specified by:
        setVisible in interface LabelDrawer
      • isVisible

        public boolean isVisible()
        Description copied from interface: LabelDrawer
        Is label visible?
        Specified by:
        isVisible in interface LabelDrawer
      • getStringWidth

        public float getStringWidth(org.freehep.graphics2d.VectorGraphics g)
        Description copied from interface: LabelDrawer
        Get the string width in device units.
        Specified by:
        getStringWidth in interface LabelDrawer
      • getStringHeight

        public float getStringHeight(org.freehep.graphics2d.VectorGraphics g2)
        Description copied from interface: LabelDrawer
        Get the string height in device units.
        Specified by:
        getStringHeight in interface LabelDrawer

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.