Package resources
Class MultiIcon
- java.lang.Object
-
- resources.MultiIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class MultiIcon extends java.lang.Object implements javax.swing.Icon
Icon class for for displaying overlapping icons. Icons are drawn in the order they are added.
-
-
Constructor Summary
Constructors Constructor Description MultiIcon(javax.swing.Icon baseIcon)
Constructs a new MultiIcon with an initial base icon that will always be drawn first.MultiIcon(javax.swing.Icon baseIcon, boolean disabled)
Constructs a new MultiIcon with an initial base icon that will always be drawn first.MultiIcon(javax.swing.Icon baseIcon, boolean disabled, int width, int height)
Construct a new MultiIcon with a predetermined sizeMultiIcon(javax.swing.Icon baseIcon, javax.swing.Icon... icons)
Construct a new MultiIcon with the provided base image and subsequent images
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIcon(javax.swing.Icon icon)
Adds an icon that is to be drawn on top of the base icon and any other icons that have been added.java.lang.String
getDescription()
int
getIconHeight()
javax.swing.Icon[]
getIcons()
Return array of Icons that were added to this MultIcon.int
getIconWidth()
void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
java.lang.String
toString()
-
-
-
Constructor Detail
-
MultiIcon
public MultiIcon(javax.swing.Icon baseIcon)
Constructs a new MultiIcon with an initial base icon that will always be drawn first.- Parameters:
baseIcon
- the base icon that will always be drawn first.
-
MultiIcon
public MultiIcon(javax.swing.Icon baseIcon, boolean disabled)
Constructs a new MultiIcon with an initial base icon that will always be drawn first.- Parameters:
baseIcon
- the base icon that will always be drawn first.
-
MultiIcon
public MultiIcon(javax.swing.Icon baseIcon, javax.swing.Icon... icons)
Construct a new MultiIcon with the provided base image and subsequent images- Parameters:
baseIcon
- base image always drawn firsticons
- images drawn atop the base
-
MultiIcon
public MultiIcon(javax.swing.Icon baseIcon, boolean disabled, int width, int height)
Construct a new MultiIcon with a predetermined size- Parameters:
baseIcon
- Primary icon that is always drawn firstdisabled
- flag to draw this icon in a disabled statewidth
- horizontal dimension of this iconheight
- vertical dimension of this icon
-
-
Method Detail
-
addIcon
public void addIcon(javax.swing.Icon icon)
Adds an icon that is to be drawn on top of the base icon and any other icons that have been added.- Parameters:
icon
- the icon to be added.
-
getDescription
public java.lang.String getDescription()
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfacejavax.swing.Icon
- See Also:
Icon.getIconHeight()
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfacejavax.swing.Icon
- See Also:
Icon.getIconWidth()
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
- Specified by:
paintIcon
in interfacejavax.swing.Icon
- See Also:
Icon.paintIcon(java.awt.Component, java.awt.Graphics, int, int)
-
getIcons
public javax.swing.Icon[] getIcons()
Return array of Icons that were added to this MultIcon.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-