funworld
Class OvalImage

java.lang.Object
  extended by funworld.WorldImage
      extended by funworld.OvalImage

public class OvalImage
extends WorldImage

The class to represent filled oval images drawn by the World when drawing on its Canvas.

Since:
February 4 2012
Author:
Viera K. Proulx

Field Summary
 int height
          the height of this frame
 int width
          the width of this frame
 
Fields inherited from class funworld.WorldImage
color, pinhole
 
Constructor Summary
OvalImage(geometry.Posn pinhole, int width, int height, java.awt.Color color)
          A full constructor for this frame image.
OvalImage(geometry.Posn pinhole, int width, int height, colors.IColor color)
          A convenience constructor to supply the color in the form of IColor.
 
Method Summary
 int getHeight()
          Produce the height of this image
 int getWidth()
          Produce the width of this image
 WorldImage movePinhole(int dx, int dy)
          Produce the oval with the pinhole moved by the given (dx, dy)
 WorldImage moveTo(geometry.Posn p)
          Produce the oval with the pinhole moved to the given location
 
Methods inherited from class funworld.WorldImage
overlayImages
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

public int width
the width of this frame


height

public int height
the height of this frame

Constructor Detail

OvalImage

public OvalImage(geometry.Posn pinhole,
                 int width,
                 int height,
                 java.awt.Color color)
A full constructor for this frame image.

Parameters:
pinhole - the pinhole location for this image
width - the width of this frame
height - the height of this frame
color - the color for this image

OvalImage

public OvalImage(geometry.Posn pinhole,
                 int width,
                 int height,
                 colors.IColor color)
A convenience constructor to supply the color in the form of IColor.

Parameters:
pinhole - the pinhole location for this image
width - the width of this frame
height - the height of this frame
color - the color for this image
Method Detail

movePinhole

public WorldImage movePinhole(int dx,
                              int dy)
Produce the oval with the pinhole moved by the given (dx, dy)

Specified by:
movePinhole in class WorldImage
Parameters:
dx - the horizontal offset
dy - the vertical offset

moveTo

public WorldImage moveTo(geometry.Posn p)
Produce the oval with the pinhole moved to the given location

Specified by:
moveTo in class WorldImage
Parameters:
p - the given location

getWidth

public int getWidth()
Produce the width of this image

Specified by:
getWidth in class WorldImage
Returns:
the width of this image

getHeight

public int getHeight()
Produce the height of this image

Specified by:
getHeight in class WorldImage
Returns:
the height of this image