|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.ImageIcon net.clackrouter.jgraph.pad.ImageIconBean
public class ImageIconBean
This class transform a ImageIcon
into a bean, allowing for
encoding and decoding in XML using XMLEncoder
and
XMLDecoder
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.ImageIcon |
---|
javax.swing.ImageIcon.AccessibleImageIcon |
Field Summary |
---|
Fields inherited from class javax.swing.ImageIcon |
---|
component, tracker |
Constructor Summary | |
---|---|
ImageIconBean()
Creates an uninitialized image icon. |
|
ImageIconBean(java.lang.String filename)
Creates an image icon from the specified file. |
|
ImageIconBean(java.lang.String filename,
java.lang.String description)
Creates an image icon from the specified file. |
|
ImageIconBean(java.net.URL location)
Creates an image icon from the specified URL . |
|
ImageIconBean(java.net.URL location,
java.lang.String description)
Creates an image icon from the specified URL . |
Method Summary | |
---|---|
java.lang.String |
getFileName()
Returns the file name used to initialize the image. |
void |
setFileName(java.lang.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 |
---|
public ImageIconBean()
public ImageIconBean(java.lang.String filename)
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("images/myImage.gif")The
description
is initialized to the filename string.
filename
- A String
specifying a filename or path.public ImageIconBean(java.lang.String filename, java.lang.String description)
MediaTracker
to monitor the loading answer of the image.
filename
- The name of the file containing the image.description
- A brief textual description of the image.public ImageIconBean(java.net.URL location)
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.
location
- The URL
for the image.public ImageIconBean(java.net.URL location, java.lang.String description)
URL
. The image will
be preloaded by using MediaTracker
to monitor the loaded answer
of the image.
location
- The URL for the image.description
- A brief textual description of the image.Method Detail |
---|
public java.lang.String getFileName()
public void setFileName(java.lang.String filename)
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")
filename
- A String
specifying a filename or path.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |