|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.NodeRealizer | +--y.view.ImageNodeRealizer
A node realizer that displays a node as an image.
Field Summary |
Fields inherited from class y.view.NodeRealizer |
height, HOTSPOT_E, HOTSPOT_N, HOTSPOT_NE, HOTSPOT_NONE, HOTSPOT_NW, HOTSPOT_S, HOTSPOT_SE, HOTSPOT_SW, HOTSPOT_W, width, x, y |
Constructor Summary | |
ImageNodeRealizer()
Creates a new ImageNodeRealizer with no image associated with it. |
|
ImageNodeRealizer(NodeRealizer argNodeRealizer)
Creates a new ImageNodeRealizer whose attributes are copied from the given realizer. |
Method Summary | |
static Image |
addImage(URL imageURL)
Adds an image Object to ImageNodeRealizer's image cache. |
static void |
addImages(String userHomeRes,
String classPathRes)
Adds images that are specified in a property file. |
static void |
addImages(URL url)
Adds images that are specified in a property file parsable by class java.util.PropertyResourceBundle An example of such a file follows: basepath=imagenodes image1=flower.gif image2=trousers.gif image3=pike.gif The optional key "basepath" signifies a path that is prepended to all given image values. if "basepath' signifies an absolute path then the given url is not prepended to basepath. |
static Vector |
availableImageURLs()
Returns a vector of all URL objects, that have are used as keys to ImageNodeRealizer's image cache. |
NodeRealizer |
createCopy(NodeRealizer nr)
Creates and returns a new ImageNodeRealizer whose attributes are copied from the given realizer. |
Image |
getImage()
Returns the image that is displayed by this realizer. |
static Image |
getImage(URL url)
Returns the image that is stored under the given URL in ImageNodeRealizer's image cache, or null
if there is no image registered with that URL. |
static Hashtable |
getImageTable()
Returns ImageNodeRealizer's image cache. the keys to the cached Image objects are their URLs. |
URL |
getImageURL()
Returns the URL of the displayed image, or null if
no URL is associated with this realizer. |
void |
paintNode(Graphics2D g)
This method must be implemented by subclasses. |
void |
read(ObjectInputStream in)
Reads in the serialized form of this realizer. |
void |
setImage(Image image)
Sets the image that will be displayed by this realizer. |
void |
setImageURL(URL imageURL)
Sets the URL of the image that will be displayed by this realizer. |
void |
setToImageSize()
Sets the size of this realizer to the original size of the image being displayed. |
void |
write(ObjectOutputStream out)
Writes out this realizer in a serialized form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImageNodeRealizer()
public ImageNodeRealizer(NodeRealizer argNodeRealizer)
Method Detail |
public NodeRealizer createCopy(NodeRealizer nr)
createCopy
in class NodeRealizer
public static void addImages(String userHomeRes, String classPathRes)
userHomeRes
- A user home relative path to the property
file. If this file is not found then ...classPathRes
- ... a classpath relative path to the property
file will be tried instead.ImageNodeRealizer.addImages(URL)
public static void addImages(URL url)
An example of such a file follows:
basepath=imagenodes image1=flower.gif image2=trousers.gif image3=pike.gifThe optional key "basepath" signifies a path that is prepended to all given image values. if "basepath' signifies an absolute path then the given url is not prepended to basepath.
url
- the url of the properties file.public static Image addImage(URL imageURL)
public static Vector availableImageURLs()
public static Hashtable getImageTable()
public static Image getImage(URL url)
null
if there is no image registered with that URL.
public void setImageURL(URL imageURL)
The image will be automatically entered in ImageNodeRealizer's static image cache under the given URL.
public void setImage(Image image)
null
.
public Image getImage()
public URL getImageURL()
null
if
no URL is associated with this realizer.
public void setToImageSize()
public void paintNode(Graphics2D g)
NodeRealizer
paintNode
in class NodeRealizer
public void write(ObjectOutputStream out) throws IOException
write
in class NodeRealizer
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
ImageNodeRealizer.write(ObjectOutputStream)
method.
read
in class NodeRealizer
IOException
ClassNotFoundException
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |