|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vividsolutions.jump.workbench.plugin.AbstractPlugIn
de.fho.jump.pirol.utilities.plugIns.StandardPirolPlugIn
public abstract class StandardPirolPlugIn
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.
| Field Summary | |
|---|---|
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
|
| Constructor Summary | |
|---|---|
StandardPirolPlugIn(PersonalLogger logger)
Please, use this constructor in the deriving class! |
|
| Method Summary | |
|---|---|
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 |
| 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 |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public StandardPirolPlugIn(PersonalLogger logger)
logger - the logger that will controll console outputs| Method Detail |
|---|
public 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 PlugInexecute in class AbstractPlugIncontext - the snapshot of the current workbench.
true ?
java.lang.ExceptionAbstractPlugIn.execute(com.vividsolutions.jump.workbench.plugin.PlugInContext)public java.lang.String getName()
getName in interface PlugIngetName 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 PlugIninitialize in class AbstractPlugIncontext - PlugInContext
java.lang.ExceptiongetCategoryName()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.Exceptionpublic static TaskMonitorDialog getMonitor(PlugInContext context)
context - the current PlugIn context
protected 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 user
public static Layer[] getSelectedLayers(PlugInContext context,
int num)
context - the current PlugInContextnum - max. number of layers to return, -1 returns all selected layers
public static Layer getSelectedLayer(PlugInContext context)
context - the current PlugInContext
protected 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 ErrorHandlerpublic 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 features
public PersonalLogger getLogger()
PersonalLoggerpublic void setLogger(PersonalLogger logger)
logger - the new personal loggerPersonalLoggerpublic void setUseInToolbox(boolean toolboxUse)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||