public abstract class StandardPirolPlugIn extends AbstractPlugIn implements ErrorHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
bringUpMessages
Are errors to be shown in the statusbar (bringUpMessages = false, DEFAULT) or in an
output window (bringUpMessages = true)?
|
protected static EnableCheckFactory |
checkFactory |
protected static com.vividsolutions.jts.geom.GeometryFactory |
geometryFactory |
protected javax.swing.ImageIcon |
icon
see description for method getIconString() for more information
|
protected PersonalLogger |
logger
logger reference for use with the StandardPirolPlugIn.
|
protected java.lang.StringBuffer |
messages
buffer for messages of errors that occured during execution - needed to implement the ErrorHandler interface
|
protected boolean |
useToolIconSize |
shortcutKeys, shortcutModifiers
Constructor and Description |
---|
StandardPirolPlugIn(PersonalLogger logger)
Please, use this constructor in the deriving class!
|
Modifier and Type | Method and Description |
---|---|
static MultiEnableCheck |
createEnableCheck(WorkbenchContext workbenchContext,
boolean needFence) |
abstract boolean |
execute(PlugInContext context)
This method is called to execute the PlugIn.
|
protected boolean |
finishExecution(PlugInContext context,
boolean retVal)
To be called, when leaving the execute()-method.
|
java.lang.String |
getCategoryName()
The name of the category, a PlugIn can be found in - this method should be overridden by any derived class!
|
static Feature[] |
getFeaturesInFenceOrInLayer(PlugInContext context,
Layer layer)
Get a List of Features (from the given Layer) that reside within the fence (if there is a fence) or just the features of the layer
(if there is currently no fence)
|
javax.swing.Icon |
getIcon()
Method to load an icon from the surrounding jar-file if necessary.
|
abstract java.lang.String |
getIconString()
Method to enable loading an icon from the surrounding jar-file if necessary.
|
PersonalLogger |
getLogger() |
static TaskMonitorDialog |
getMonitor(PlugInContext context) |
java.lang.String |
getName()
Name of the PlugIn to be shown in the menus or as a tooltip in JUMP.
|
static Layer |
getSelectedLayer(PlugInContext context)
get one Layer that is selected
|
static Layer[] |
getSelectedLayers(PlugInContext context,
int num)
Get a given number of selected Layers.
|
java.lang.String |
getShortClassName() |
void |
handleThrowable(java.lang.Throwable t)
Note that this method may or may not be called from the AWT event-dispatch
thread.
|
void |
initialize(PlugInContext context)
The PlugIn will be added to the
PIROL Tools/[return value of getCategoryName()] menu and a standard EnableCheck is applied. |
void |
initialize(PlugInContext context,
java.lang.String subMenuName)
Deprecated.
|
protected void |
postMessagesToGui(PlugInContext context) |
static void |
println(java.lang.Class c,
java.lang.String function,
java.lang.String message)
Deprecated.
use logger instead!
|
protected void |
println(java.lang.String function,
java.lang.String msg)
Deprecated.
use logger instead!
|
void |
setLogger(PersonalLogger logger)
Sets the personal logger - enables debug statement handling
|
void |
setUseInToolbox(boolean toolboxUse) |
static void |
warnUser(PlugInContext context,
java.lang.String msg)
Puts a warning message into the statusbar of JUMP
|
addParameter, createName, execute, execute, fetchShortcutEnabledPlugins, getBooleanParam, getDoubleParam, getEnableCheck, getEnableCheck, getIcon, getIcon, getIntegerParam, getParameter, getParameters, getShortcutKeys, getShortcutKeyStroke, getShortcutModifiers, getStringParam, isRollingBackInvalidEdits, isShortcutEnabled, registerShortcuts, reportNothingToUndoYet, setParameters, setShortcutKeys, setShortcutModifiers, toActionListener, toString
protected java.lang.StringBuffer messages
protected boolean bringUpMessages
protected static EnableCheckFactory checkFactory
protected javax.swing.ImageIcon icon
protected boolean useToolIconSize
protected static com.vividsolutions.jts.geom.GeometryFactory geometryFactory
protected PersonalLogger logger
public StandardPirolPlugIn(PersonalLogger logger)
logger
- the logger that will controll console outputspublic java.lang.String getShortClassName()
public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext, boolean needFence)
public abstract java.lang.String getIconString()
null
else
return the file name, e.g. "xyz.png" and put the picture in the same folder
(package) as the deriving class.null
if the plugin has no icon.public abstract boolean execute(PlugInContext context) throws java.lang.Exception
execute
in interface PlugIn
execute
in class AbstractPlugIn
context
- the snapshot of the current workbench.true
?java.lang.Exception
AbstractPlugIn.execute(com.vividsolutions.jump.workbench.plugin.PlugInContext)
public java.lang.String getName()
getName
in interface PlugIn
getName
in class AbstractPlugIn
public void initialize(PlugInContext context) throws java.lang.Exception
PIROL Tools/[return value of getCategoryName()]
menu and a standard EnableCheck
is applied.initialize
in interface PlugIn
initialize
in class AbstractPlugIn
context
- PlugInContextjava.lang.Exception
getCategoryName()
public java.lang.String getCategoryName()
public void initialize(PlugInContext context, java.lang.String subMenuName) throws java.lang.Exception
PIROL Tools/subMenuName
(or localized menu name) menu and a standard EnableCheck
is applied.java.lang.Exception
public static TaskMonitorDialog getMonitor(PlugInContext context)
context
- the current PlugIn contextprotected void println(java.lang.String function, java.lang.String msg)
function
- the name of the method from within this one is called.
E.g. "myMethod()".msg
- the message String.println(Class, String, String)
public static void println(java.lang.Class c, java.lang.String function, java.lang.String message)
c
- the calling classfunction
- the method from within this one is called.message
- the text with some useful information.public static void warnUser(PlugInContext context, java.lang.String msg)
context
- curr. PlugInContextmsg
- message to be shown to the userpublic static Layer[] getSelectedLayers(PlugInContext context, int num)
context
- the current PlugInContextnum
- max. number of layers to return, -1 returns all selected layerspublic static Layer getSelectedLayer(PlugInContext context)
context
- the current PlugInContextprotected boolean finishExecution(PlugInContext context, boolean retVal)
return finishExecution(context, true);
context
- the current PlugInContextretVal
- the value to be returned by execute()protected void postMessagesToGui(PlugInContext context)
public void handleThrowable(java.lang.Throwable t)
ErrorHandler
handleThrowable
in interface ErrorHandler
public javax.swing.Icon getIcon()
null
if the getIconString() returned null (or problems occured)public static Feature[] getFeaturesInFenceOrInLayer(PlugInContext context, Layer layer)
context
- the plugIn contextlayer
- the layer holding the featurespublic PersonalLogger getLogger()
PersonalLogger
public void setLogger(PersonalLogger logger)
logger
- the new personal loggerPersonalLogger
public void setUseInToolbox(boolean toolboxUse)