|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Specifies methods for drawing shapes interactively on a canvas.
Field Summary | |
static int |
ANNOTEXT
|
static int |
ARROW
|
static int |
BOX
|
static int |
CUBIC_CURVE
|
static int |
CURVE
|
static int |
DOUBLE_HEADED_ARROW
|
static int |
ELLIPSE
|
static int |
LINE
|
static int |
NONE
|
static int |
POLYGON
|
Method Summary | |
void |
draw(java.awt.Graphics2D g)
Draws the shape permanently, which happens when the mouse is released. |
void |
drawInteractive(java.awt.Graphics2D g)
Draws the shape interactively, which means the shape can be erased when the mouse moves to next poistion. |
void |
erase(java.awt.Graphics2D g)
Erase the shape. |
void |
init(int x,
int y)
Initializes the shape. |
void |
move(java.awt.Graphics2D g,
int dispX,
int dispY)
Moves the shape by a specified displacement. |
void |
setCurrentPosition(java.awt.Point cp)
Sets the current position. |
Field Detail |
public static final int NONE
public static final int BOX
public static final int ELLIPSE
public static final int LINE
public static final int ARROW
public static final int DOUBLE_HEADED_ARROW
public static final int CURVE
public static final int CUBIC_CURVE
public static final int POLYGON
public static final int ANNOTEXT
Method Detail |
public void init(int x, int y)
x
- the y coordinate of the starting position of the shape.y
- the y coordinate of the starting position of the shape.public void setCurrentPosition(java.awt.Point cp)
cp
- the current position of shapepublic void drawInteractive(java.awt.Graphics2D g)
g
- the graphcs context on which the shape is drawn.public void draw(java.awt.Graphics2D g)
g
- the graphcs context on which the shape is drawn.public void move(java.awt.Graphics2D g, int dispX, int dispY)
x
- the displacement.y
- the displacement.public void erase(java.awt.Graphics2D g)
g
- the graphcs context on which the shape was drawn.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |