objectdraw
Interface Drawable2DInterface

All Superinterfaces:
DrawableInterface
All Known Subinterfaces:
Resizable2DInterface
All Known Implementing Classes:
Drawable2D

public interface Drawable2DInterface
extends DrawableInterface

Drawable2DInterface is an interface for objects being placed on a DrawingCanvas that defines which accessor methods are availabe for Drawable2D objects. It includes getHeight, getWidth,and getBounds. It extends DrawableInterface.


Method Summary
 Bounds getBounds()
          Retrieves the bounding rectangle of the object.
 double getHeight()
          Gets the height of the object's bounding rectangle
 Location getLocation()
          Get the coordinates of the object's bounding rectangle's upper left corner
 double getWidth()
          Gets the width of the object's bounding rectangle
 double getX()
          Get the x coordinate of the object's bounding rectangle's upper left corner
 double getY()
          Get the y coordinate of the object's bounding rectangle's upper left corner
 boolean overlaps(Drawable2DInterface item)
          Determines if another Drawable's bounding box overlaps with this object's bounding box.
 
Methods inherited from interface objectdraw.DrawableInterface
addToCanvas, contains, draw, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show
 

Method Detail

getWidth

public double getWidth()
Gets the width of the object's bounding rectangle

getHeight

public double getHeight()
Gets the height of the object's bounding rectangle

getX

public double getX()
Get the x coordinate of the object's bounding rectangle's upper left corner

getY

public double getY()
Get the y coordinate of the object's bounding rectangle's upper left corner

getBounds

public Bounds getBounds()
Retrieves the bounding rectangle of the object.
Returns:
the bounding rectangle

getLocation

public Location getLocation()
Get the coordinates of the object's bounding rectangle's upper left corner

overlaps

public boolean overlaps(Drawable2DInterface item)
Determines if another Drawable's bounding box overlaps with this object's bounding box.
Parameters:
item - the other object
Returns:
true if item intersects this object; false otherwise.