Class StandardPirolPlugIn
java.lang.Object
com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
de.fho.jump.pirol.utilities.plugIns.StandardPirolPlugIn
- All Implemented Interfaces:
EnableChecked, Iconified, PlugIn, Recordable, ShortcutEnabled, ErrorHandler
Overrides most of the abstract methods of the AbstractPlugIn to implement
a default behavior, that fits the needs for a plugIn in the PIROL context.
Also implements the ErrorHandler interface and offers methods to post error
messages to the GUI.
- Version:
- $Rev$
- Author:
- Ole Rahn, Stefan Ostermann
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanAre errors to be shown in the statusbar (bringUpMessages = false, DEFAULT) or in an output window (bringUpMessages = true)?protected static EnableCheckFactoryprotected static org.locationtech.jts.geom.GeometryFactoryprotected ImageIconsee description for method getIconString() for more informationprotected PersonalLoggerlogger reference for use with the StandardPirolPlugIn.protected StringBufferbuffer for messages of errors that occured during execution - needed to implement the ErrorHandler interfaceprotected booleanFields inherited from class AbstractPlugIn
shortcutKeys, shortcutModifiers -
Constructor Summary
ConstructorsConstructorDescriptionStandardPirolPlugIn(PersonalLogger logger) Please, use this constructor in the deriving class! -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiEnableCheckcreateEnableCheck(WorkbenchContext workbenchContext, boolean needFence) abstract booleanexecute(PlugInContext context) This method is called to execute the PlugIn.protected booleanfinishExecution(PlugInContext context, boolean retVal) To be called, when leaving the execute()-method.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)getIcon()Method to load an icon from the surrounding jar-file if necessary.abstract StringMethod to enable loading an icon from the surrounding jar-file if necessary.static TaskMonitorDialoggetMonitor(PlugInContext context) getName()Name of the PlugIn to be shown in the menus or as a tooltip in JUMP.
Looks for a key (the PlugIn's name with no path) in the i18n resources, if none is found the standard jump name generation will be used.static LayergetSelectedLayer(PlugInContext context) get one Layer that is selectedstatic Layer[]getSelectedLayers(PlugInContext context, int num) Get a given number of selected Layers.voidNote that this method may or may not be called from the AWT event-dispatch thread.voidinitialize(PlugInContext context) The PlugIn will be added to thePIROL Tools/[return value of getCategoryName()]menu and a standardEnableCheckis applied.voidinitialize(PlugInContext context, String subMenuName) Deprecated.protected voidpostMessagesToGui(PlugInContext context) static voidDeprecated.use logger instead!protected voidDeprecated.use logger instead!voidsetLogger(PersonalLogger logger) Sets the personal logger - enables debug statement handlingvoidsetUseInToolbox(boolean toolboxUse) static voidwarnUser(PlugInContext context, String msg) Puts a warning message into the statusbar of JUMPMethods inherited from class AbstractPlugIn
addParameter, createName, execute, execute, getBooleanParam, getContext, getDoubleParam, getEnableCheck, getIcon, getIcon, getIntegerParam, getParameter, getParameters, getShortcutKeys, getShortcutKeyStroke, getShortcutModifiers, getStringParam, getWorkbenchContext, isRollingBackInvalidEdits, isShortcutEnabled, reportNothingToUndoYet, setParameters, setShortcutKeys, setShortcutModifiers, toActionListener, toString
-
Field Details
-
messages
buffer for messages of errors that occured during execution - needed to implement the ErrorHandler interface -
bringUpMessages
protected boolean bringUpMessagesAre errors to be shown in the statusbar (bringUpMessages = false, DEFAULT) or in an output window (bringUpMessages = true)? -
checkFactory
-
icon
see description for method getIconString() for more information -
useToolIconSize
protected boolean useToolIconSize -
geometryFactory
protected static org.locationtech.jts.geom.GeometryFactory geometryFactory -
logger
logger reference for use with the StandardPirolPlugIn. Since loggers are personalized, this member has to be initialized in derived classes by the programmer, before it can be used. For downward compatibility no abstract method or constructur parameter was introduced to do this.- Since:
- rev.1.12
-
-
Constructor Details
-
StandardPirolPlugIn
Please, use this constructor in the deriving class!- Parameters:
logger- the logger that will controll console outputs- Since:
- rev.1.17
-
-
Method Details
-
getShortClassName
-
createEnableCheck
public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext, boolean needFence) -
getIconString
Method to enable loading an icon from the surrounding jar-file if necessary. If the plugin doesn't need an icon, just returnnullelse return the file name, e.g. "xyz.png" and put the picture in the same folder (package) as the deriving class.- Returns:
- the filename of the icon or
nullif the plugin has no icon.
-
execute
This method is called to execute the PlugIn.- Specified by:
executein interfacePlugIn- Overrides:
executein classAbstractPlugIn- Parameters:
context- the snapshot of the current workbench.- Returns:
- always
true? - Throws:
Exception- if an Exception occurs- See Also:
-
getName
Name of the PlugIn to be shown in the menus or as a tooltip in JUMP.
Looks for a key (the PlugIn's name with no path) in the i18n resources, if none is found the standard jump name generation will be used.- Specified by:
getNamein interfacePlugIn- Overrides:
getNamein classAbstractPlugIn- Returns:
- the class name, minus "PlugIn", with spaces inserted at the appropriate point before each uppercase+lowercase and lowercase+uppercase combination.
-
initialize
The PlugIn will be added to thePIROL Tools/[return value of getCategoryName()]menu and a standardEnableCheckis applied.- Specified by:
initializein interfacePlugIn- Overrides:
initializein classAbstractPlugIn- Parameters:
context- PlugInContext- Throws:
Exception- if an Exception occurs- See Also:
-
getCategoryName
The name of the category, a PlugIn can be found in - this method should be overridden by any derived class!- Returns:
- name of the category, a PlugIn can be found in
-
initialize
Deprecated.Standard intialization: PlugIn is added to thePIROL Tools/subMenuName(or localized menu name) menu and a standardEnableCheckis applied.- Throws:
Exception
-
getMonitor
- Parameters:
context- the current PlugIn context- Returns:
- a TaskMonitorDialog, to show progress information to the user
-
println
-
println
Deprecated.use logger instead!Writes the given message and function string to the stdout. The output will be formated as "classname.function: message".- Parameters:
c- the calling classfunction- the method from within this one is called.message- the text with some useful information.
-
warnUser
Puts a warning message into the statusbar of JUMP- Parameters:
context- curr. PlugInContextmsg- message to be shown to the user
-
getSelectedLayers
Get a given number of selected Layers.- Parameters:
context- the current PlugInContextnum- max. number of layers to return, -1 returns all selected layers- Returns:
- a given number of selected Layers, null if no Layers are selected
-
getSelectedLayer
get one Layer that is selected- Parameters:
context- the current PlugInContext- Returns:
- one selected Layer, null if no Layers are selected
-
finishExecution
To be called, when leaving the execute()-method. Puts out the error messages collected during execution if any and returns the given boolean value. Example:return finishExecution(context, true);
- Parameters:
context- the current PlugInContextretVal- the value to be returned by execute()- Returns:
- retVal
-
postMessagesToGui
-
handleThrowable
Description copied from interface:ErrorHandlerNote that this method may or may not be called from the AWT event-dispatch thread.- Specified by:
handleThrowablein interfaceErrorHandler
-
getIcon
Method to load an icon from the surrounding jar-file if necessary.- Specified by:
getIconin interfaceIconified- Overrides:
getIconin classAbstractPlugIn- Returns:
- the icon or
nullif the getIconString() returned null (or problems occured)
-
getFeaturesInFenceOrInLayer
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)- Parameters:
context- the plugIn contextlayer- the layer holding the features- Returns:
- List of features within fence if present or just within the layer
-
getLogger
- Returns:
- the personal logger
- See Also:
-
setLogger
Sets the personal logger - enables debug statement handling- Parameters:
logger- the new personal logger- See Also:
-
setUseInToolbox
public void setUseInToolbox(boolean toolboxUse)
-