Class DecoratableIcon

java.lang.Object
org.fife.rsta.ac.java.DecoratableIcon
All Implemented Interfaces:
Icon

public class DecoratableIcon extends Object implements Icon
An icon that can have an optional "decorations" icon beside of it.
Version:
1.0
  • Field Details

    • width

      private int width
      The width of this icon.
    • mainIcon

      private Icon mainIcon
      The "main" icon (the icon that is decorated).
    • decorations

      private List<Icon> decorations
      The "decoration" icons.
    • deprecated

      private boolean deprecated
      Whether this icon is for a "deprecated" item.
    • DEFAULT_WIDTH

      private static final int DEFAULT_WIDTH
      The width of a decoratable icon (16 + 8 + 8, - 8 for overlap).
      See Also:
  • Constructor Details

    • DecoratableIcon

      public DecoratableIcon(Icon mainIcon)
      Constructor.
      Parameters:
      mainIcon - The "main" icon. This cannot be null.
    • DecoratableIcon

      public DecoratableIcon(int width, Icon mainIcon)
      Constructor.
      Parameters:
      width - The width for this icon.
      mainIcon - The "main" icon. This cannot be null.
  • Method Details

    • addDecorationIcon

      public void addDecorationIcon(Icon decoration)
      Adds a decoration icon.
      Parameters:
      decoration - A new decoration icon. This cannot be null.
      See Also:
    • getIconHeight

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

      public int getIconWidth()
      Specified by:
      getIconWidth in interface Icon
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • setDeprecated

      public void setDeprecated(boolean deprecated)
      Sets whether this icon is for a deprecated item.
      Parameters:
      deprecated - Whether this icon is for a deprecated item.
    • setMainIcon

      public void setMainIcon(Icon icon)
      Sets the main icon.
      Parameters:
      icon - The "main" icon. This cannot be null.
      See Also: