Documentation of 'jhplot.HLabelEq' Java class.
HLabelEq
jhplot

Class HLabelEq

  • All Implemented Interfaces:
    java.io.Serializable


    public class HLabelEq
    extends java.lang.Object
    implements java.io.Serializable
    Create an equation using the LaTex syntax on HPlot canvas. The equation position can be defined in the NDC (normalized coordinate system) or the user coordinate.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      HLabelEq(java.lang.String s)
      Make a label with default attributes
      HLabelEq(java.lang.String s, double x, double y)
      Make a equation label with specific coordinated in the data system
      HLabelEq(java.lang.String s, double x, double y, java.lang.String howToSet)
      Make a label with specific coordinates.
      HLabelEq(java.lang.String s, int f)
      Make a equation label (color- black)
      HLabelEq(java.lang.String s, int f, java.awt.Color c)
      Make a label with equation using the LaTeX syntax
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void doc()
      Show online documentation.
      java.awt.Color getColor()
      Get color of the label.
      java.awt.Color getColorBackground()
      Get color of background.
      int getFontSize()
      Get the font size of the equation.
      java.awt.image.BufferedImage getImage()
      Return image of this equation
      boolean getImageFile(java.lang.String fileName)
      Return image of this equation as a file.
      int getPositionCoordinate()
      Is the position set?
      java.lang.String getText()
      Get the equation text of the label.
      double getX()
      Returns the X position of the text.
      double getY()
      Returns the Y position of the text.
      void setColor(java.awt.Color c)
      Sets the color to a specific value
      void setColorBackgroud(java.awt.Color c)
      Set background color
      void setFontSize(int f)
      Sets the font to a specific value
      void setLocation(double x, double y)
      Sets the location of the label in data coordinates.
      void setLocation(double x, double y, java.lang.String howToSet)
      Sets the location of the label in data coordinates.
      void setText(java.lang.String s)
      Sets a equation text of the label.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • HLabelEq

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

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

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

        public HLabelEq(java.lang.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(java.lang.String s,
                        double x,
                        double y,
                        java.lang.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(java.lang.String s)
        Sets a equation text of the label.
        Parameters:
        s - new text for the label
      • getText

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

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

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

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

        public java.awt.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 java.awt.image.BufferedImage getImage()
        Return image of this equation
        Returns:
      • getImageFile

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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,
                                java.lang.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.

DMelt 3.0 © DataMelt by jWork.ORG