jview
Class MarkCursor

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.MarkCursor
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, Serializable, EventListener, MouseInputListener, Initializable, PropertyAware, PropertyComposed

public class MarkCursor
extends ZoomCursor

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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jview.CrossCursor
CrossCursor.Draw
 
Field Summary
private static String CLEARACTION
          The label on the action for saving current zoom.
private  Action clearcanvas
          An action for printing the current underlying canvas.
private static String CURSOR
          The name for cursor objects added to the underlying canvas.
private static double DEFOFFSET
          The maximal quadratic offset for erasing in normalized space.
private static boolean DEFSINGLEPERSIST
          The default single persistance behaviour.
static String KEY_OFFSET
          The maximal quadratic offset for erasing in normalized space.
static String KEY_SINGLEPERSIST
          If true, only a single persistent is active.
private  Map<Point2D,Object[]> permanent
          A mapping of permanently added crosses and corrdinates.
 
Fields inherited from class jview.ZoomCursor
DEFCURSORNAME, KEY_ALLOWSHIFT, KEY_ALLOWWHEEL, KEY_SHIFTFACTOR, KEY_WHEELZOOM, 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_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
MarkCursor(PropertySupplying prop)
          Constructs a new cross cursor from properties.
 
Method Summary
 void enableCanvas(JNormalizedCanvas root)
          Assigns the JShapeCanvas to the cursor.
 Action getClearAction()
          Returns the action that saves the underlying component.
 void init()
          Initializes the zoom cursor.
 void mouseClicked(MouseEvent me)
          If persistent storage is enabled via the CrossCursor.KEY_PERSISTENT key, clicking of the mouse adds a cross-shape to the underlying canvas or removes it if it happens close to a priorly added cross-shape.
 void setComposedProperties(PropertySupplying info)
          Compose with a PropertySupplying as we need subclassing Cursor.
 
Methods inherited from class jview.ZoomCursor
dragSelect, getActions, 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, 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

KEY_SINGLEPERSIST

public static final String KEY_SINGLEPERSIST
If true, only a single persistent is active.

See Also:
Constant Field Values

KEY_OFFSET

public static final String KEY_OFFSET
The maximal quadratic offset for erasing in normalized space.

See Also:
Constant Field Values

DEFSINGLEPERSIST

private static final boolean DEFSINGLEPERSIST
The default single persistance behaviour.

See Also:
Constant Field Values

DEFOFFSET

private static final double DEFOFFSET
The maximal quadratic offset for erasing in normalized space.

See Also:
Constant Field Values

CLEARACTION

private static final String CLEARACTION
The label on the action for saving current zoom.

See Also:
Constant Field Values

CURSOR

private static final String CURSOR
The name for cursor objects added to the underlying canvas.

See Also:
Constant Field Values

permanent

private Map<Point2D,Object[]> permanent
A mapping of permanently added crosses and corrdinates.


clearcanvas

private Action clearcanvas
An action for printing the current underlying canvas.

Constructor Detail

MarkCursor

public MarkCursor(PropertySupplying prop)
Constructs a new cross cursor from properties. Needs to register the JShapeCanvas manually.

Method Detail

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

setComposedProperties

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

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

getClearAction

public Action getClearAction()
Returns the action that saves the underlying component.


mouseClicked

public void mouseClicked(MouseEvent me)
If persistent storage is enabled via the CrossCursor.KEY_PERSISTENT key, clicking of the mouse adds a cross-shape to the underlying canvas or removes it if it happens close to a priorly added cross-shape.

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

enableCanvas

public void enableCanvas(JNormalizedCanvas root)
Assigns the JShapeCanvas to the cursor. This method must always be called prior to activation of the cursor, i.e. adding it as a mouse listener.

Overrides:
enableCanvas in class CanvasCursor