com.dixshtix.awt
Class DraggableShape
java.lang.Object
|
+--com.dixshtix.awt.DraggableShape
- All Implemented Interfaces:
- Draggable
- public class DraggableShape
- extends java.lang.Object
- implements Draggable
Title:
Description:
Copyright: Copyright (c) Richard C. Penner II
Company:
- Version:
- 1.0
- Author:
- Richard C. Penner II
Method Summary |
java.awt.geom.Rectangle2D |
computeBounds(java.awt.geom.Point2D position)
|
boolean |
contains(double x,
double y)
|
void |
draw(java.awt.Graphics2D g)
|
void |
drawAsOutline(java.awt.Graphics2D g,
java.awt.geom.Point2D position)
|
java.awt.geom.Rectangle2D |
getBounds()
|
java.awt.geom.Point2D |
getPosition()
|
void |
setPosition(java.awt.geom.Point2D newPosition)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
myShape
private java.awt.Shape myShape
myPaint
private java.awt.Paint myPaint
myBounds2D
private java.awt.geom.Rectangle2D myBounds2D
myX
private float myX
myY
private float myY
deltaX
private double deltaX
deltaY
private double deltaY
DraggableShape
public DraggableShape(java.awt.Shape s,
java.awt.Paint p,
float x,
float y)
DraggableShape
public DraggableShape(java.awt.Shape s,
float x,
float y)
DraggableShape
public DraggableShape(java.awt.Shape s,
java.awt.Paint p)
DraggableShape
public DraggableShape(java.awt.Shape s,
java.awt.Paint p,
java.awt.geom.Point2D location)
DraggableShape
public DraggableShape(java.awt.Shape s,
java.awt.geom.Point2D location)
DraggableShape
public DraggableShape(java.awt.Shape s)
getPosition
public java.awt.geom.Point2D getPosition()
- Specified by:
getPosition
in interface Draggable
setPosition
public void setPosition(java.awt.geom.Point2D newPosition)
- Specified by:
setPosition
in interface Draggable
contains
public boolean contains(double x,
double y)
- Specified by:
contains
in interface Draggable
getBounds
public java.awt.geom.Rectangle2D getBounds()
- Specified by:
getBounds
in interface Draggable
computeBounds
public java.awt.geom.Rectangle2D computeBounds(java.awt.geom.Point2D position)
- Specified by:
computeBounds
in interface Draggable
draw
public void draw(java.awt.Graphics2D g)
- Specified by:
draw
in interface Draggable
drawAsOutline
public void drawAsOutline(java.awt.Graphics2D g,
java.awt.geom.Point2D position)
- Specified by:
drawAsOutline
in interface Draggable