DixShtix

com.dixshtix.awt11
Class DraggableRectangle

java.lang.Object
  |
  +--com.dixshtix.awt11.DraggableRectangle
All Implemented Interfaces:
Drag11able
Direct Known Subclasses:
DraggableOval, DraggablePolygon, DraggableRoundRectangle

public class DraggableRectangle
extends java.lang.Object
implements Drag11able


Field Summary
protected  int deltaX
           
protected  int deltaY
           
protected  java.awt.Rectangle myBounds
           
protected  java.awt.Color myPaint
           
protected  int myX
           
protected  int myY
           
 
Constructor Summary
DraggableRectangle(java.awt.Rectangle s, java.awt.Color p, int x, int y)
           
 
Method Summary
 java.awt.Rectangle computeBounds(java.awt.Point position)
           
 boolean contains(int x, int y)
           
 void draw(java.awt.Graphics g)
           
 void drawAsOutline(java.awt.Graphics g, java.awt.Point position)
           
 java.awt.Rectangle getBounds()
           
 java.awt.Point getPosition()
           
 void setPosition(java.awt.Point newPosition)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

myPaint

protected java.awt.Color myPaint

myBounds

protected java.awt.Rectangle myBounds

myX

protected int myX

myY

protected int myY

deltaX

protected int deltaX

deltaY

protected int deltaY
Constructor Detail

DraggableRectangle

public DraggableRectangle(java.awt.Rectangle s,
                          java.awt.Color p,
                          int x,
                          int y)
Method Detail

getPosition

public java.awt.Point getPosition()
Specified by:
getPosition in interface Drag11able

setPosition

public void setPosition(java.awt.Point newPosition)
Specified by:
setPosition in interface Drag11able

contains

public boolean contains(int x,
                        int y)
Specified by:
contains in interface Drag11able

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface Drag11able

computeBounds

public java.awt.Rectangle computeBounds(java.awt.Point position)
Specified by:
computeBounds in interface Drag11able

draw

public void draw(java.awt.Graphics g)
Specified by:
draw in interface Drag11able

drawAsOutline

public void drawAsOutline(java.awt.Graphics g,
                          java.awt.Point position)
Specified by:
drawAsOutline in interface Drag11able

DixShtix