|
||||||||||
| 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
jview.ZoomCursor
public class ZoomCursor
An extension to a cross cursor that allows zooming into
JShapeCanvas dedescants, if they support it via a populated
JShapeCanvas#selectArea method. This cursor stores all passed
zoom-stages, allowing for step-wise retracing of the zooming events.
Components that want to add support for unzooming may query the cursors
actions getRevertAction() for total unzoom and
getRetraceAction() for a single step unzoom.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jview.CrossCursor |
|---|
CrossCursor.Draw |
| Field Summary | |
|---|---|
private static boolean |
DEFALLOWSHIFT
The default zooming amount per whhel rotation. |
private static boolean |
DEFALLOWWHEEL
The default zooming amount per whhel rotation. |
static String |
DEFCURSORNAME
Default name of this cursor. |
private static double |
DEFSHIFTFACTOR
The default shift per drag. |
private static double |
DEFWHEELZOOM
The default zooming amount per whhel rotation. |
static String |
KEY_ALLOWSHIFT
If false, shifitng is not allowed. |
static String |
KEY_ALLOWWHEEL
If false, the wheel does not zoom. |
static String |
KEY_SHIFTFACTOR
The shifting multiplier if dragged with "shift" pressed. |
static String |
KEY_WHEELZOOM
The zooming amount per wheel step. |
private Action |
retrace
The action for retracing one zoom step. |
static String |
RETRACE
The label one the unzoom-one, that steps one zoom back. |
private Action |
revert
The action for reverting to the orginial, no-zoom level. |
static String |
REVERT
The label at the unzoom item. |
private Point2D |
shiftcenter
For shifting events, this is the normalized mouse-down point. |
private Rectangle2D |
shiftview
For shifting events, this is the viewport at mouse down. |
private Shelf<Rectangle2D> |
zoom
A history of zooms. |
| Fields inherited from class jview.DragCursor |
|---|
KEY_ANGLESIZE, KEY_SHOWANGLE, KEY_SHOWDELTAX, KEY_SHOWDELTAY, KEY_SHOWDISTANCE, KEY_SHOWSTART |
| 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 | |
|---|---|
ZoomCursor(PropertySupplying prop)
Creates a new zoom cursor. |
|
| Method Summary | |
|---|---|
protected void |
dragSelect(Rectangle zoomselect,
int ignore)
This method now converts the selected screen rectangle into viewport coordinates to allow retracing. |
Map<String,Action> |
getActions()
Returns all actions. |
Action |
getRetraceAction()
Returns the action for retracing one zoom level. |
Action |
getRevertAction()
Returns the action for reverting to the no-zoom original state. |
void |
init()
Initializes the zoom cursor. |
void |
mouseClicked(MouseEvent me)
Clicking with the mouse does not do anything. |
void |
mouseDragged(MouseEvent me)
If mouse dragging is enabled, we draw a rectangle instead of a cursor cross. |
void |
mousePressed(MouseEvent me)
If mouse shifting is allowed, we record the starting viewport. |
void |
mouseReleased(MouseEvent me)
For unzooming, we record the position of the shift start and the current viewport. |
void |
mouseWheelMoved(MouseWheelEvent we)
Grabs mouse wheel events. |
void |
setComposedProperties(PropertySupplying prop)
Compose with a PropertySupplying as we need subclassing Cursor. |
protected double |
zoomFactor(MouseWheelEvent we)
Returns the zoom factor. |
| Methods inherited from class jview.DragCursor |
|---|
clearOnRepaint, mouseEntered |
| Methods inherited from class jview.CrossCursor |
|---|
drawCross, drawPosition, getCoordinateLabel, getCoordinates, getCoordinatesPair, mouseExited, mouseMoved, setCoordinateFormat, setCoordinateLabel |
| Methods inherited from class jview.CanvasCursor |
|---|
disableCanvas, enableCanvas, getComposedProperties, getCursorName, getCursorShape, getCustomized, getNormalizedAction, getScreenAction, getUserAction, 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 |
| Field Detail |
|---|
public static final String KEY_WHEELZOOM
public static final String KEY_ALLOWWHEEL
public static final String KEY_SHIFTFACTOR
public static final String KEY_ALLOWSHIFT
public static final String DEFCURSORNAME
private static final boolean DEFALLOWWHEEL
private static final double DEFWHEELZOOM
private static final boolean DEFALLOWSHIFT
private static final double DEFSHIFTFACTOR
public static final String REVERT
public static final String RETRACE
private Shelf<Rectangle2D> zoom
private Action retrace
private Action revert
private Rectangle2D shiftview
private Point2D shiftcenter
| Constructor Detail |
|---|
public ZoomCursor(PropertySupplying prop)
| Method Detail |
|---|
public void setComposedProperties(PropertySupplying prop)
PropertySupplying as we need subclassing Cursor.
setComposedProperties in interface PropertyAwaresetComposedProperties in class DragCursorpublic void init()
init in interface Initializableinit in class CanvasCursorpublic Action getRetraceAction()
public Action getRevertAction()
public Map<String,Action> getActions()
getActions in class CanvasCursorpublic void mouseClicked(MouseEvent me)
mouseClicked in interface MouseListenerpublic void mouseWheelMoved(MouseWheelEvent we)
mouseWheelMoved in interface MouseWheelListenerprotected double zoomFactor(MouseWheelEvent we)
public void mousePressed(MouseEvent me)
mousePressed in interface MouseListenermousePressed in class DragCursorpublic void mouseDragged(MouseEvent me)
mouseDragged in interface MouseMotionListenermouseDragged in class DragCursorpublic void mouseReleased(MouseEvent me)
mouseReleased in interface MouseListenermouseReleased in class DragCursor
protected void dragSelect(Rectangle zoomselect,
int ignore)
dragSelect in class DragCursorzoomselect - The on-screen Rectangle of the drag, not normalized.ignore - The extended modifiers of the mouse event on drag end.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||