cse115.graphics
Class Image

java.lang.Object
  extended by cse115.graphics.AbstractGraphic
      extended by cse115.graphics.Image
All Implemented Interfaces:
CenterLocatable, Graphic, Locatable, Rotatable, Sizeable
Direct Known Subclasses:
Painter

public class Image
extends AbstractGraphic

A class that is a Graphical object based on a specified picture file.

Author:
Michael Kozelsky Created on: Jul 29, 2006 Image.java

Constructor Summary
Image(String fileName)
          Creates an Image graphic using the picture located at a given location
 
Method Summary
 void actualPaint(Graphics2D gs, Point location, Dimension dimension)
          This method uses the Graphics2D object to paint an Image onto the container at a specified point with a specified dimension
 Shape getShape()
          Should return a java.awt.Shape representation of this graphic.
 
Methods inherited from class cse115.graphics.AbstractGraphic
addMouseListener, addMouseMotionListener, contains, getBounds, getCenterLocation, getContainer, getDimension, getLocation, getMouseListeners, getMouseMotionListeners, getRotation, intersects, move, paint, rotate, setCenterLocation, setContainer, setDimension, setLocation, setRotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image(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
Method Detail

actualPaint

public void actualPaint(Graphics2D gs,
                        Point location,
                        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 painting
location - The point at which to paint the Image
dimension - The dimension of the Image to paint
See Also:
Graphic.actualPaint(java.awt.Graphics2D, java.awt.Point, java.awt.Dimension)

getShape

public Shape getShape()
Description copied from interface: Graphic
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:
Graphic.getShape()