|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CanvasGraphics
This defines an interface for drawing figures on a canvas of some type.
Field Summary | |
---|---|
static int |
MOVE
Constant indicating that a figure may be moved |
static int |
RESIZE
Constant indicating that a figure may be resized |
static int |
ROTATE
Constant indicating that a figure may be rotated |
static int |
SELECT
Constant indicating that a figure may be selected |
Method Summary | |
---|---|
void |
add(CanvasFigure fig)
Add the given figure to the canvas. |
void |
deselect(CanvasFigure fig)
Deselect the given figure. |
int |
getFigureCount()
Return the number of figures. |
CanvasFigure |
makeFigure(java.awt.Shape shape,
java.awt.Paint fill,
java.awt.Paint outline,
float lineWidth)
Make and return a figure with the given shape, fill, outline and line width. |
CanvasFigureGroup |
makeFigureGroup()
Make and return a new CanvasFigureGroup object that can be used as a figure container to hold other figures. |
CanvasFigure |
makeLabel(java.awt.geom.Point2D.Double pos,
java.lang.String text,
java.awt.Paint color,
java.awt.Font font)
Make and return a canvas label. |
CanvasFigure |
makeLabeledFigure(java.awt.Shape shape,
java.awt.Paint fill,
java.awt.Paint outline,
float lineWidth,
java.lang.String label,
int anchor,
java.awt.Paint labelColor,
java.awt.Font font)
Make and return a labeled figure with the given shape, fill, outline and line width. |
void |
remove(CanvasFigure fig)
Remove the given figure from the display. |
void |
repaint()
Schedule a repaint of the window containing the graphics. |
void |
scheduleRemoval(CanvasFigure fig)
Schedule the removal of the given figure from the display at a later time. |
void |
select(CanvasFigure fig)
Select the given figure. |
void |
selectArea(SelectedAreaListener l)
Wait for the user to drag out an area on the canvas and then notify the listener with the coordinates of the box. |
void |
setInteractionMode(CanvasFigure fig,
int mode)
Set the interaction mode for the given figure to an OR'ed combination of the following constants: SELECT, MOVE, RESIZE, ROTATE. |
void |
transform(java.awt.geom.AffineTransform trans)
Transform all graphics according to the given AffineTransform object. |
Field Detail |
---|
static final int SELECT
static final int MOVE
static final int RESIZE
static final int ROTATE
Method Detail |
---|
CanvasFigure makeFigure(java.awt.Shape shape, java.awt.Paint fill, java.awt.Paint outline, float lineWidth)
The CoordinateConverter object of the image display class may be used while constructing the shape to convert to screen coordinates as needed.
shape
- the shape to drawfill
- the paint to use to fill the shapeoutline
- the paint to use for the outlinelineWidth
- the width of the shape lines in pixels
CoordinateConverter
,
GraphicsImageDisplay
CanvasFigure makeLabeledFigure(java.awt.Shape shape, java.awt.Paint fill, java.awt.Paint outline, float lineWidth, java.lang.String label, int anchor, java.awt.Paint labelColor, java.awt.Font font)
shape
- the shape to drawfill
- the paint to use to fill the shapeoutline
- the paint to use for the outlinelineWidth
- the width of the shape lines in pixelslabel
- the label text to be displayed with the figureanchor
- SwingConstants value for the label position (CENTER, EAST, ...)labelColor
- color of the labelfont
- the label's font
CanvasFigure makeLabel(java.awt.geom.Point2D.Double pos, java.lang.String text, java.awt.Paint color, java.awt.Font font)
pos
- the label positiontext
- the text of the label to drawcolor
- the paint to use to draw the textfont
- the font to use for the labelCanvasFigureGroup makeFigureGroup()
void add(CanvasFigure fig)
void remove(CanvasFigure fig)
void select(CanvasFigure fig)
void deselect(CanvasFigure fig)
void scheduleRemoval(CanvasFigure fig)
int getFigureCount()
void transform(java.awt.geom.AffineTransform trans)
void setInteractionMode(CanvasFigure fig, int mode)
void selectArea(SelectedAreaListener l)
void repaint()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |