|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolo.nodes.PImage
public class PImage
PImage is a wrapper around a java.awt.Image. If this node is copied or serialized that image will be converted into a BufferedImage if it is not already one.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary | |
---|---|
static int |
PROPERTY_CODE_IMAGE
|
static java.lang.String |
PROPERTY_IMAGE
The property name that identifies a change of this node's image (see getImage ). |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PImage()
|
|
PImage(java.awt.Image newImage)
Construct a new PImage wrapping the given java.awt.Image. |
|
PImage(java.lang.String fileName)
Construct a new PImage by loading the given fileName and wrapping the resulting java.awt.Image. |
|
PImage(java.net.URL url)
Construct a new PImage by loading the given url and wrapping the resulting java.awt.Image. |
Method Summary | |
---|---|
java.awt.Image |
getImage()
Returns the image that is shown by this node. |
protected void |
paint(PPaintContext paintContext)
Paint this node behind any of its children nodes. |
protected java.lang.String |
paramString()
Returns a string representing the state of this node. |
void |
setImage(java.awt.Image newImage)
Set the image that is wrapped by this PImage node. |
void |
setImage(java.lang.String fileName)
Set the image that is wrapped by this PImage node. |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image image,
boolean alwaysCreateCopy)
If alwaysCreateCopy is false then if the image is already a buffered image it will not be copied and instead the original image will just be returned. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_IMAGE
getImage
). Both old and new value will be set correctly
to Image objects in any property change event.
public static final int PROPERTY_CODE_IMAGE
Constructor Detail |
---|
public PImage()
public PImage(java.awt.Image newImage)
public PImage(java.lang.String fileName)
public PImage(java.net.URL url)
null
, create an
empty PImage; this behaviour is useful when fetching resources that may
be missing.
Method Detail |
---|
public java.awt.Image getImage()
public void setImage(java.lang.String fileName)
public void setImage(java.awt.Image newImage)
protected void paint(PPaintContext paintContext)
PNode
paint
in class PNode
paintContext
- the paint context to use for painting the nodepublic static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image, boolean alwaysCreateCopy)
protected java.lang.String paramString()
null
.
paramString
in class PNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |