Class TextIcon

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.Icon

    public class TextIcon
    extends java.lang.Object
    implements javax.swing.Icon, java.beans.PropertyChangeListener
    Author:
    Andreas Ernst, Christopher Butler
    • Constructor Summary

      Constructors 
      Constructor Description
      TextIcon​(java.awt.Component cmp, int space, int inset)
      Creates a TextIcon for the specified component with the specified label.
    • Constructor Detail

      • TextIcon

        public TextIcon​(java.awt.Component cmp,
                        int space,
                        int inset)
        Creates a TextIcon for the specified component with the specified label. It sets the orientation to the provided value if it's legal for the string
    • Method Detail

      • getText

        public java.lang.String getText()
      • setText

        public void setText​(java.lang.String text)
      • setIcon

        public void setIcon​(javax.swing.Icon icon)
      • setRotation

        public void setRotation​(int rotation)
      • getValidRotation

        public static int getValidRotation​(int rotation)
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • getIconWidth

        public int getIconWidth()
        Specified by:
        getIconWidth in interface javax.swing.Icon
      • getIconHeight

        public int getIconHeight()
        Specified by:
        getIconHeight in interface javax.swing.Icon
      • paintIcon

        public void paintIcon​(java.awt.Component c,
                              java.awt.Graphics g,
                              int x,
                              int y)
        Specified by:
        paintIcon in interface javax.swing.Icon
      • validate

        public void validate()