Package resources.icons
Class ImageIconWrapper
- java.lang.Object
- 
- javax.swing.ImageIcon
- 
- resources.icons.ImageIconWrapper
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- javax.accessibility.Accessible,- javax.swing.Icon,- FileBasedIcon
 - Direct Known Subclasses:
- DisabledImageIconWrapper,- ScaledImageIconWrapper
 
 public class ImageIconWrapper extends javax.swing.ImageIcon implements FileBasedIcon ImageIconWrapperprovides the ability to instantiate an ImageIcon with delayed loading. In addition to delayed loading it has the added benefit of allowing the use of static initialization of ImageIcons without starting the Swing thread which can cause problems when running headless.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ImageIconWrapper(byte[] imageBytes, java.lang.String imageName)Construct wrapped ImageIcon based upon specified image byte array (seeToolkit.createImage(byte[]))ImageIconWrapper(java.awt.Image image, java.lang.String imageName)Construct wrapped ImageIcon based upon specified imageImageIconWrapper(java.net.URL url)Construct wrapped ImageIcon based upon specified resource URLImageIconWrapper(javax.swing.Icon icon)Construct wrapped ImageIcon based upon specified icon which may require transformation into ImageIcon
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.ImagecreateIconBaseImage()Get the base icon image to be transformed in ImageIconprotected javax.swing.ImageIconcreateImageIcon()javax.accessibility.AccessibleContextgetAccessibleContext()java.lang.StringgetDescription()java.lang.StringgetFilename()Get the name of the image which in most cases will be the associated data file path.intgetIconHeight()intgetIconWidth()java.awt.ImagegetImage()intgetImageLoadStatus()java.lang.StringgetImageName()Get icon reference namejava.awt.image.ImageObservergetImageObserver()voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidsetDescription(java.lang.String description)voidsetImage(java.awt.Image image)java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
ImageIconWrapperpublic ImageIconWrapper(byte[] imageBytes, java.lang.String imageName)Construct wrapped ImageIcon based upon specified image byte array (seeToolkit.createImage(byte[]))- Parameters:
- imageBytes- image bytes
- imageName- image reference name
 
 - 
ImageIconWrapperpublic ImageIconWrapper(java.awt.Image image, java.lang.String imageName)Construct wrapped ImageIcon based upon specified image- Parameters:
- image- icon image
- imageName- image reference name
 
 - 
ImageIconWrapperpublic ImageIconWrapper(javax.swing.Icon icon) Construct wrapped ImageIcon based upon specified icon which may require transformation into ImageIcon- Parameters:
- icon- the icon
 
 - 
ImageIconWrapperpublic ImageIconWrapper(java.net.URL url) Construct wrapped ImageIcon based upon specified resource URL- Parameters:
- url- icon image resource URL
 
 
- 
 - 
Method Detail- 
getFilenamepublic java.lang.String getFilename() Description copied from interface:FileBasedIconGet the name of the image which in most cases will be the associated data file path.- Specified by:
- getFilenamein interface- FileBasedIcon
- Returns:
- icon name/path
 
 - 
getImageNamepublic java.lang.String getImageName() Get icon reference name- Returns:
- icon name
 
 - 
getImagepublic java.awt.Image getImage() - Overrides:
- getImagein class- javax.swing.ImageIcon
 
 - 
getAccessibleContextpublic javax.accessibility.AccessibleContext getAccessibleContext() - Specified by:
- getAccessibleContextin interface- javax.accessibility.Accessible
- Overrides:
- getAccessibleContextin class- javax.swing.ImageIcon
 
 - 
getDescriptionpublic java.lang.String getDescription() - Overrides:
- getDescriptionin class- javax.swing.ImageIcon
 
 - 
getIconHeightpublic int getIconHeight() - Specified by:
- getIconHeightin interface- javax.swing.Icon
- Overrides:
- getIconHeightin class- javax.swing.ImageIcon
 
 - 
getIconWidthpublic int getIconWidth() - Specified by:
- getIconWidthin interface- javax.swing.Icon
- Overrides:
- getIconWidthin class- javax.swing.ImageIcon
 
 - 
getImageLoadStatuspublic int getImageLoadStatus() - Overrides:
- getImageLoadStatusin class- javax.swing.ImageIcon
 
 - 
getImageObserverpublic java.awt.image.ImageObserver getImageObserver() - Overrides:
- getImageObserverin class- javax.swing.ImageIcon
 
 - 
paintIconpublic void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
- paintIconin interface- javax.swing.Icon
- Overrides:
- paintIconin class- javax.swing.ImageIcon
 
 - 
setDescriptionpublic void setDescription(java.lang.String description) - Overrides:
- setDescriptionin class- javax.swing.ImageIcon
 
 - 
setImagepublic void setImage(java.awt.Image image) - Overrides:
- setImagein class- javax.swing.ImageIcon
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- javax.swing.ImageIcon
 
 - 
createIconBaseImageprotected final java.awt.Image createIconBaseImage() Get the base icon image to be transformed in ImageIcon- Returns:
- the base icon image to be transformed in ImageIcon
 
 - 
createImageIconprotected javax.swing.ImageIcon createImageIcon() 
 
- 
 
-