org.pzgui
Class AbstractDrawable

java.lang.Object
  extended by org.pzgui.AbstractDrawable
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
AbstractLayoutable, DrawableIcon, Flow, Link

public abstract class AbstractDrawable
extends java.lang.Object
implements Drawable

Designates an object which may be drawn and/or selected.

Author:
David Underhill

Constructor Summary
AbstractDrawable()
           
 
Method Summary
abstract  boolean contains(int x, int y)
          Whether these x, y coordinates fall are contained by the object
 void drag(int x, int y)
          Called when the object is dragged to position x, y
 void drawBeforeObject(java.awt.Graphics2D gfx)
          Graphics to be drawn before drawObject() is called
abstract  void drawObject(java.awt.Graphics2D gfx)
          Draw this object
 boolean isDrawn()
          Whether this object has been drawn this redraw cycle
 boolean isHovered()
          Whether this object currently has the mouse over it
 boolean isSelected()
          Whether this object is currently selected
 void setHovered(boolean hovering)
          Set whether this object currently has the mouse over it
 void setSelected(boolean selected)
          Set whether this object is currently selected
 void unsetDrawn()
          Flag this object as undrawn for the current redraw cycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDrawable

public AbstractDrawable()
Method Detail

drawBeforeObject

public void drawBeforeObject(java.awt.Graphics2D gfx)
Description copied from interface: Drawable
Graphics to be drawn before drawObject() is called

Specified by:
drawBeforeObject in interface Drawable

drawObject

public abstract void drawObject(java.awt.Graphics2D gfx)
Description copied from interface: Drawable
Draw this object

Specified by:
drawObject in interface Drawable

contains

public abstract boolean contains(int x,
                                 int y)
Description copied from interface: Drawable
Whether these x, y coordinates fall are contained by the object

Specified by:
contains in interface Drawable

isDrawn

public final boolean isDrawn()
Description copied from interface: Drawable
Whether this object has been drawn this redraw cycle

Specified by:
isDrawn in interface Drawable

unsetDrawn

public void unsetDrawn()
Description copied from interface: Drawable
Flag this object as undrawn for the current redraw cycle

Specified by:
unsetDrawn in interface Drawable

isSelected

public boolean isSelected()
Description copied from interface: Drawable
Whether this object is currently selected

Specified by:
isSelected in interface Drawable

setSelected

public void setSelected(boolean selected)
Description copied from interface: Drawable
Set whether this object is currently selected

Specified by:
setSelected in interface Drawable

isHovered

public boolean isHovered()
Description copied from interface: Drawable
Whether this object currently has the mouse over it

Specified by:
isHovered in interface Drawable

setHovered

public void setHovered(boolean hovering)
Description copied from interface: Drawable
Set whether this object currently has the mouse over it

Specified by:
setHovered in interface Drawable

drag

public void drag(int x,
                 int y)
Description copied from interface: Drawable
Called when the object is dragged to position x, y

Specified by:
drag in interface Drawable