|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Cursor
jview.CanvasCursor
public abstract class CanvasCursor
A cursor-like application that supplies a cross-hair above the entire
drawable area of a JShapeCanvas. If persitant marking is enabled with
the #KEY_PERSISTENT key, then clicking on the canvas adds a
cross-hair on the location clicked to the shape canvas.
| Field Summary | |
|---|---|
protected JNormalizedCanvas |
canvas
The pointer to the underlying JShapeCanvas. |
private Shape |
cursorshape
The shape from which the customized cursor is generated. |
private Cursor |
customized
If we have a customized cursor. |
private static int |
DEFCOORDINATES
The default coordinates to display. |
protected static Color |
DEFCURSORCOLOR
The default cursor cross color. |
private static Dimension |
DEFCURSORSIZE
The default cursor position marking. |
private PropertySupplying |
info
My composed properties. |
static String |
KEY_COORDINATES
The integer specifying display of screen, normalized or user coor. |
static String |
KEY_CURSORCOLOR
The color of the cursor cross. |
static String |
KEY_CURSORNAME
The name of this cursor, if customized. |
static String |
KEY_CURSORSIZE
The preferred pixel size of the cursor image, if customized. |
static int |
NORMALIZED
The integer for showing normalized coordinates. |
static String |
NORMALIZEDACTION
The label on the action for switching to normalized coor. |
private Action |
normalizedcor
An action for switch to display of normalized corrdinates. |
static int |
SCREEN
The integer for showing screen coordinates. |
static String |
SCREENACTION
The label on the action for switching to screen coordinate display. |
private Action |
screencor
An action for switch to display of screen corrdinates. |
static int |
USER
The integer for showing user coordinates. |
static String |
USERACTION
The label on the action for switching to user coordinate display. |
private Action |
usercor
An action for switch to display of user coordinates. |
| 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 |
CanvasCursor(PropertySupplying prop)
Constructs a new cross cursor from properties. |
| Method Summary | |
|---|---|
protected void |
clearOnRepaint(Graphics2D g2d)
Clears leftovers before redrawing. |
void |
disableCanvas()
Removes the canvas from this cursor. |
void |
enableCanvas(JNormalizedCanvas root)
Assigns the JShapeCanvas to the cursor. |
Map<String,Action> |
getActions()
Returns all actions. |
PropertySupplying |
getComposedProperties()
Returns the PropertySupplyings this canvas refers to. |
String |
getCursorName()
Returns the cursor name. |
protected Shape |
getCursorShape()
If a shape is returned here, we create a custom cursor image out of that, hot point is center of shape. |
Cursor |
getCustomized()
If we have a special non-default customized cursor. |
Action |
getNormalizedAction()
Returns the action that switches to normalized coordinate display. |
Action |
getScreenAction()
Returns the action that switches to screen coordinate display. |
Action |
getUserAction()
Returns the action that switches to user coordinate display. |
void |
init()
Initializes the zoom cursor. |
protected boolean |
isConsider(MouseEvent me)
Checks if the mouse event is triggered by a left mouse click and if it occured within the active area. |
protected boolean |
isMe(MouseEvent me)
Checks, if this mouse event applies to me, i.e. |
protected boolean |
isWithin(MouseEvent me)
Checks if the mouse event is triggered by a left mouse click and if it occured within the component, which is normally bigger than the active area. |
protected void |
repaintCanvas()
Updates the canvas in its own thread. |
void |
setComposedProperties(PropertySupplying prop)
Compose with a PropertySupplying as we need subclassing Cursor. |
protected void |
setCursorName(String toname)
Returns the cursor name. |
protected void |
setCursorShape(Shape cs)
Sets a cursor shape for drawing. |
| 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 int USER
public static final int NORMALIZED
public static final int SCREEN
public static final String SCREENACTION
public static final String NORMALIZEDACTION
public static final String USERACTION
public static final String KEY_CURSORCOLOR
public static final String KEY_CURSORSIZE
public static final String KEY_CURSORNAME
public static final String KEY_COORDINATES
protected static final Color DEFCURSORCOLOR
private static final Dimension DEFCURSORSIZE
private static final int DEFCOORDINATES
protected JNormalizedCanvas canvas
JShapeCanvas.
private PropertySupplying info
private Shape cursorshape
private Cursor customized
private Action screencor
private Action normalizedcor
private Action usercor
| Constructor Detail |
|---|
protected CanvasCursor(PropertySupplying prop)
JShapeCanvas manually.
| Method Detail |
|---|
public void init()
init in interface Initializablepublic void setComposedProperties(PropertySupplying prop)
PropertySupplying as we need subclassing Cursor.
setComposedProperties in interface PropertyAwarepublic String getCursorName()
protected void setCursorName(String toname)
public PropertySupplying getComposedProperties()
PropertySupplyings this canvas refers to.
getComposedProperties in interface PropertyComposedpublic Map<String,Action> getActions()
public Action getScreenAction()
public Action getNormalizedAction()
public Action getUserAction()
public void enableCanvas(JNormalizedCanvas root)
JShapeCanvas to the cursor. This method must always
be called prior to activation of the cursor, i.e. adding it as a mouse
listener. If the #getCursotShape method returns a non-null shape,
we set a custom cursor on the parent component, otherwise a cross-cursor
is used.
public void disableCanvas()
enableCanvas(jview.JNormalizedCanvas). Always call this method to stop receiving events
from the canvas.
public Cursor getCustomized()
enableCanvas(jview.JNormalizedCanvas), because the cursor shape depends on the
component it is assigned to.
protected Shape getCursorShape()
protected void setCursorShape(Shape cs)
protected boolean isMe(MouseEvent me)
protected boolean isWithin(MouseEvent me)
protected boolean isConsider(MouseEvent me)
protected void clearOnRepaint(Graphics2D g2d)
protected void repaintCanvas()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||