Package HAL.Gui

Class UILabel

  • All Implemented Interfaces:
    GuiComp

    public class UILabel
    extends java.lang.Object
    implements GuiComp
    a gui item that presents text
    • Field Summary

      Fields 
      Modifier and Type Field Description
      javax.swing.JLabel label  
    • Constructor Summary

      Constructors 
      Constructor Description
      UILabel​(java.lang.String text)  
      UILabel​(java.lang.String text, boolean active)  
      UILabel​(java.lang.String text, int compX, int compY)  
      UILabel​(java.lang.String text, int compX, int compY, boolean active)  
    • Method Summary

      Modifier and Type Method Description
      void _GetComps​(java.util.ArrayList<java.awt.Component> putHere, java.util.ArrayList<java.lang.Integer> putCoordsHere, java.util.ArrayList<java.lang.Integer> compSizesHere)
      called by the UIWindow class to place the label
      int compX()
      gets the xDim component of the label
      int compY()
      gets the yDim component of the label
      java.lang.String GetText()  
      boolean IsActive()  
      void SetActive​(boolean isActive)  
      UILabel SetColor​(int foregroundColor, int backgroundColor)  
      UILabel SetColor​(java.awt.Color foregroundColor, java.awt.Color backgroundColor)
      sets the foreground and background of the UILabel
      void SetText​(java.lang.String text)  
      • Methods inherited from class java.lang.Object

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

      • label

        public final javax.swing.JLabel label
    • Constructor Detail

      • UILabel

        public UILabel​(java.lang.String text,
                       int compX,
                       int compY,
                       boolean active)
        Parameters:
        text - label text
        compX - width on the gui GridBagLayout GridBagLayout
        compY - height on the gui GridBagLayout GridBagLayout
      • UILabel

        public UILabel​(java.lang.String text,
                       int compX,
                       int compY)
      • UILabel

        public UILabel​(java.lang.String text,
                       boolean active)
        Parameters:
        text - label text
      • UILabel

        public UILabel​(java.lang.String text)
    • Method Detail

      • compX

        public int compX()
        gets the xDim component of the label
        Specified by:
        compX in interface GuiComp
      • compY

        public int compY()
        gets the yDim component of the label
        Specified by:
        compY in interface GuiComp
      • IsActive

        public boolean IsActive()
        Specified by:
        IsActive in interface GuiComp
      • SetActive

        public void SetActive​(boolean isActive)
        Specified by:
        SetActive in interface GuiComp
      • GetText

        public java.lang.String GetText()
      • SetText

        public void SetText​(java.lang.String text)
      • SetColor

        public UILabel SetColor​(java.awt.Color foregroundColor,
                                java.awt.Color backgroundColor)
        sets the foreground and background of the UILabel
        Parameters:
        foregroundColor - color of the text if null the UIWindow color will be used
        backgroundColor - color of the background, if null the UIWindow color will be used
      • SetColor

        public UILabel SetColor​(int foregroundColor,
                                int backgroundColor)
      • _GetComps

        public void _GetComps​(java.util.ArrayList<java.awt.Component> putHere,
                              java.util.ArrayList<java.lang.Integer> putCoordsHere,
                              java.util.ArrayList<java.lang.Integer> compSizesHere)
        called by the UIWindow class to place the label
        Specified by:
        _GetComps in interface GuiComp