org.openjump.core.ui.plugin.view
Class InstallKeyPanPlugIn

java.lang.Object
  extended by com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
      extended by org.openjump.core.ui.plugin.view.InstallKeyPanPlugIn
All Implemented Interfaces:
PlugIn

public class InstallKeyPanPlugIn
extends AbstractPlugIn

Plug in for navigation with keyboards keys.
Navigation is as follows:
Arrows keys move the viewport.
Page down and up are zoom in and zoom out, respectively
Home key zooms in or out to full extent
Pan and zoom percentage is, by default, 20%

Author:
Ugo Taddei

Constructor Summary
InstallKeyPanPlugIn()
          Default constructor
InstallKeyPanPlugIn(double panPercentag)
          Creates a new plug-in with pan_percentage as pan percentage value pan_percentage The value in percent of screen size to pan/zoom.
 
Method Summary
 boolean execute(PlugInContext context)
          Performs the action for this plugin.
 java.lang.String getName()
          Returns a very brief description of this PlugIn e.g. for display as a menu item
static double getPanPercentage()
          Get the pan/zoom percentage, a value between 0 and 1.
 void initialize(PlugInContext context)
          Called when Workbench starts up to allow plugins to initialize themselves.
 boolean pan(javax.swing.JInternalFrame jif, int direction)
           
static void setPanPercentage(double panPercent)
          Set the pan percentage.
 
Methods inherited from class com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
createName, execute, execute, isRollingBackInvalidEdits, reportNothingToUndoYet, toActionListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstallKeyPanPlugIn

public InstallKeyPanPlugIn()
Default constructor


InstallKeyPanPlugIn

public InstallKeyPanPlugIn(double panPercentag)
Creates a new plug-in with pan_percentage as pan percentage value pan_percentage The value in percent of screen size to pan/zoom. Accepted values are in the range 0 < percentage <= 1

Method Detail

execute

public boolean execute(PlugInContext context)
                throws java.lang.Exception
Description copied from interface: PlugIn
Performs the action for this plugin. For threaded plugins with dialogs, this method contains the code to invoke the dialog. If the user cancels the dialog, this method should return false to prevent the run method from being called.

Specified by:
execute in interface PlugIn
Overrides:
execute in class AbstractPlugIn
Returns:
true if the action completed, false if it was aborted. Used by ThreadedPlugIns to indicate that their #run method needn't be called next.
Throws:
java.lang.Exception - if a problem occurs during plug-in execution
See Also:
ThreadedPlugIn

pan

public boolean pan(javax.swing.JInternalFrame jif,
                   int direction)

initialize

public void initialize(PlugInContext context)
                throws java.lang.Exception
Description copied from interface: PlugIn
Called when Workbench starts up to allow plugins to initialize themselves.

Specified by:
initialize in interface PlugIn
Overrides:
initialize in class AbstractPlugIn
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Description copied from interface: PlugIn
Returns a very brief description of this PlugIn e.g. for display as a menu item

Specified by:
getName in interface PlugIn
Overrides:
getName in class AbstractPlugIn
Returns:
the class name, minus "PlugIn", with spaces inserted at the appropriate point before each uppercase+lowercase and lowercase+uppercase combination.

getPanPercentage

public static double getPanPercentage()
Get the pan/zoom percentage, a value between 0 and 1. Deafult is 0.25 (=25%)


setPanPercentage

public static void setPanPercentage(double panPercent)
Set the pan percentage. Legal values are between greater than 0 and less than or equal to 1.0

Parameters:
panPercent - The value in percent of screen size to pan/zoom. Accepted values are in the range 0 < percentage <= 1