Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.vistech.shapes
Interface Drawable

All Known Subinterfaces:
  Fillable, Typable

All Known Implementing Classes:
  Arrow, Curve, Line

public interface Drawable

Specifies methods for drawing shapes interactively on a canvas.

Version:
  1.0 24 July 1999
Author:
  Larry Rodrigues

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

### NONE

    public static final int NONE

### BOX

    public static final int BOX

### ELLIPSE

    public static final int ELLIPSE

### LINE

    public static final int LINE

### ARROW

    public static final int ARROW

### DOUBLE_HEADED_ARROW

    public static final int DOUBLE_HEADED_ARROW

### CURVE

    public static final int CURVE

### CUBIC_CURVE

    public static final int CUBIC_CURVE

### POLYGON

    public static final int POLYGON

### ANNOTEXT

    public static final int ANNOTEXT

Method Detail

### init

    public void init(int x,
                     int y)

  Initializes the shape. The inputs specify the anchor position of the shape,
  Parameters:
    `x` - the y coordinate of the starting position of the shape.
    `y` - the y coordinate of the starting position of the shape.

### setCurrentPosition

    public void setCurrentPosition(java.awt.Point cp)

  Sets the current position.
  Parameters:
    `cp` - the current position of shape

### drawInteractive

    public void drawInteractive(java.awt.Graphics2D g)

  Draws the shape interactively, which means the shape can be erased when the mouse moves to next poistion.
  Parameters:
    `g` - the graphcs context on which the shape is drawn.

### draw

    public void draw(java.awt.Graphics2D g)

  Draws the shape permanently, which happens when the mouse is released.
  Parameters:
    `g` - the graphcs context on which the shape is drawn.

### move

    public void move(java.awt.Graphics2D g,
                     int dispX,
                     int dispY)

  Moves the shape by a specified displacement.
  Parameters:
    `x` - the displacement.
    `y` - the displacement.

### erase

    public void erase(java.awt.Graphics2D g)

  Erase the shape.
  Parameters:
    `g` - the graphcs context on which the shape was drawn.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD