Package com.nomagic.ui
Class SwingImageIcon
- java.lang.Object
-
- javax.swing.ImageIcon
-
- com.nomagic.ui.SwingImageIcon
-
- All Implemented Interfaces:
ResizableIcon
,java.io.Serializable
,java.lang.Cloneable
,javax.accessibility.Accessible
,javax.swing.Icon
@OpenApiAll @Deprecated public class SwingImageIcon extends javax.swing.ImageIcon implements java.io.Serializable, ResizableIcon
Deprecated.Extended version of javax.swing.ImageIcon with some utility methods.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SwingImageIcon(byte[] imageData, java.lang.String description)
Deprecated.Construct icon from image dataSwingImageIcon(java.awt.Image image)
Deprecated.Constructs a new ImageIcon instance.SwingImageIcon(java.lang.Class clazz, java.lang.String location)
Deprecated.Construct image from resources available to class loader of given class at given locationSwingImageIcon(java.lang.Class clazz, java.lang.String location, boolean silent)
Deprecated.Construct image from resources available to class loader of given class at given locationSwingImageIcon(java.lang.String file)
Deprecated.Construct image from fileSwingImageIcon(java.net.URL url)
Deprecated.Construct image from url
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
clone()
Deprecated.Returns cloned instance of this icon.static javax.swing.ImageIcon
createImageIcon(ResizableIcon icon, int width, int height)
Deprecated.Create image icon of given size from given iconstatic javax.swing.ImageIcon
createImageIcon(java.awt.Component component, javax.swing.Icon icon)
Deprecated.Utility method to create an image icon from given iconstatic javax.swing.ImageIcon
createImageIcon(javax.swing.Icon icon, int width, int height)
Deprecated.Create image icon of given size from given iconstatic ResizableIcon
createScaledInstance(ResizableIcon icon, int size)
Deprecated.Utility method to create a scaled instance of given iconstatic javax.swing.Icon
createScaledInstance(javax.swing.Icon icon, int size)
Deprecated.Utility method to create a scaled instance of given iconjava.lang.String
getLocation()
Deprecated.java.net.URL
getURL()
Deprecated.private java.awt.Image
loadImage(java.lang.Class clazz, java.lang.String address, boolean silent)
Deprecated.Loads the image from url.private java.awt.Image
loadImage(java.net.URL url)
Deprecated.Loads the image from url.void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
Deprecated.Draw the icon in the given bounds.private void
readObject(java.io.ObjectInputStream in)
Deprecated.Reads the url from the stream.private void
writeObject(java.io.ObjectOutputStream out)
Deprecated.Writes the URL to the stream.-
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString
-
-
-
-
Constructor Detail
-
SwingImageIcon
public SwingImageIcon(java.awt.Image image)
Deprecated.Constructs a new ImageIcon instance.
-
SwingImageIcon
public SwingImageIcon(byte[] imageData, java.lang.String description)
Deprecated.Construct icon from image data- Parameters:
imageData
- image datadescription
- description
-
SwingImageIcon
public SwingImageIcon(java.lang.String file)
Deprecated.Construct image from file- Parameters:
file
- file
-
SwingImageIcon
public SwingImageIcon(java.net.URL url)
Deprecated.Construct image from url- Parameters:
url
- url
-
SwingImageIcon
public SwingImageIcon(java.lang.Class clazz, java.lang.String location)
Deprecated.Construct image from resources available to class loader of given class at given location- Parameters:
clazz
- classlocation
- location
-
SwingImageIcon
public SwingImageIcon(java.lang.Class clazz, java.lang.String location, boolean silent)
Deprecated.Construct image from resources available to class loader of given class at given location- Parameters:
clazz
- classlocation
- locationsilent
- if true, does not report to log file about missing icon at given location
-
-
Method Detail
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
Deprecated.Description copied from interface:ResizableIcon
Draw the icon in the given bounds. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in interfaceResizableIcon
- Parameters:
c
- the given component.g
- the graphics to paint on.x
- x coordinate.y
- y coordinate.w
- width to paint.h
- height to paint.
-
loadImage
private java.awt.Image loadImage(java.net.URL url)
Deprecated.Loads the image from url.- Parameters:
url
- the url for image.- Returns:
- the image.
-
loadImage
private java.awt.Image loadImage(java.lang.Class clazz, java.lang.String address, boolean silent)
Deprecated.Loads the image from url.- Returns:
- the image.
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
Deprecated.Writes the URL to the stream.- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
Deprecated.Reads the url from the stream.- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
getLocation
public java.lang.String getLocation()
Deprecated.- Returns:
- location
-
getURL
public java.net.URL getURL()
Deprecated.- Returns:
- url
-
clone
public java.lang.Object clone()
Deprecated.Description copied from interface:ResizableIcon
Returns cloned instance of this icon.- Specified by:
clone
in interfaceResizableIcon
- Overrides:
clone
in classjava.lang.Object
- Returns:
- cloned instance.
-
createScaledInstance
public static ResizableIcon createScaledInstance(ResizableIcon icon, int size)
Deprecated.Utility method to create a scaled instance of given icon- Parameters:
icon
- iconsize
- size- Returns:
- scaled icon
-
createScaledInstance
public static javax.swing.Icon createScaledInstance(javax.swing.Icon icon, int size)
Deprecated.Utility method to create a scaled instance of given icon- Parameters:
icon
- iconsize
- size- Returns:
- scaled icon
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(@CheckForNull java.awt.Component component, @Nonnull javax.swing.Icon icon)
Deprecated.Utility method to create an image icon from given icon- Parameters:
component
- owner of iconicon
- icon- Returns:
- scaled icon
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(javax.swing.Icon icon, int width, int height)
Deprecated.Create image icon of given size from given icon- Parameters:
icon
- iconwidth
- widthheight
- height- Returns:
- image icon
-
createImageIcon
public static javax.swing.ImageIcon createImageIcon(ResizableIcon icon, int width, int height)
Deprecated.Create image icon of given size from given icon- Parameters:
icon
- iconwidth
- widthheight
- height- Returns:
- image icon
-
-