public class ImageShape extends ShapeImpl implements Shape
Use the getImageFromFilename and getImageFromURL operations on GWindows to create Image objects, which can then be used to create ImageShape objects.
Constructor and Description |
---|
ImageShape(java.awt.Image i,
int x,
int y)
Create a new image of the given size.
|
Modifier and Type | Method and Description |
---|---|
void |
paint(java.awt.Graphics g)
Paint/draw this image onto the given graphics context.
|
void |
setImage(java.awt.Image newImage)
Change the image
|
static void |
testFromFilename(java.lang.String imageName) |
static void |
testFromURL(java.lang.String imageURL) |
java.lang.String |
toString()
Answer the printed representation of this shape.
|
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, moveTo, recordWindow, removeFromWindow, rotateAround, setColor
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, moveTo, recordWindow, removeFromWindow, rotateAround, setColor
public ImageShape(java.awt.Image i, int x, int y)
i
- the imagex
- the x coordinate of the upper left cornery
- the y coordinate of the upper left cornerpublic void setImage(java.awt.Image newImage)
public void paint(java.awt.Graphics g)
public java.lang.String toString()
ShapeImpl
public static void testFromFilename(java.lang.String imageName)
public static void testFromURL(java.lang.String imageURL)