objectdraw
Interface Drawable2DInterface

All Superinterfaces:
DrawableInterface
All Known Subinterfaces:
Resizable2DInterface
All Known Implementing Classes:
objectdraw.Drawable2D, FilledArc, FilledOval, FilledRect, FilledRoundedRect, FramedArc, FramedOval, FramedRect, FramedRoundedRect, objectdraw.Rectangular, Text, VisibleImage

public interface Drawable2DInterface
extends DrawableInterface

Drawable2DInterface describes the methods available for manipulating two-dimensional objects placed on a DrawingCanvas. It extends DrawableInterface and includes getHeight, getWidth. All Drawables except Lines implement this interface.

Version:
1.1.2 released July 2006

Method Summary
 double getHeight()
          Get the height of a graphical object
 Location getLocation()
          Get a graphical object's position
 double getWidth()
          Get the width of a graphical object
 double getX()
          Get the x coordinate of left edge of rectangle bounding the object
 double getY()
          Get the y coordinate of top edge of rectangle bounding the object
 boolean overlaps(Drawable2DInterface item)
          Determines if another Drawable's bounding rectangle overlaps with this object's bounding rectangle.
 
Methods inherited from interface objectdraw.DrawableInterface
addToCanvas, contains, getCanvas, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show
 

Method Detail

getWidth

public double getWidth()
Get the width of a graphical object

Returns:
the width of the object's bounding rectangle

getHeight

public double getHeight()
Get the height of a graphical object

Returns:
the height of the object's bounding rectangle

getX

public double getX()
Get the x coordinate of left edge of rectangle bounding the object

Returns:
the x coordinate of the upper left corner of the object's bounding rectangle

getY

public double getY()
Get the y coordinate of top edge of rectangle bounding the object

Returns:
the y coordinate of the upper left corner of the object's bounding rectangle

getLocation

public Location getLocation()
Get a graphical object's position

Returns:
the location of the upper left corner of the object's bounding rectangle

overlaps

public boolean overlaps(Drawable2DInterface item)
Determines if another Drawable's bounding rectangle overlaps with this object's bounding rectangle.

Parameters:
item - the other object
Returns:
true if item intersects this object; false otherwise.