net.refractions.udig.project.ui.tool
Interface ModalTool

All Superinterfaces:
Tool
All Known Implementing Classes:
AbstractContextMenuTool, AbstractModalTool, SimpleTool

public interface ModalTool
extends Tool

A ModalTool is a tool which "takes control" of how the Map Editor operates.of operation.

An example consider the *Zoom* tool - If the zoom tool is "on" then other tools modal tools must be off.

Must have a public default constructor so that the plugin frame work can instantiate the class.

Contains the following properties:

Version:
$Revision: 1.9 $
Author:
Jesse Eichar
See Also:
AbstractModalTool

Field Summary
static java.lang.String CROSSHAIR_CURSOR
          The crosshair cursor type.
static java.lang.String DEFAULT_CURSOR
          The default cursor type (gets set if no cursor is defined).
static java.lang.String E_RESIZE_CURSOR
          The east-resize cursor type.
static java.lang.String HAND_CURSOR
          The hand cursor type.
static java.lang.String MOVE_CURSOR
          The move cursor type.
static java.lang.String N_RESIZE_CURSOR
          The north-resize cursor type.
static java.lang.String NE_RESIZE_CURSOR
          The north-east-resize cursor type.
static java.lang.String NO_CURSOR
           
static java.lang.String NW_RESIZE_CURSOR
          The north-west-resize cursor type.
static java.lang.String S_RESIZE_CURSOR
          The south-resize cursor type.
static java.lang.String SE_RESIZE_CURSOR
          The south-east-resize cursor type.
static java.lang.String SW_RESIZE_CURSOR
          The south-west-resize cursor type.
static java.lang.String TEXT_CURSOR
          The text cursor type.
static java.lang.String W_RESIZE_CURSOR
          The west-resize cursor type.
static java.lang.String WAIT_CURSOR
          The wait cursor type.
 
Fields inherited from interface net.refractions.udig.project.ui.tool.Tool
EDIT, EXTENSION_ID, VIEW
 
Method Summary
 java.lang.String getCursorID()
          Returns current cursor ID of the modal tool.
 IMapEditorSelectionProvider getSelectionProvider()
          Returns tool's selection provider.
 boolean isActive()
          Returns true if the current tool is active.
 void setActive(boolean active)
          Called when tool button is pressed.
 void setCursorID(java.lang.String id)
          Sets the current cursor ID for the modal tool.
 void setSelectionProvider(IMapEditorSelectionProvider selectionProvider)
          Sets tool's selection provider.
 
Methods inherited from interface net.refractions.udig.project.ui.tool.Tool
addListener, dispose, getContext, getProperty, isEnabled, removeListener, setContext, setEnabled, setProperty
 

Field Detail

DEFAULT_CURSOR

static final java.lang.String DEFAULT_CURSOR
The default cursor type (gets set if no cursor is defined).

See Also:
Constant Field Values

CROSSHAIR_CURSOR

static final java.lang.String CROSSHAIR_CURSOR
The crosshair cursor type.

See Also:
Constant Field Values

TEXT_CURSOR

static final java.lang.String TEXT_CURSOR
The text cursor type.

See Also:
Constant Field Values

WAIT_CURSOR

static final java.lang.String WAIT_CURSOR
The wait cursor type.

See Also:
Constant Field Values

SW_RESIZE_CURSOR

static final java.lang.String SW_RESIZE_CURSOR
The south-west-resize cursor type.

See Also:
Constant Field Values

SE_RESIZE_CURSOR

static final java.lang.String SE_RESIZE_CURSOR
The south-east-resize cursor type.

See Also:
Constant Field Values

NW_RESIZE_CURSOR

static final java.lang.String NW_RESIZE_CURSOR
The north-west-resize cursor type.

See Also:
Constant Field Values

NE_RESIZE_CURSOR

static final java.lang.String NE_RESIZE_CURSOR
The north-east-resize cursor type.

See Also:
Constant Field Values

N_RESIZE_CURSOR

static final java.lang.String N_RESIZE_CURSOR
The north-resize cursor type.

See Also:
Constant Field Values

S_RESIZE_CURSOR

static final java.lang.String S_RESIZE_CURSOR
The south-resize cursor type.

See Also:
Constant Field Values

W_RESIZE_CURSOR

static final java.lang.String W_RESIZE_CURSOR
The west-resize cursor type.

See Also:
Constant Field Values

E_RESIZE_CURSOR

static final java.lang.String E_RESIZE_CURSOR
The east-resize cursor type.

See Also:
Constant Field Values

HAND_CURSOR

static final java.lang.String HAND_CURSOR
The hand cursor type.

See Also:
Constant Field Values

MOVE_CURSOR

static final java.lang.String MOVE_CURSOR
The move cursor type.

See Also:
Constant Field Values

NO_CURSOR

static final java.lang.String NO_CURSOR
See Also:
Constant Field Values
Method Detail

setActive

void setActive(boolean active)
Called when tool button is pressed. If active is set to true the tool is Registered with the source Component so that it receives events and will begin operating If active is set to false the tool is set as inactive and deregistered with the component.

Parameters:
active - if true the tool is Registered with the source Component so that it receives events and will begin operating. if false the tool is set as inactive and deregistered with the component.

isActive

boolean isActive()
Returns true if the current tool is active.

Returns:

getCursorID

java.lang.String getCursorID()
Returns current cursor ID of the modal tool.

Returns:

setCursorID

void setCursorID(java.lang.String id)
Sets the current cursor ID for the modal tool. If it is needed the actual updating of the mouse cursor is performed automatically.

Parameters:
id - the cursor ID from net.refractions.udig.project.ui.tool.toolCursor extension or the constant from ModalTool interface.

setSelectionProvider

void setSelectionProvider(IMapEditorSelectionProvider selectionProvider)
Sets tool's selection provider.

Usually it is configured through extension point.

Parameters:
selectionProvider -

getSelectionProvider

IMapEditorSelectionProvider getSelectionProvider()
Returns tool's selection provider.

Now the modal tool may have 0..1 of selection providers.

Returns:
the modal tool's selection provider.