skrueger.geotools
Class XMapPaneTool

java.lang.Object
  extended by skrueger.geotools.XMapPaneTool
All Implemented Interfaces:
Copyable<XMapPaneTool>

public class XMapPaneTool
extends Object
implements Copyable<XMapPaneTool>

This class combines the mapping of mouse-inputs and keyboard inputs to XMapPaneActions and provides a tool icon and a default mouse cursor.


Field Summary
static XMapPaneTool INFO
          The configuration of the INFO XMapPaneTool
static XMapPaneTool NO_ACTION
          This XMapPaneTool does nothing
static XMapPaneTool PAN
          The configuration of the PAN XMapPaneTool
static ResourceProvider RESOURCE
           
static XMapPaneTool SELECTION_ADD
           
static XMapPaneTool SELECTION_ALL_LAYERS
          A tool that will do a select_top action on the left mouse button
static XMapPaneTool SELECTION_ONE_FROM_TOP_LAYER
          A tool that will do a select_top action on the left mouse button
static XMapPaneTool SELECTION_REMOVE
           
static XMapPaneTool SELECTION_SET
           
static XMapPaneTool SELECTION_TOP_LAYER
          A tool that will do a select_top action on the left mouse button
static XMapPaneTool ZOOM_IN
          The configuration of the default ZOOM IN XMapPaneTool
static XMapPaneTool ZOOM_OUT
          The configuration of the default ZOOM IN XMapPaneTool
 
Constructor Summary
XMapPaneTool()
          The default constructor sets some default keyboard settings
 
Method Summary
 XMapPaneTool copy()
          Returns a copy of the tool to derive other tools.
 XMapPaneTool copyTo(XMapPaneTool tool)
          Copies all actions of this tool to another.
 Cursor getCursor()
           
 Icon getIcon()
          An icon to use if the tool is associated with a button.
 XMapPaneAction getKeyAction(KeyStroke keyStroke)
           
 Object getKeyActionParam(KeyStroke keyStroke)
          Get the optional parameter for aXMapPaneAction when triggered by KeyStroke
 XMapPaneAction getMouseAction(MouseInputType type)
           
 String getToolTip()
           
protected  void initTool()
          Called by the constructor.
static String R(String key, Object... values)
           
 void setCursor(Cursor cursor)
           
 void setIcon(Icon icon)
          An icon to use if the tool is associated with a button.
 void setKeyAction(KeyStroke keyStroke, XMapPaneAction keyAction)
          Set the XMapPaneAction for a KeyStroke
 void setKeyActionParam(KeyStroke keyStroke, Object param)
          Set the optional parameter for aXMapPaneAction when triggered by KeyStroke
 void setMouseAction(MouseInputType type, XMapPaneAction mouseAction)
          Sets the XMapPaneAction for a given MouseInputType
 void setToolTip(String toolTip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

public static ResourceProvider RESOURCE

NO_ACTION

public static XMapPaneTool NO_ACTION
This XMapPaneTool does nothing


ZOOM_IN

public static XMapPaneTool ZOOM_IN
The configuration of the default ZOOM IN XMapPaneTool


ZOOM_OUT

public static XMapPaneTool ZOOM_OUT
The configuration of the default ZOOM IN XMapPaneTool


PAN

public static final XMapPaneTool PAN
The configuration of the PAN XMapPaneTool


SELECTION_TOP_LAYER

public static final XMapPaneTool SELECTION_TOP_LAYER
A tool that will do a select_top action on the left mouse button


SELECTION_ONE_FROM_TOP_LAYER

public static final XMapPaneTool SELECTION_ONE_FROM_TOP_LAYER
A tool that will do a select_top action on the left mouse button


SELECTION_ALL_LAYERS

public static final XMapPaneTool SELECTION_ALL_LAYERS
A tool that will do a select_top action on the left mouse button


INFO

public static final XMapPaneTool INFO
The configuration of the INFO XMapPaneTool


SELECTION_ADD

public static final XMapPaneTool SELECTION_ADD

SELECTION_REMOVE

public static final XMapPaneTool SELECTION_REMOVE

SELECTION_SET

public static final XMapPaneTool SELECTION_SET
Constructor Detail

XMapPaneTool

public XMapPaneTool()
The default constructor sets some default keyboard settings

Method Detail

R

public static String R(String key,
                       Object... values)

initTool

protected void initTool()
Called by the constructor. Initializes the tool actions by defining default keyboard actions.


copy

public XMapPaneTool copy()
Returns a copy of the tool to derive other tools.

Specified by:
copy in interface Copyable<XMapPaneTool>

copyTo

public XMapPaneTool copyTo(XMapPaneTool tool)
Copies all actions of this tool to another.

Specified by:
copyTo in interface Copyable<XMapPaneTool>
Parameters:
tool - tool to copy the actions to (if null a new tool is created)
Returns:
the modified or created tool

getCursor

public Cursor getCursor()
Returns:
the Cursor that shall be set as the default mouse cursor (when no button is clicked)

setCursor

public void setCursor(Cursor cursor)

getToolTip

public String getToolTip()

setToolTip

public void setToolTip(String toolTip)

getIcon

public Icon getIcon()
An icon to use if the tool is associated with a button. May be null.


setIcon

public void setIcon(Icon icon)
An icon to use if the tool is associated with a button. May be null.


getMouseAction

public XMapPaneAction getMouseAction(MouseInputType type)
Returns:
The XMapPaneAction associated with a given MouseInputType

setMouseAction

public void setMouseAction(MouseInputType type,
                           XMapPaneAction mouseAction)
Sets the XMapPaneAction for a given MouseInputType


getKeyAction

public XMapPaneAction getKeyAction(KeyStroke keyStroke)
Returns:
The XMapPaneAction associated with a KeyStroke

setKeyAction

public void setKeyAction(KeyStroke keyStroke,
                         XMapPaneAction keyAction)
Set the XMapPaneAction for a KeyStroke


getKeyActionParam

public Object getKeyActionParam(KeyStroke keyStroke)
Get the optional parameter for aXMapPaneAction when triggered by KeyStroke


setKeyActionParam

public void setKeyActionParam(KeyStroke keyStroke,
                              Object param)
Set the optional parameter for aXMapPaneAction when triggered by KeyStroke