Class JaxoLatexText

    • Constructor Detail

      • JaxoLatexText

        public JaxoLatexText()
    • Method Detail

      • alignForInt

        public static JaxoLatexText.Align alignForInt​(int pos)
        Return the enum as a function of its position in the class declaration.
        Parameters:
        pos - an int.
        Returns:
        an Align enum or null, if nothing corresponds.
      • alignForString

        public static JaxoLatexText.Align alignForString​(String pos)
        Return the enum as a function of its LaTeX text representation.
        Parameters:
        pos - the latex position string.
        Returns:
        an Align enum or null, if nothing corresponds.
      • textSizeForInt

        public static JaxoLatexText.TextSize textSizeForInt​(int size)
        Return the enum as a function of its position in the class declaration.
        Parameters:
        size - an int.
        Returns:
        a TextSize enum or null, if nothing corresponds.
      • textSizeForString

        public static JaxoLatexText.TextSize textSizeForString​(String command)
        Return the enum as a function of its LaTeX text representation.
        Parameters:
        command - the latex command of the text size.
        Returns:
        a TextSize enum or null, if nothing corresponds.
      • getAllign

        public JaxoLatexText.Align getAllign()
        Returns the allign property of this text object.
        Returns:
        The allign property of this text object.
      • setAllign

        public void setAllign​(JaxoLatexText.Align newAllign)
        Sets the allign property of this text object.
        Parameters:
        newAllign - The allign property of this text object.
      • getLatexTextSize

        public JaxoLatexText.TextSize getLatexTextSize()
        Returns the latex font size of this text object.
        Returns:
        The latex font size of this text object.
      • setLatexTextSize

        public void setLatexTextSize​(JaxoLatexText.TextSize newLatexfs)
        Sets the latex font size of this text object.
        Parameters:
        newLatexfs - The latex font size of this text object.
      • getScaleFactor

        public float getScaleFactor()
        Return the scale factor.
        Returns:
        the scale factor.
      • setScaleFactor

        public void setScaleFactor​(float newScale)
        Set the latex font scale factor.
        Parameters:
        newScale - the new scale factor.
      • isValid

        public boolean isValid()
        Check if the current text String is valid.
        Returns:
        true if the current text String is valid.
      • isCopy

        public boolean isCopy​(JaxoObject obj)
        Determines if this JaxoObject is a copy of the specified one.

        Two JaxoObjects are copies of each other if all their editable properties are equal. This method should be synchronized with JaxoObject.copy() such that for any non-null JaxoObject ob, a call like isCopy(ob.copy()) must return true.

        Finally, this method implements an equivalence relation on non-null object references, it should satisfy the same constraints as the Object.equals(java.lang.Object) method.

        Specified by:
        isCopy in interface JaxoObject
        Overrides:
        isCopy in class AbstractTextObject
        Parameters:
        obj - The JaxoObject to compare against. May be null in which case false is returned.
        Returns:
        True if this JaxoObject is a copy of the given one, false otherwise.
        See Also:
        JaxoObject.copy()
      • copyFrom

        protected void copyFrom​(JaxoLatexText temp)
        Sets all parameters from the given object to the current one.
        Parameters:
        temp - The object to copy from.
      • copyFrom

        public void copyFrom​(JaxoObject o)
        Sets all parameters from the given object to the current one.

        This throws an UnsupportedOperationException if the given JaxoObject is not a super- or sub-type of this JaxoObject.

        Parameters:
        o - The object to copy from. This has to be a super- or sub-type of this JaxoObject, otherwise an UnsupportedOperationException is thrown.
      • paint

        public void paint​(Graphics2D g2)
        The method that paints the JaxoObject.
        Parameters:
        g2 - The graphics context where the object has to be painted.
      • scale

        public void scale​(Point origin,
                          float scaleX,
                          float scaleY)
        Rescale the click-points of this JaxoObject by a scale factor, keeping the point origin fixed.
        Specified by:
        scale in interface JaxoObject
        Overrides:
        scale in class AbstractJaxoObject
        Parameters:
        origin - The coordinate of the fixed point.
        scaleX - The scale parameter in x direction.
        scaleY - The scale parameter in y direction.
      • prepareEditPanel

        public void prepareEditPanel​(JaxoObjectEditPanel editPanel)
        Initializes the given editPanel to edit properties of this JaxoObject.
        Parameters:
        editPanel - the panel to prepare.