Package jltk.gui

Class Labeled

  • Direct Known Subclasses:
    Button, CheckBox, Label, RadioButton

    public abstract class Labeled
    extends Control
    Abstract class Labled - A class for all components having a label (Button, Checkbox, Label)
    Version:
    13.05.2022
    Author:
    ms
    • Field Detail

      • fxLabledComponent

        javafx.scene.control.Labeled fxLabledComponent
      • font

        protected javafx.scene.text.Font font
    • Constructor Detail

      • Labeled

        public Labeled()
    • Method Detail

      • init

        protected void init​(double pLeft,
                            double pTop,
                            double pWidth,
                            double pHeight,
                            Window pWindow,
                            javafx.scene.control.Labeled pComponent)
      • setText

        public void setText​(String pText)
        Set the text of the labled component.
        Parameters:
        pText -
      • getText

        public String getText()
        Returns the text of the labled component.
        Returns:
      • setUnderline

        public void setUnderline​(boolean pUnderline)
        If the parameter ist true, the text of this component will be underline.
        Parameters:
        pUnderline - true if text should be underline, false if not.
      • isUnderline

        public boolean isUnderline()
        Returns wether the component is underline or not.
        Returns:
      • setFontStyle

        public void setFontStyle​(boolean pBold,
                                 boolean pItalic)
        Set the font style of this labled component.
        Parameters:
        pBold - true if bold, else false
        pItalic - true if italic, else false
      • setFont

        public void setFont​(String pFontName)
        Sets the font family, as parameter you can use e.g. Verdana, Helvetica, Times New Roman, Comic Sans MS, Impact, Lucida Sans Unicode. You can print all available fonts of your system, if you run jltk.util.Misc.printAvailableFontNames().
        Parameters:
        pFont - The font family
      • getFont

        public String getFont()
        Returns the name of the font family (also see setFont()).
        Returns:
        The font family
      • setFontSize

        public void setFontSize​(double pSize)
        Sets the size of the text
        Parameters:
        pSize - The font size
      • getFontSize

        public double getFontSize()
        Returns the font size.
        Returns:
        the font size.
      • setFontColor

        public void setFontColor​(double pRed,
                                 double pGreen,
                                 double pBlue)
        The font color of the component will be changed to specified rgb-color
        Parameters:
        pRed - the red proportion (must be between 0 and 1)
        pGreen - the green proportion (must be between 0 and 1)
        pBlue - the blue proportion (must be between 0 and 1)
      • setFontColor

        public void setFontColor​(javafx.scene.paint.Color pColor)
        The font color of the component will be changed to specified color
        Parameters:
        The - new font color
      • setFontColor

        public void setFontColor​(String pColor)
        The font color of the component will be changed. As Parameter you can use the color name from the javafx.scene.paint.Color field https://docs.oracle.com/javase/8/javafx/api/javafx/scene/paint/Color.html#field.summary For example setFontColor("ALICEBLUE") or setFontColor("blue").
        Parameters:
        pColor - the new font color
      • setTextAlignment

        public void setTextAlignment​(String pAlignment)
        Aligns the text to the specified position
        Parameters:
        pAlignment - Alignment can be left, center, right