jview
Class DeleteCursor

java.lang.Object
  extended by java.awt.Cursor
      extended by jview.CanvasCursor
          extended by jview.CrossCursor
              extended by jview.DragCursor
                  extended by jview.ZoomCursor
                      extended by jview.DeleteCursor
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, Serializable, EventListener, MouseInputListener, Initializable, PropertyAware, PropertyComposed

public class DeleteCursor
extends ZoomCursor

A cursor that allows per-click deletes as well as drag-selected deletes of points in the underlying data canvas. It specifies on individual sets, indicated by the KEY_DELETESETS list. It supplies undelte actions as well as revert actions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jview.CrossCursor
CrossCursor.Draw
 
Field Summary
private  Action back
          The action for doing a one-step undel.
private static boolean DEFALLOWWHEEL
          The default zooming amount per whhel rotation.
static String DEFCURSORNAME
          Default name of this cursor.
private static String DEFDELETESETS
          Default setname we act on.
private static int DEFUNDOLEVEL
          Default undo levels.
private static double DEFWHEELZOOM
          The default zooming amount per whhel rotation.
static String KEY_ALLOWWHEEL
          If false, the wheel does not zoom.
static String KEY_DELETESETS
          The cursor only works on these sets.
static String KEY_UNDOLEVEL
          The number of undo levels, 0=unlimited.
static String KEY_WHEELZOOM
          The zooming amount per wheel step.
private  Map<String,List<Integer>> marks
          Whenever a mark is set, this ends here.
private  Action markset
          The action for setting a mark.
static String MARKSET
          The label one the unzoom-one, that steps one zoom back.
private  Action undel
          The action for reverting to the next mark set.
static String UNDELETE
          The label one the unzoom-one, that steps one zoom back.
static String UNDELMARK
          The label at the unzoom item.
private  Map<String,Shelf<List<DataTransfer>>> undo
          For each set we work on, we store the data transfer.
private  Map<String,Shelf<Rectangle2D>> unzoom
          To allow mixed undelete/unzoom, we also store the viewports.
 
Fields inherited from class jview.ZoomCursor
KEY_ALLOWSHIFT, KEY_SHIFTFACTOR, RETRACE, REVERT
 
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
DeleteCursor(PropertySupplying prop)
          Creates a new delete cursor.
 
Method Summary
protected  void dragSelect(Rectangle zoomselect, int mods)
          The selected area is an area where we remove points from.
 Map<String,Action> getActions()
          Returns all actions.
 Action getMarkSetAction()
          Returns the action for setting a mark in the undo tree.
 Action getUndeleteAction()
          Returns the action for reverting to the no-zoom original state.
 Action getUndoAction()
          Returns the action for retracing one zoom level.
 void init()
          Initializes the zoom cursor.
 void mouseClicked(MouseEvent me)
          Clicking with the mouse does remove the closest point in the data sets.
private  boolean redeemAll()
          We redeem the lately deleted data and remove that from our transfer list.
private  boolean redeemOne(Shelf<List<DataTransfer>> havemore, Shelf<Rectangle2D> rezoom, String set)
          We redeem the lately deleted data and remove that from our transfer list.
 void setComposedProperties(PropertySupplying prop)
          Compose with a PropertySupplying as we need subclassing Cursor.
 
Methods inherited from class jview.ZoomCursor
getRetraceAction, getRevertAction, mouseDragged, mousePressed, mouseReleased, mouseWheelMoved, zoomFactor
 
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

UNDELMARK

public static final String UNDELMARK
The label at the unzoom item.

See Also:
Constant Field Values

UNDELETE

public static final String UNDELETE
The label one the unzoom-one, that steps one zoom back.

See Also:
Constant Field Values

MARKSET

public static final String MARKSET
The label one the unzoom-one, that steps one zoom back.

See Also:
Constant Field Values

KEY_DELETESETS

public static final String KEY_DELETESETS
The cursor only works on these sets.

See Also:
Constant Field Values

KEY_UNDOLEVEL

public static final String KEY_UNDOLEVEL
The number of undo levels, 0=unlimited.

See Also:
Constant Field Values

KEY_WHEELZOOM

public static final String KEY_WHEELZOOM
The zooming amount per wheel step.

See Also:
Constant Field Values

KEY_ALLOWWHEEL

public static final String KEY_ALLOWWHEEL
If false, the wheel does not zoom.

See Also:
Constant Field Values

DEFCURSORNAME

public static final String DEFCURSORNAME
Default name of this cursor.

See Also:
Constant Field Values

DEFALLOWWHEEL

private static final boolean DEFALLOWWHEEL
The default zooming amount per whhel rotation.

See Also:
Constant Field Values

DEFWHEELZOOM

private static final double DEFWHEELZOOM
The default zooming amount per whhel rotation.

See Also:
Constant Field Values

DEFDELETESETS

private static final String DEFDELETESETS
Default setname we act on.

See Also:
Constant Field Values

DEFUNDOLEVEL

private static final int DEFUNDOLEVEL
Default undo levels.

See Also:
Constant Field Values

undo

private Map<String,Shelf<List<DataTransfer>>> undo
For each set we work on, we store the data transfer.


unzoom

private Map<String,Shelf<Rectangle2D>> unzoom
To allow mixed undelete/unzoom, we also store the viewports.


marks

private Map<String,List<Integer>> marks
Whenever a mark is set, this ends here.


back

private Action back
The action for doing a one-step undel.


undel

private Action undel
The action for reverting to the next mark set.


markset

private Action markset
The action for setting a mark.

Constructor Detail

DeleteCursor

public DeleteCursor(PropertySupplying prop)
Creates a new delete cursor. Dragging is always enabled.

Method Detail

setComposedProperties

public void setComposedProperties(PropertySupplying prop)
Compose with a PropertySupplying as we need subclassing Cursor.

Specified by:
setComposedProperties in interface PropertyAware
Overrides:
setComposedProperties in class ZoomCursor

init

public void init()
Initializes the zoom cursor. Here, the pop-up menu and the undo-zoom list is generated.

Specified by:
init in interface Initializable
Overrides:
init in class ZoomCursor

getUndoAction

public Action getUndoAction()
Returns the action for retracing one zoom level.


getUndeleteAction

public Action getUndeleteAction()
Returns the action for reverting to the no-zoom original state.


getMarkSetAction

public Action getMarkSetAction()
Returns the action for setting a mark in the undo tree.


getActions

public Map<String,Action> getActions()
Returns all actions. Some special, commonly used action may be retrieved also individually.

Overrides:
getActions in class ZoomCursor
Returns:
A mapping of action names to concrete actions.

mouseClicked

public void mouseClicked(MouseEvent me)
Clicking with the mouse does remove the closest point in the data sets.

Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class ZoomCursor

dragSelect

protected void dragSelect(Rectangle zoomselect,
                          int mods)
The selected area is an area where we remove points from.

Overrides:
dragSelect in class ZoomCursor
Parameters:
zoomselect - The on-screen Rectangle of the drag, not normalized.
mods - The extended modifiers of the mouse event on drag end.

redeemAll

private boolean redeemAll()
We redeem the lately deleted data and remove that from our transfer list.


redeemOne

private boolean redeemOne(Shelf<List<DataTransfer>> havemore,
                          Shelf<Rectangle2D> rezoom,
                          String set)
We redeem the lately deleted data and remove that from our transfer list.