|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Cursor
jview.CanvasCursor
jview.CrossCursor
jview.DragCursor
public abstract class DragCursor
A cursor-like application that supplies a cross-hair above the entire
drawable area of a JShapeCanvas. If persitant marking is enabled
with the CrossCursor.KEY_PERSISTENT key, then clicking on the canvas adds a
cross-hair on the location clicked to the shape canvas.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jview.CrossCursor |
|---|
CrossCursor.Draw |
| Field Summary | |
|---|---|
private String |
angle
The angle string. |
private Point |
anglepos
The position to draw the angle indicator. |
private String |
coorupleft
The string at the starting point. |
private static int |
DEFANGLESIZE
The half size of the bounding rectangle of the angle arc. |
private static boolean |
DEFSHOWANGLE
The default angle marking. |
private static boolean |
DEFSHOWDELTAX
The default x-distance marking. |
private static boolean |
DEFSHOWDELTAY
The default y-distance marking. |
private static boolean |
DEFSHOWDISTANCE
The default total distance marking. |
private static boolean |
DEFSHOWSTART
The default start position marking. |
private String |
deltax
The delta-x string. |
private Point |
deltaxcoor
The position to draw the delta-x indicator. |
private String |
deltay
The delta-y string. |
private Point |
deltaycoor
The position to draw the delta-y indicator. |
private String |
distance
The distance string. |
private Point |
distpos
The position to draw the distance indicator. |
static String |
KEY_ANGLESIZE
The half size of the bounding rectangle of the angle arc. |
static String |
KEY_SHOWANGLE
If true, the angle is marked. |
static String |
KEY_SHOWDELTAX
If true, the distance in x is marked. |
static String |
KEY_SHOWDELTAY
If true, the distance in y is marked. |
static String |
KEY_SHOWDISTANCE
If true, the total distance is marked. |
static String |
KEY_SHOWSTART
If true, the starting point of the rectangle is marked. |
private Rectangle |
lastrec
The last rectangle drawn. |
private Point |
upleft
The starting point of a drag. |
| Fields inherited from class jview.CrossCursor |
|---|
cursorcolor, KEY_ALLOWDRAG, KEY_PERSISTENT, KEY_SHOWCOORDINATE, KEY_SINGLEPERSIST, KEY_XSHIFT, KEY_YSHIFT, lastcenter, lastposition, xformat, yformat |
| Fields inherited from class jview.CanvasCursor |
|---|
canvas, DEFCURSORCOLOR, KEY_COORDINATES, KEY_CURSORCOLOR, KEY_CURSORNAME, KEY_CURSORSIZE, NORMALIZED, NORMALIZEDACTION, SCREEN, SCREENACTION, USER, USERACTION |
| Fields inherited from class java.awt.Cursor |
|---|
CROSSHAIR_CURSOR, CUSTOM_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, N_RESIZE_CURSOR, name, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, predefined, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Constructor Summary | |
|---|---|
protected |
DragCursor(PropertySupplying prop)
Constructs a new cross cursor from properties. |
| Method Summary | |
|---|---|
protected void |
clearOnRepaint(Graphics2D g)
Updates the canvas in its own thread. |
private void |
deleteOldDrag(Graphics onto)
Deletes old drag strings etc. |
protected abstract void |
dragSelect(Rectangle screen,
int modifiers)
Calles after the mouse has been released after a drag with the rectangular screen-rectangle that has been drawn. |
private void |
drawAngle(Graphics onto,
Rectangle drag)
Draws an arc using the bottom-right position of the rectangle and the angle deferred from the rectangle shape. |
private void |
drawDiagonal(Graphics onto,
Rectangle drag)
Draws the diagonal of the dragging rectangle. |
private void |
drawRectangle(Graphics onto,
Rectangle drag)
Draws a dragging rectangle. |
void |
mouseDragged(MouseEvent me)
If mouse dragging is enabled, we draw a rectangle instead of a cursor cross. |
void |
mouseEntered(MouseEvent me)
When the mouse enters, we delete the old drag, if mous is not down |
void |
mousePressed(MouseEvent me)
If mouse dragging is allowed, we record the starting point. |
void |
mouseReleased(MouseEvent me)
We erease the active rectangle and everything else. |
void |
setComposedProperties(PropertySupplying info)
Compose with a PropertySupplying as we need subclassing Cursor. |
| Methods inherited from class jview.CrossCursor |
|---|
drawCross, drawPosition, getCoordinateLabel, getCoordinates, getCoordinatesPair, mouseExited, mouseMoved, setCoordinateFormat, setCoordinateLabel |
| Methods inherited from class jview.CanvasCursor |
|---|
disableCanvas, enableCanvas, getActions, getComposedProperties, getCursorName, getCursorShape, getCustomized, getNormalizedAction, getScreenAction, getUserAction, init, isConsider, isMe, isWithin, repaintCanvas, setCursorName, setCursorShape |
| Methods inherited from class java.awt.Cursor |
|---|
getDefaultCursor, getName, getPredefinedCursor, getSystemCustomCursor, getType, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.event.MouseListener |
|---|
mouseClicked |
| Field Detail |
|---|
public static final String KEY_SHOWSTART
public static final String KEY_SHOWDELTAX
public static final String KEY_SHOWDELTAY
public static final String KEY_SHOWDISTANCE
public static final String KEY_SHOWANGLE
public static final String KEY_ANGLESIZE
private static final boolean DEFSHOWSTART
private static final boolean DEFSHOWDELTAX
private static final boolean DEFSHOWDELTAY
private static final boolean DEFSHOWDISTANCE
private static final boolean DEFSHOWANGLE
private static final int DEFANGLESIZE
private Point upleft
private String coorupleft
private Rectangle lastrec
private Point deltaxcoor
private String deltax
private Point deltaycoor
private String deltay
private Point distpos
private String distance
private Point anglepos
private String angle
| Constructor Detail |
|---|
protected DragCursor(PropertySupplying prop)
JShapeCanvas manually.
| Method Detail |
|---|
public void setComposedProperties(PropertySupplying info)
PropertySupplying as we need subclassing Cursor.
setComposedProperties in interface PropertyAwaresetComposedProperties in class CrossCursorpublic void mousePressed(MouseEvent me)
public void mouseReleased(MouseEvent me)
public void mouseEntered(MouseEvent me)
mouseEntered in interface MouseListenermouseEntered in class CrossCursorpublic void mouseDragged(MouseEvent me)
protected abstract void dragSelect(Rectangle screen,
int modifiers)
screen - The on-screen Rectangle of the drag, not normalized.modifiers - The extended modifiers of the mouse event on drag end.protected void clearOnRepaint(Graphics2D g)
clearOnRepaint in class CrossCursor
private void drawRectangle(Graphics onto,
Rectangle drag)
private void drawDiagonal(Graphics onto,
Rectangle drag)
private void drawAngle(Graphics onto,
Rectangle drag)
private void deleteOldDrag(Graphics onto)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||