jview
Class SelectCursor

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

public class SelectCursor
extends DragCursor

An extension to a cross cursor that allows selecting objects within a drawn rectangle. As objects are only recognizable in JNormalizedCanvas, this cursor only work on these Components

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jview.CrossCursor
CrossCursor.Draw
 
Field Summary
private static String DEFWORKON
          The default zooming amount per whhel rotation.
static String KEY_WORKON
          Defines on which kind of object we work.
private  Class<? extends Centerable> workon
          We work on this enum.
 
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
SelectCursor(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.
 void init()
          Initializes the zoom cursor.
 void mouseClicked(MouseEvent me)
          Clicking with the mouse selects only a single object, the one that is closest to the mouse-click point.
 void setComposedProperties(PropertySupplying prop)
          Compose with a PropertySupplying as we need subclassing Cursor.
 
Methods inherited from class jview.DragCursor
clearOnRepaint, mouseDragged, mouseEntered, mousePressed, mouseReleased
 
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, 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_WORKON

public static final String KEY_WORKON
Defines on which kind of object we work.

See Also:
Constant Field Values

DEFWORKON

private static final String DEFWORKON
The default zooming amount per whhel rotation.


workon

private Class<? extends Centerable> workon
We work on this enum.

Constructor Detail

SelectCursor

public SelectCursor(PropertySupplying prop)
Creates a new zoom cursor. Dragging is always enabled, even if overruled in properties.

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 DragCursor

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 CanvasCursor

mouseClicked

public void mouseClicked(MouseEvent me)
Clicking with the mouse selects only a single object, the one that is closest to the mouse-click point.


dragSelect

protected void dragSelect(Rectangle zoomselect,
                          int ignore)
This method now converts the selected screen rectangle into viewport coordinates to allow retracing. We store the normalized zoom in the zoom list

Specified by:
dragSelect in class DragCursor
Parameters:
zoomselect - The on-screen Rectangle of the drag, not normalized.
ignore - The extended modifiers of the mouse event on drag end.