graphics
Class Image
java.lang.Object
graphics.AbstractGraphic
graphics.Image
- All Implemented Interfaces:
- CenterLocatable, IGraphic, ILocatable, IRotatable, ISizeable
- Direct Known Subclasses:
- Breakout, Earth, Elephant
public class Image
- extends AbstractGraphic
A class that is a Graphical object based on a specified picture file.
The image object needs its dimension to be manually set. It does not
set it's own size automatically.
- Author:
- Michael Kozelsky
Created on: Jul 29, 2006 Image.java
Constructor Summary |
Image(java.lang.String fileName)
Creates an Image graphic using the picture located at a given location |
Method Summary |
void |
actualPaint(java.awt.Graphics2D gs,
java.awt.Point location,
java.awt.Dimension dimension)
This method uses the Graphics2D object to paint an Image onto the
container at a specified point with a specified dimension |
java.awt.Shape |
getShape()
Should return a java.awt.Shape representation of this graphic. |
Methods inherited from class graphics.AbstractGraphic |
addMouseListener, addMouseMotionListener, contains, getBounds, getCenterLocation, getContainer, getDimension, getLocation, getMouseListeners, getMouseMotionListeners, getMovement, getRotation, intersects, move, paint, rotate, setCenterLocation, setContainer, setDimension, setLocation, setMovement, setRotation |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Image
public Image(java.lang.String fileName)
- Creates an Image graphic using the picture located at a given location
- Parameters:
fileName
- The absolute or relative path to the file containing the image
actualPaint
public void actualPaint(java.awt.Graphics2D gs,
java.awt.Point location,
java.awt.Dimension dimension)
- This method uses the Graphics2D object to paint an Image onto the
container at a specified point with a specified dimension
- Parameters:
gs
- The Graphics2D object to do the paintinglocation
- The point at which to paint the Imagedimension
- The dimension of the Image to paint- See Also:
IGraphic.actualPaint(java.awt.Graphics2D,
java.awt.Point, java.awt.Dimension)
getShape
public java.awt.Shape getShape()
- Description copied from interface:
IGraphic
- Should return a java.awt.Shape representation of this graphic.
The shape is used as a delegate for the methods: contains, intersects, etc.
- Returns:
- a java.awt.Rectangle
- See Also:
IGraphic.getShape()