org.opensourcephysics.display
Class BoundedImage
java.lang.Object
org.opensourcephysics.display.AbstractInteractive
org.opensourcephysics.display.InteractiveShape
org.opensourcephysics.display.BoundedShape
org.opensourcephysics.display.BoundedImage
- All Implemented Interfaces:
- java.awt.image.ImageObserver, Drawable, Interactive, Measurable, Selectable
- Direct Known Subclasses:
- BoundedTextLine
public class BoundedImage
- extends BoundedShape
- implements java.awt.image.ImageObserver
An image is bounded by hot spots for dragging and resizing.
- Version:
- 1.0
- Author:
- W. Christian
Field Summary |
protected java.awt.Image |
image
|
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary |
BoundedImage(java.awt.Image image,
double x,
double y)
Constructs a bounded image centered at the given location. |
Method Summary |
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the image. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
|
Methods inherited from class org.opensourcephysics.display.BoundedShape |
createBoundedArrow, createBoundedCenteredArrow, createBoundedCircle, createBoundedEllipse, createBoundedImage, createBoundedRectangle, createBoundedTriangle, findInteractive, getLoader, getPreferredCursor, isHeightDrag, isInside, isRotateDrag, isSelected, isWidthDrag, isXYDrag, setHeightDrag, setRotateDrag, setSelected, setWidthDrag, setXYDrag, toggleSelected, toString |
Methods inherited from class org.opensourcephysics.display.InteractiveShape |
contains, createArrow, createCenteredArrow, createCircle, createEllipse, createImage, createRectangle, createSquare, createTextLine, createTriangle, getHeight, getShape, getWidth, getXMax, getXMin, getYMax, getYMin, isMeasured, setHeight, setMarkerColor, setMeasured, setOffset, setPixelSized, setTheta, setWidth, setX, setXY, setY, tranform, transform |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
image
protected java.awt.Image image
BoundedImage
public BoundedImage(java.awt.Image image,
double x,
double y)
- Constructs a bounded image centered at the given location.
- Parameters:
x
- doubley
- doubleimage
- Image
draw
public void draw(DrawingPanel panel,
java.awt.Graphics g)
- Draws the image.
- Specified by:
draw
in interface Drawable
- Overrides:
draw
in class BoundedShape
- Parameters:
panel
- the world in which the arrow is viewedg
- the graphics context upon which to draw
imageUpdate
public boolean imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
- Specified by:
imageUpdate
in interface java.awt.image.ImageObserver