vooga.gameEngine.core
Class Dimension

java.lang.Object
  extended by java.awt.geom.Dimension2D
      extended by vooga.gameEngine.core.Dimension
All Implemented Interfaces:
java.lang.Cloneable

public class Dimension
extends java.awt.geom.Dimension2D

A Dimension object encapsulates the width and height of a GameRelatedObject (in double precision).

Author:
Scott D. Brothers, Justin C. Klaassen

Constructor Summary
Dimension()
          Default constructor; creates a new Dimension object with a width = 0 and height = 0.
Dimension(double width, double height)
          Creates a Dimension given its width and height component
 
Method Summary
 java.lang.Object clone()
           
 double getHeight()
           
 int getIntHeight()
          Returns the height of this Dimension in integer precision.
 int getIntWidth()
          Returns the width of this Dimension in integer precision.
 double getWidth()
           
 void resize(double dx, double dy)
          Resizes this Dimension, dx in the X direction and dy in the Y direction.
 void setSize(double width, double height)
           
 
Methods inherited from class java.awt.geom.Dimension2D
setSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dimension

public Dimension()
Default constructor; creates a new Dimension object with a width = 0 and height = 0.


Dimension

public Dimension(double width,
                 double height)
Creates a Dimension given its width and height component

Parameters:
width - the width component
height - the height component
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.awt.geom.Dimension2D

getWidth

public double getWidth()
Specified by:
getWidth in class java.awt.geom.Dimension2D

getHeight

public double getHeight()
Specified by:
getHeight in class java.awt.geom.Dimension2D

getIntWidth

public int getIntWidth()
Returns the width of this Dimension in integer precision.

Returns:
the width of this Dimension

getIntHeight

public int getIntHeight()
Returns the height of this Dimension in integer precision.

Returns:
the height of this Dimension

setSize

public void setSize(double width,
                    double height)
Specified by:
setSize in class java.awt.geom.Dimension2D

resize

public void resize(double dx,
                   double dy)
Resizes this Dimension, dx in the X direction and dy in the Y direction.

Parameters:
dx - amount to resize in X
dy - amount to resize in Y