|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZSceneGraphObject | +--edu.umd.cs.jazz.ZVisualComponent | +--edu.umd.cs.jazz.component.ZImage
ZImage is a graphic object that represents a raster image
Field Summary | |
protected java.lang.String |
fileName
|
protected int |
height
|
protected java.awt.Image |
image
|
protected edu.umd.cs.jazz.component.ZImageObserver |
observer
|
protected static java.awt.Component |
staticComponent
|
protected java.net.URL |
url
|
protected int |
width
|
protected boolean |
writeEmbeddedImage
|
static boolean |
writeEmbeddedImage_DEFAULT
|
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
bounds,
objRefTable,
volatileBounds_DEFAULT |
Constructor Summary | |
ZImage()
Constructs a new Image. |
|
ZImage(byte[] bytes)
|
|
ZImage(java.awt.Image i)
|
|
ZImage(java.lang.String aFileName)
|
|
ZImage(java.net.URL aUrl)
|
Method Summary | |
java.lang.Object |
clone()
Duplicates the current object by using the copy constructor. |
protected void |
computeBounds()
Notifies this object that it has changed and that it should update its notion of its bounding box. |
java.lang.String |
dump()
Generate a string that represents this object for debugging. |
void |
duplicateObject(ZImage refImage)
Copies all object information from the reference object into the current object. |
java.lang.String |
getAbsolutePath(java.lang.String path)
Given a directory path plus some path relative to it, return a direct absolute path. |
java.lang.String |
getFileName()
Return the filename associated with this image object. |
int |
getHeight()
Return height of image. |
java.awt.Image |
getImage()
Return the AWT image associated with this image object. |
java.lang.String |
getRelativePath(java.lang.String fileName,
java.lang.String basePath)
Returns the directory path of a file name, relative to another absolute path basePath. |
java.net.URL |
getUrl()
Return the URL associated with this image object. |
int |
getWidth()
Return width of image. |
boolean |
getWriteEmbeddedImage()
Determine if this image gets saved by writing the binary image into the file. |
boolean |
isLoaded()
|
protected void |
loadImage(java.awt.Image im)
|
static java.awt.image.BufferedImage |
makeBufferedImage(java.awt.Image image)
Creates a BufferedImage from an Image. |
void |
render(ZRenderContext renderContext)
Paints this object. |
void |
setFileName(java.lang.String aFileName)
Sets the filename of the image. |
boolean |
setImage(byte[] bytes)
|
boolean |
setImage(java.awt.Image i)
|
boolean |
setImage(java.lang.String aFileName)
loads an image |
boolean |
setImage(java.net.URL aUrl)
|
protected void |
setLoaded(boolean l)
Called when the image has been loaded. |
void |
setState(java.lang.String fieldType,
java.lang.String fieldName,
java.lang.Object fieldValue)
Set some state of this object as it gets read back in. |
void |
setUrl(java.net.URL aUrl)
Sets the URL of the image. |
void |
setWriteEmbeddedImage(boolean value)
Specify if this image gets saved by writing the binary image into the file, or if it instead writes the filename of the image, and thus requires that the external image file exists in the same place to reload. |
static boolean |
waitForImage(java.awt.Image image)
Wait while image is loaded. |
void |
writeObject(ZObjectOutputStream out)
Write out all of this object's state. |
Methods inherited from class edu.umd.cs.jazz.ZVisualComponent |
boundsUpdated,
duplicateObject,
getParents,
paint,
pick,
pickBounds,
repaint,
repaint,
trimToSize,
updateBounds,
updateVolatility,
writeObjectRecurse |
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject |
duplicateObject,
getBounds,
getVolatileBounds,
reshape,
setVolatileBounds,
updateObjectReferences |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final boolean writeEmbeddedImage_DEFAULT
protected static final java.awt.Component staticComponent
protected int width
protected int height
protected transient java.awt.Image image
protected edu.umd.cs.jazz.component.ZImageObserver observer
protected boolean writeEmbeddedImage
protected transient java.lang.String fileName
protected java.net.URL url
Constructor Detail |
public ZImage()
public ZImage(java.awt.Image i)
public ZImage(java.lang.String aFileName)
public ZImage(java.net.URL aUrl)
public ZImage(byte[] bytes)
Method Detail |
public void duplicateObject(ZImage refImage)
refImage
- The reference visual component to copypublic java.lang.Object clone()
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)
public java.lang.String getAbsolutePath(java.lang.String path)
public java.lang.String getRelativePath(java.lang.String fileName, java.lang.String basePath)
fileName
- absolute path of a file.baseName
- absolute base path.public boolean setImage(java.awt.Image i)
public boolean setImage(byte[] bytes)
public boolean setImage(java.lang.String aFileName)
aFileName
- the file name of the image.public boolean setImage(java.net.URL aUrl)
protected void loadImage(java.awt.Image im)
public java.awt.Image getImage()
public void setFileName(java.lang.String aFileName)
aFileName
- the file name.public java.lang.String getFileName()
public void setUrl(java.net.URL aUrl)
aURL
- the file name.public java.net.URL getUrl()
public void setWriteEmbeddedImage(boolean value)
value
- true to embed image in file, and false to store a linkpublic boolean getWriteEmbeddedImage()
protected void computeBounds()
updateBounds
when needed.public void render(ZRenderContext renderContext)
The transform, clip, and composite will be set appropriately when this object is rendered. It is up to this object to restore the transform, clip, and composite of the Graphics2D if this node changes any of them. However, the color, font, and stroke are unspecified by Jazz. This object should set those things if they are used, but they do not need to be restored.
renderContext
- The graphics context to paint into.public int getWidth()
public int getHeight()
public boolean isLoaded()
protected void setLoaded(boolean l)
public java.lang.String dump()
ZDebug.dump(edu.umd.cs.jazz.ZNode)
public void writeObject(ZObjectOutputStream out) throws java.io.IOException
out
- The stream that this object writes intopublic void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
fieldType
- The fully qualified type of the fieldfieldName
- The name of the fieldfieldValue
- The value of the fieldpublic static boolean waitForImage(java.awt.Image image)
image
- The image.public static java.awt.image.BufferedImage makeBufferedImage(java.awt.Image image)
image
- The image.
|
Jazz API Documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |