JGraphpad Pro
v6.0.5.0


com.jgraph.pad.util
Class JGraphpadImageIcon

java.lang.Object
  extended byjavax.swing.ImageIcon
      extended bycom.jgraph.pad.util.JGraphpadImageIcon
All Implemented Interfaces:
Accessible, Icon, Serializable

public class JGraphpadImageIcon
extends ImageIcon

This class transform a ImageIcon into a bean, allowing for encoding and decoding in XML using XMLEncoder and XMLDecoder.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.ImageIcon
ImageIcon.AccessibleImageIcon
 
Field Summary
 
Fields inherited from class javax.swing.ImageIcon
component, tracker
 
Constructor Summary
JGraphpadImageIcon()
          Creates an uninitialized image icon.
JGraphpadImageIcon(String filename)
          Creates an image icon from the specified file.
JGraphpadImageIcon(String filename, String description)
          Creates an image icon from the specified file.
JGraphpadImageIcon(URL location)
          Creates an image icon from the specified URL.
JGraphpadImageIcon(URL location, String description)
          Creates an image icon from the specified URL.
 
Method Summary
 String getFileName()
          Returns the file name used to initialize the image.
 void setFileName(String filename)
          Initializes this image icon from the specified file.
 
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGraphpadImageIcon

public JGraphpadImageIcon()
Creates an uninitialized image icon.


JGraphpadImageIcon

public JGraphpadImageIcon(String filename)
Creates an image icon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading answer of the image. The specified String can be a file name or a file path. When specifying a path, use the Internet-standard forward-slash ("/") as a separator. (The string is converted to an URL, so the forward-slash works on all systems.) For example, specify:
 
 new JGraphpadImageIcon("images/myImage.gif")
 
 
The description is initialized to the filename string.

Parameters:
filename - A String specifying a filename or path.

JGraphpadImageIcon

public JGraphpadImageIcon(String filename,
                          String description)
Creates an image icon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading answer of the image.

Parameters:
filename - The name of the file containing the image.
description - A brief textual description of the image.

JGraphpadImageIcon

public JGraphpadImageIcon(URL location)
Creates an image icon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded answer of the image. The icon's description is initialized to be a string representation of the URL.

Parameters:
location - The URL for the image.

JGraphpadImageIcon

public JGraphpadImageIcon(URL location,
                          String description)
Creates an image icon from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded answer of the image.

Parameters:
location - The URL for the image.
description - A brief textual description of the image.
Method Detail

getFileName

public String getFileName()
Returns the file name used to initialize the image.


setFileName

public void setFileName(String filename)
Initializes this image icon from the specified file. The image will be preloaded by using MediaTracker to monitor the loading answer of the image. The specified String can be a file name or a file path. When specifying a path, use the Internet-standard forward-slash ("/") as a separator. (The string is converted to an URL, so the forward-slash works on all systems.) For example, specify:
 
 new BeanifiedIcon().setFileName("images/myImage.gif")
 
 

Parameters:
filename - A String specifying a filename or path.

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.