org.pzgui.layout
Class AbstractLayoutable

java.lang.Object
  extended by org.pzgui.AbstractDrawable
      extended by org.pzgui.layout.AbstractLayoutable
All Implemented Interfaces:
Drawable, Layoutable
Direct Known Subclasses:
LayoutableIcon, Node

public abstract class AbstractLayoutable
extends AbstractDrawable
implements Layoutable

Designates an object which may be drawn and laid out.

Author:
David Underhill

Constructor Summary
AbstractLayoutable()
           
 
Method Summary
 boolean canPositionChange()
          whether the position can be changed
 boolean contains(int x, int y)
          returns true if the area described by getHeight()/getWidth() contains x, y
 void drag(int x, int y)
          Move the node when it is dragged
 java.awt.geom.Point2D getPos()
          returns the x and y coordinates of this object
 int getX()
          returns the x-coordinate of this object
 int getY()
          returns the y-coordinate of this object
 boolean hasPositionChanged()
          whether the position changed since the previous unsetPositionChanged() call
 void setCanPositionChange(boolean can)
          set whether the position can be changed
 void setPos(int x, int y)
          sets the x and y coordinates of this object
 void setXPos(int x)
          sets the x-coordinate of this object
 void setYPos(int y)
          sets the y-coordinate of this object
 void unsetPositionChanged()
          Causes hasPositionChanged() to return false until set*Pos() is called.
 
Methods inherited from class org.pzgui.AbstractDrawable
drawBeforeObject, drawObject, isDrawn, isHovered, isSelected, setHovered, setSelected, unsetDrawn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pzgui.layout.Layoutable
getHeight, getID, getWidth
 

Constructor Detail

AbstractLayoutable

public AbstractLayoutable()
Method Detail

getPos

public java.awt.geom.Point2D getPos()
Description copied from interface: Layoutable
returns the x and y coordinates of this object

Specified by:
getPos in interface Layoutable

getX

public int getX()
Description copied from interface: Layoutable
returns the x-coordinate of this object

Specified by:
getX in interface Layoutable

getY

public int getY()
Description copied from interface: Layoutable
returns the y-coordinate of this object

Specified by:
getY in interface Layoutable

setPos

public final void setPos(int x,
                         int y)
Description copied from interface: Layoutable
sets the x and y coordinates of this object

Specified by:
setPos in interface Layoutable

setXPos

public void setXPos(int x)
Description copied from interface: Layoutable
sets the x-coordinate of this object

Specified by:
setXPos in interface Layoutable

setYPos

public void setYPos(int y)
Description copied from interface: Layoutable
sets the y-coordinate of this object

Specified by:
setYPos in interface Layoutable

hasPositionChanged

public boolean hasPositionChanged()
Description copied from interface: Layoutable
whether the position changed since the previous unsetPositionChanged() call

Specified by:
hasPositionChanged in interface Layoutable

unsetPositionChanged

public void unsetPositionChanged()
Description copied from interface: Layoutable
Causes hasPositionChanged() to return false until set*Pos() is called.

Specified by:
unsetPositionChanged in interface Layoutable

canPositionChange

public boolean canPositionChange()
Description copied from interface: Layoutable
whether the position can be changed

Specified by:
canPositionChange in interface Layoutable

setCanPositionChange

public void setCanPositionChange(boolean can)
Description copied from interface: Layoutable
set whether the position can be changed

Specified by:
setCanPositionChange in interface Layoutable

contains

public boolean contains(int x,
                        int y)
returns true if the area described by getHeight()/getWidth() contains x, y

Specified by:
contains in interface Drawable
Specified by:
contains in class AbstractDrawable

drag

public void drag(int x,
                 int y)
Move the node when it is dragged

Specified by:
drag in interface Drawable
Overrides:
drag in class AbstractDrawable