Package org.fife.rsta.ac.java
Class DecoratableIcon
- java.lang.Object
-
- org.fife.rsta.ac.java.DecoratableIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class DecoratableIcon extends java.lang.Object implements javax.swing.IconAn icon that can have an optional "decorations" icon beside of it.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<javax.swing.Icon>decorationsThe "decoration" icons.private static intDEFAULT_WIDTHThe width of a decoratable icon (16 + 8 + 8, - 8 for overlap).private booleandeprecatedWhether this icon is for a "deprecated" item.private javax.swing.IconmainIconThe "main" icon (the icon that is decorated).private intwidthThe width of this icon.
-
Constructor Summary
Constructors Constructor Description DecoratableIcon(int width, javax.swing.Icon mainIcon)Constructor.DecoratableIcon(javax.swing.Icon mainIcon)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDecorationIcon(javax.swing.Icon decoration)Adds a decoration icon.intgetIconHeight()intgetIconWidth()voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidsetDeprecated(boolean deprecated)Sets whether this icon is for a deprecated item.voidsetMainIcon(javax.swing.Icon icon)Sets the main icon.
-
-
-
Field Detail
-
width
private int width
The width of this icon.
-
mainIcon
private javax.swing.Icon mainIcon
The "main" icon (the icon that is decorated).
-
decorations
private java.util.List<javax.swing.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:
- Constant Field Values
-
-
Constructor Detail
-
DecoratableIcon
public DecoratableIcon(javax.swing.Icon mainIcon)
Constructor.- Parameters:
mainIcon- The "main" icon. This cannot benull.
-
DecoratableIcon
public DecoratableIcon(int width, javax.swing.Icon mainIcon)Constructor.- Parameters:
width- The width for this icon.mainIcon- The "main" icon. This cannot benull.
-
-
Method Detail
-
addDecorationIcon
public void addDecorationIcon(javax.swing.Icon decoration)
Adds a decoration icon.- Parameters:
decoration- A new decoration icon. This cannot benull.- See Also:
setMainIcon(Icon)
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.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(javax.swing.Icon icon)
Sets the main icon.- Parameters:
icon- The "main" icon. This cannot benull.- See Also:
addDecorationIcon(Icon)
-
-