objectdraw
Interface Drawable2DInterface

All Superinterfaces:
DrawableInterface
All Known Subinterfaces:
Resizable2DInterface
All Known Implementing Classes:
Arc, Drawable2D, FilledArc, FilledOval, FilledRect, FilledRoundedRect, FramedArc, FramedOval, FramedRect, FramedRoundedRect, Oval, Rect, Rectangular, Resizable2D, RoundedRect, 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.1 released February 2005

Method Summary
abstract  double getHeight()
          Get the height of a graphical object
abstract  Location getLocation()
          Get a graphical object's position
abstract  double getWidth()
          Get the width of a graphical object
abstract  double getX()
          Get the x coordinate of left edge of rectangle bounding the object
abstract  double getY()
          Get the y coordinate of top edge of rectangle bounding the object
abstract  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

getHeight

double getHeight()
Get the height of a graphical object

Returns:
the height of the object's bounding rectangle

getLocation

Location getLocation()
Get a graphical object's position

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

getWidth

double getWidth()
Get the width of a graphical object

Returns:
the width of the object's bounding rectangle

getX

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

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

overlaps

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.