|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ach.vectorGraphics.GraphicEditor
AnnotationEditor.java
Copyright (c) 2004 Helge Hackbarth, All Rights Reserved.
A class to edit vector graphic objects.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
Field Summary | |
ach.vectorGraphics.Shape |
currentShape
Generic Shape object pointing to current drawing shape |
ShapeProps |
currentShapeProps
shape properties for current drawing mode |
int |
currentStampIdx
|
static int |
DISABLED
Editing mode "disabled" |
static int |
MEMOMODE
Memo drawing mode |
static int |
OVALMODE
Oval (ellipse) drawing mode |
static int |
POINTERMODE
Pointer mode (objects can be marked, moved, deleted etc.) |
static int |
POLYGONMODE
Polygon / freehand drawing mode |
static int |
RECTANGLEMODE
Rectangle drawing mode |
static int |
STAMPMODE
Stamping mode |
static int |
TEXTMODE
text drawing mode |
Constructor Summary | |
GraphicEditor(java.awt.Frame frame)
Constructor |
Method Summary | |
int |
getMode()
Get current drawing mode. |
ShapeList |
getShapeList()
Get current list of shapes as ShapeList. |
Stamp[] |
getStamps()
Get current stamps. |
boolean |
handleMouseDown(int x,
int y,
int modifiers,
int clickCount,
java.awt.Graphics g)
Handle mouse down event. |
boolean |
handleMouseDrag(int oldx,
int oldy,
int newx,
int newy,
int modifiers,
java.awt.Graphics g)
Handle mouse drag event. |
boolean |
handleMouseUp(int x,
int y,
int modifiers,
java.awt.Graphics g)
Handle mouse up event. |
void |
requestShapeProps()
Allow user to specify current shape properties interactively in a dialog. |
void |
setMode(int mode,
java.awt.Graphics g)
Set current drawing mode. |
void |
setShapeList(ShapeList sl)
Set or replace current ShapeList. |
void |
setStamps(Stamp[] stamps)
Set stamps. |
ach.vectorGraphics.Shape |
tagShape(int x,
int y,
boolean additivMode,
java.awt.Graphics g)
Find the topmost shape that contains the given point (the point with these coordinates is painted by the shape) and tag this shape depending on the tagmode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DISABLED
public static final int POINTERMODE
public static final int RECTANGLEMODE
public static final int OVALMODE
public static final int POLYGONMODE
public static final int MEMOMODE
public static final int TEXTMODE
public static final int STAMPMODE
public ShapeProps currentShapeProps
public ach.vectorGraphics.Shape currentShape
public int currentStampIdx
Constructor Detail |
public GraphicEditor(java.awt.Frame frame)
frame
- parent frame (referenced by pop up dialogs)Method Detail |
public void setShapeList(ShapeList sl)
sl
- a ShapeList that contains shapes to be drawn and editedpublic ShapeList getShapeList()
public void setStamps(Stamp[] stamps)
stamps
- an array of Stamp objects.public Stamp[] getStamps()
public void setMode(int mode, java.awt.Graphics g)
mode.
- public int getMode()
public void requestShapeProps()
public ach.vectorGraphics.Shape tagShape(int x, int y, boolean additivMode, java.awt.Graphics g)
x
- x-coordinate of the point to be checked which shape contains ity
- y-coordinate of the point to be checked which shape contains itadditivMode
- specifies if the shape should be added to a list of already tagged shapesg
- Graphics context where the tagged shapes should be marked as taggedpublic boolean handleMouseDown(int x, int y, int modifiers, int clickCount, java.awt.Graphics g)
x
- coordinate of mouse positiony
- coordinate of mouse positionmodifiers
- current state of modifiers (Shift-/Control-/Alt-Key)clickCount
- to distinguish between single and double clickg
- Graphics context for drawing operationspublic boolean handleMouseDrag(int oldx, int oldy, int newx, int newy, int modifiers, java.awt.Graphics g)
oldx
- coordinate of previous mouse positionoldy
- coordinate of previous mouse positionnewx
- coordinate of current mouse positionnewy
- coordinate of current mouse positionmodifiers
- current state of modifiers (Shift-/Control-/Alt-Key)g
- Graphics context for drawing operationspublic boolean handleMouseUp(int x, int y, int modifiers, java.awt.Graphics g)
x
- coordinate of mouse positiony
- coordinate of mouse positionmodifiers
- current state of modifiers (Shift-/Control-/Alt-Key)g
- Graphics context for drawing operations
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |