HLabelEq
jhplot

Class HLabelEq

  • All Implemented Interfaces:
    Serializable


    public class HLabelEqextends Objectimplements Serializable
    Create an equation using the LaTex syntax. The equation position can be defined in the NDC (normalized coordinate system) or the user coordinate.
    See Also:
    Serialized Form
    • Constructor Detail

      • HLabelEq

        public HLabelEq(String s,        int f,        Color c)
        Make a label with equation using the LaTeX syntax
        Parameters:
        s - Text
        f - Font size
        c - Color
      • HLabelEq

        public HLabelEq(String s,        int f)
        Make a equation label (color- black)
        Parameters:
        s - Text
        f - Font size
      • HLabelEq

        public HLabelEq(String s)
        Make a label with default attributes
        Parameters:
        s - text
      • HLabelEq

        public HLabelEq(String s,        double x,        double y)
        Make a equation label with specific coordinated in the data system
        Parameters:
        s - Text
        x - Position in X
        y - Position in Y
      • HLabelEq

        public HLabelEq(String s,        double x,        double y,        String howToSet)
        Make a label with specific coordinates.
        Parameters:
        s - Text
        x - position in X
        y - position in Y
        howToSet - set it to "NDC" for normalized coordinates (in the range 0-1). This is a data independent position set it to "USER" for the user coordinates
    • Method Detail

      • setText

        public void setText(String s)
        Sets a equation text of the label.
        Parameters:
        s - new text for the label
      • getText

        public String getText()
        Get the equation text of the label.
        Returns:
        the current text of the label
      • setColor

        public void setColor(Color c)
        Sets the color to a specific value
        Parameters:
        c - color used to draw the label
      • setColorBackgroud

        public void setColorBackgroud(Color c)
        Set background color
        Parameters:
        c -
      • getColor

        public Color getColor()
        Get color of the label.
        Returns:
        the color used to draw the label
      • getColorBackground

        public Color getColorBackground()
        Get color of background.
        Returns:
        the color used to draw the label
      • setFontSize

        public void setFontSize(int f)
        Sets the font to a specific value
        Parameters:
        f - font size used to draw the label
      • getFontSize

        public int getFontSize()
        Get the font size of the equation.
        Returns:
        the font used to draw the label
      • getImage

        public BufferedImage getImage()
        Return image of this equation
        Returns:
      • getImageFile

        public boolean getImageFile(String fileName)
        Return image of this equation as a file. Example of the extension is ".png" or ".jpg".
        Returns:
        success
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        a string representation of this label, the text.
      • setLocation

        public void setLocation(double x,               double y)
        Sets the location of the label in data coordinates. Ones set this way, you cannot plot the label, it must first define the location in pixel-coordinates (setLocation(x,y));
        Parameters:
        x - x-position of the lower-left corner of the text
        y - y-position of the lower-left corner of the text
      • setLocation

        public void setLocation(double x,               double y,               String howToSet)
        Sets the location of the label in data coordinates. Ones set this way, you cannot plot the label, it must first define the location in pixel-coordinates (setLocation(x,y));
        Parameters:
        x - x-position of the lower-left corner of the text
        y - y-position of the lower-left corner of the text
        howToSet - set it to "NDC" for normalized coordinates (in the range 0-1). This is a data independent position set it to "USER" for the user coordinates
      • getPositionCoordinate

        public int getPositionCoordinate()
        Is the position set?
        Returns:
        zero if location is not defined of unity if the position is defined in the NDC system 2 if the location is defined in the user coordinates
      • getX

        public double getX()
        Returns the X position of the text.
        Returns:
        the x-position of the text
      • getY

        public double getY()
        Returns the Y position of the text.
        Returns:
        the y-position of the text
      • doc

        public void doc()
        Show online documentation.

SCaVis 2.1 © jWork.ORG