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

All Known Subinterfaces:
ActionTool, ModalTool
All Known Implementing Classes:
AbstractActionTool, AbstractContextMenuTool, AbstractModalTool, AbstractTool, SimpleTool

public interface Tool

The general interface for tools interacting with the Map Editor.

Must have a public default constructor so that the plug-in frame work can instantiate the class.

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

Field Summary
static java.lang.String EDIT
          Tool category for tools that modify.
static java.lang.String EXTENSION_ID
          The extension point id for tools
static java.lang.String VIEW
          Tool category for tools that do not modify.
 
Method Summary
 void addListener(ToolLifecycleListener listener)
          Adds listener of tool's lifecycle.
 void dispose()
          Releases resource, Cursor and image resources possibly.
 IToolContext getContext()
          Returns the AbstractContext that a tool can use in its operations.
 java.lang.Object getProperty(java.lang.String key)
          Returns the property of the particular tool implementation.
 boolean isEnabled()
          Returns enablement statement of the tool.
 void removeListener(ToolLifecycleListener listener)
          Removes a listener of tool's lifecycle.
 void setContext(IToolContext tools)
          Called each time an eclipse editor is activated.
 void setEnabled(boolean enable)
          Sets enablement of the tool.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the tool's property value by key.
 

Field Detail

VIEW

static final java.lang.String VIEW
Tool category for tools that do not modify. Examples are Pan and Zoom

See Also:
Constant Field Values

EDIT

static final java.lang.String EDIT
Tool category for tools that modify. Examples are Add Vertex and Add SimpleFeature

See Also:
Constant Field Values

EXTENSION_ID

static final java.lang.String EXTENSION_ID
The extension point id for tools

See Also:
Constant Field Values
Method Detail

dispose

void dispose()
Releases resource, Cursor and image resources possibly.


setContext

void setContext(IToolContext tools)
Called each time an eclipse editor is activated. The RenderManager and ViewportPane are those that are associated with the newly actived Eclipse view. Intended to be used if something other just changing the current state happens. if false the tool is set as inactive and deregistered with the component.

Parameters:
tools - The tools that the tool can use in its operations
See Also:
IToolContext

getContext

IToolContext getContext()
Returns the AbstractContext that a tool can use in its operations.

Returns:
the AbstractContext that a tool can use in its operations.
See Also:
IToolContext

getProperty

java.lang.Object getProperty(java.lang.String key)
Returns the property of the particular tool implementation.

Parameters:
key - the property key.
Returns:

setProperty

void setProperty(java.lang.String key,
                 java.lang.Object value)
Sets the tool's property value by key.

Parameters:
key -
value -

isEnabled

boolean isEnabled()
Returns enablement statement of the tool.

Returns:

setEnabled

void setEnabled(boolean enable)
Sets enablement of the tool.

Parameters:
enable -

addListener

void addListener(ToolLifecycleListener listener)
Adds listener of tool's lifecycle.

Parameters:
listener -

removeListener

void removeListener(ToolLifecycleListener listener)
Removes a listener of tool's lifecycle.

Parameters:
listener -