Class JSmoothLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
LabelViewer, SimpleStateViewer, SimpleStateViewer, UnitViewer

public class JSmoothLabel extends JComponent
A Label that have anti-aliased font and that supports Matrix positionning.
See Also:
  • Field Details

    • CENTER_ALIGNMENT

      public static int CENTER_ALIGNMENT
      Text is centered
    • LEFT_ALIGNMENT

      public static int LEFT_ALIGNMENT
      Text is left aligned
    • RIGHT_ALIGNMENT

      public static int RIGHT_ALIGNMENT
      Text is right aligned
    • CLASSIC_BEHAVIOR

      public static int CLASSIC_BEHAVIOR
      Computes font size and return the minimun/preferred size to the layout manager
    • MATRIX_BEHAVIOR

      public static int MATRIX_BEHAVIOR
      Does not compute font size and let the layout manager size the component.Usefull with GridLayout.
  • Constructor Details

    • JSmoothLabel

      public JSmoothLabel()
  • Method Details

    • setText

      public void setText(String txt)
      Sets the text.
      Parameters:
      txt - Text
    • getText

      public String getText()
      Gets the text.
      Returns:
      Text
    • setVerticalOffset

      public void setVerticalOffset(int y)
      Sets the text vertical offset in pixel.
      Parameters:
      y - Offset value
    • getVerticalOffset

      public int getVerticalOffset()
      Returns the current text vertical offset.
      Returns:
      Vertical offset
    • setValueOffsets

      public void setValueOffsets(int x, int y)
      Deprecated.
      Has no longer effects.
      Parameters:
      x - Not used
      y - Not used
      See Also:
    • setSizingBehavior

      public void setSizingBehavior(int s)
      Sets the sizing behavior.
      Parameters:
      s - Sizing behavior
      See Also:
    • getSizingBehavior

      public int getSizingBehavior()
      Gets the sizing behavior.
      Returns:
      Actual sizing behavior
      See Also:
    • setHorizontalAlignment

      public void setHorizontalAlignment(int a)
    • getHorizontalAlignment

      public int getHorizontalAlignment()
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent