Class AbstractPlugIn
- java.lang.Object
-
- com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
-
- All Implemented Interfaces:
EnableChecked,Iconified,PlugIn,Recordable,ShortcutEnabled
- Direct Known Subclasses:
AboutPlugIn,AbstractSaveProjectPlugIn,AbstractUiPlugIn,AdditionalResultsPlugIn,AddNewCategoryPlugIn,AddNewLayerPlugIn,AddNewLayerViewPlugIn,AddWMSDemoBoxEasterEggPlugIn,AdvancedMeasurePlugin,AffineTransformPlugIn,ArrangeViewsPlugIn,AttributeQueryPlugIn,AutoCompletePolygonPlugIn,BeanToolsPlugIn,BlendLineStringsPlugIn,BoundaryMatchDataPlugIn,CalculateAreasAndLengthsPlugIn,CalcVarianceAndMeanPerClassPlugIn,CenterZoomPlugIn,ChangeCoordinateSystemPlugIn,ChangeLayerableNamePlugIn,ChangeRasterImagePropertiesPlugIn,ChangeSRIDPlugIn,ChangeStylesPlugIn,ClassifyAttributesPlugIn,ClearSelectionPlugIn,ClipToFencePlugIn,CloneWindowPlugIn,CombineSelectedFeaturesPlugIn,CombineSelectedLayersPlugIn,ConstrainedMoveVertexPlugIn,ConvexHullPlugIn,ConvexHullPlugIn,CopyBBoxPlugin,CopySchemaPlugIn,CopySelectedItemsPlugIn,CopySelectedLayersToWarpingVectorsPlugIn,CopyStylesPlugIn,CopyThisCoordinatePlugIn,CreateBarPlotPlugIn,CreateHistogramPlugIn,CreateLatticeFromSelectedImageLayerPlugIn,CreatePolygonGridFromSelectedImageLayerPlugIn,CreateScatterPlotPlugIn,CreateThiessenPolygonsPlugIn,CustomFillPatternExamplePlugIn,CutFeaturesPlugIn,CutPolygonSIGLEPlugIn,DeeChangeStylesPlugIn,DeleteAllFeaturesPlugIn,DeleteDuplicateGeometriesPlugIn,DeleteEmptyGeometriesPlugIn,DeleteSelectedItemsPlugIn,DrawCircleWithGivenRadiusPlugIn,DrawConstrainedArcPlugIn,DrawConstrainedCirclePlugIn,DrawConstrainedLineStringPlugIn,DrawConstrainedPolygonPlugIn,DuplicateItemPlugIn,EditablePlugIn,EditAttributeByFormulaPlugIn,EditSelectedSidePlugIn,EditWMSQueryPlugIn,EnsureAllLayersHaveSRIDStylePlugIn,ExplodeSelectedFeaturesPlugIn,ExportEnvelopeAsGeometryPlugIn,ExportImagePlugIn,ExportLayerableEnvelopeAsGeometryPlugIn,ExtractCommonBoundaryBetweenPolysPlugIn,ExtractLayerInFence,ExtractLayersByAttribute,ExtractPointsPlugIn,ExtractSelectedPartOfImage,FeatureInfoPlugIn,FeatureStatisticsPlugIn,FillPolygonPlugIn,FirstTaskFramePlugIn,GCPlugin,GenerateLogPlugIn,GeometryFunctionPlugIn,GeometrySnapperPlugIn,HistogramPlugIn,ImageLayerManagerPlugIn,ImportArcMapStylePlugIn,ImportSLDPlugIn,InstallDatastoreLayerRendererHintsPlugIn,InstallDummyReaderPlugIn,InstallKeyPanPlugIn,InstallRendererPlugIn,InstallSkinsPlugIn,InstallStandardDataSourceQueryChoosersPlugIn,InstallStandardFeatureTextWritersPlugIn,InstallZoomBarPlugIn,InvertSelectionPlugIn,JoinWithArcPlugIn,LayerableClipboardPlugIn,LayerableClipboardPlugIn,LayerableStylePlugIn,LayerPropertiesPlugIn,LayerStatisticsPlugIn,LayerStyle2SLDPlugIn,LegendPlugIn,MacroPlugIn,MapToolTipPlugIn,MapToolTipsPlugIn,MeasureM_FPlugIn,MeasureSelectedPlugIn,MergeSelectedFeaturesPlugIn,MergeTwoSelectedPolygonsPlugIn,MicroscopePlugIn,MoveAlongAnglePlugIn,MoveCategoryOneDown,MoveCategoryOneUp,MoveCategoryToBottom,MoveCategoryToTop,MoveLayerablePlugIn,MoveSelectedLayersPlugIn,MultiRingBufferSelectedPlugIn,NewLayerPropertiesPlugIn,NewTaskPlugIn,NorthArrowPlugIn,NoteToolPlugIn,OptionsPlugIn,OutputWindowPlugIn,OverlayPlugIn,PanToSelectedItemsPlugIn,PasteItemsPlugIn,PasteSchemaPlugIn,PasteStylesPlugIn,PersistentBlackboardPlugIn,PlumePlugIn,PointsToPathsPlugIn,ProjectionPlugIn,ProjectiveTransformPlugIn,RandomArrowsPlugIn,RandomTrianglesPlugIn,RasterColorEditorPlugIn,RasterImageLayerPropertiesPlugIn,RasterizePlugIn,RasterQueryPlugIn,RedoPlugIn,ReducePointsISAPlugIn,RefreshDataStoreLayerPlugin,RemodelerPlugIn,RemoveSelectedCategoriesPlugIn,RemoveSelectedLayersPlugIn,RemoveSelectedRasterImageLayersPlugIn,ReplaceValuePlugIn,ReplicateSelectedItemsPlugIn,ReverseOrientationPlugIn,RotatePlugIn,RotateSelectedItemPlugIn,SaveDatasetsPlugIn,SaveImageAsSVGPlugIn,SaveLayersWithoutDataSourcePlugIn,SaveLegendPlugIn,SaveRasterImageAsImagePlugIn,ScaleBarPlugIn,ScaleSelectedItemsPlugIn,SearchAllAttributes,SearchCommandPlugIn,SelectablePlugIn,SelectAllLayerItemsPlugIn,SelectAllModifiedFeaturesPlugIn,SelectAllOrderedFeaturesFromAttributeTablePlugIn,SelectByTypePlugIn,SelectFeaturesInFencePlugIn,SelectGeometryCollectionsPlugIn,SelectItemsByCircleFromSelectedLayersPlugIn,SelectItemsByFenceFromSelectedLayersPlugIn,SelectLayersWithSelectedItemsPlugIn,SelectMultiItemsPlugIn,SelectOneItemPlugIn,SetCategoryVisibilityPlugIn,ShortcutKeysPlugIn,ShowFullPathPlugIn,ShowScalePlugIn,ShowTriangulationPlugIn,ShowViewCenterPlugIn,SimpleQueryPlugIn,SimplifyPolygonCoveragePlugIn,SimplifyWithJTSAlgorithmPlugIn,SortCategoryAbstractPlugIn,SortCategoryRestorePlugIn,SortCategorySavePlugIn,SpatialJoinPlugIn,SpatialQueryPlugIn,SplitPolygonPlugIn,StandardPirolPlugIn,StartMacroPlugIn,StatisticOverViewPlugIn,StopMacroPlugIn,TaskPropertiesPlugIn,TestColorThemingPlugIn,ThreadedBasePlugIn,ToggleRasterImageVisibility,ToggleVisibilityPlugIn,ToolboxPlugIn,ToolboxPlugInV2,UndoPlugIn,UnionPlugIn,UniqueFeatureInfoPlugIn,ValidateSelectedLayersPlugIn,VerticesInFencePlugIn,ViewAttributesPlugIn,ViewOptionsPlugIn,ViewSchemaPlugIn,WarpImageToFencePlugIn,WKTPlugIn,WMSLegendPlugIn,WMSStylePlugIn,WorkbenchFrame.ExitPlugin,ZoomInPlugIn,ZoomNextPlugIn,ZoomOutPlugIn,ZoomPreviousPlugIn,ZoomToClickPlugIn,ZoomToCoordinatePlugIn,ZoomToFencePlugIn,ZoomToFullExtentPlugIn,ZoomToLayerPlugIn,ZoomToRasterImagePlugIn,ZoomToScalePlugIn,ZoomToSelectedItemsPlugIn,ZoomToWMSLayerPlugIn,ZoomToWMSPlugIn
public abstract class AbstractPlugIn extends Object implements PlugIn, ShortcutEnabled, EnableChecked, Iconified, Recordable
Default implementation of PlugIn, with useful functions for auto-generating a name, converting a PlugIn into an ActionListener (for use with JButtons, for example), and supporting undo.
-
-
Field Summary
Fields Modifier and Type Field Description protected intshortcutKeysprotected intshortcutModifiers
-
Constructor Summary
Constructors Constructor Description AbstractPlugIn()AbstractPlugIn(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(String name, Object value)static StringcreateName(Class<? extends PlugIn> plugInClass)static voidexecute(UndoableCommand command, LayerManagerProxy layerManagerProxy)protected voidexecute(UndoableCommand command, PlugInContext context)booleanexecute(PlugInContext context)Execute the PlugIn.BooleangetBooleanParam(String name)protected PlugInContextgetContext()DoublegetDoubleParam(String name)EnableCheckgetEnableCheck()Use reflection to find an EnableCheck object defined by old method createEnableCheck in this plugin.IcongetIcon()Plugin icon assumed to be 16x16 by defaultIcongetIcon(int height)IcongetIcon(Dimension dim)Use reflection to find the icon defined the old way by method getIcon or by attribute ICON.IntegergetIntegerParam(String name)StringgetName()Returns a very brief description of this PlugIn e.g.ObjectgetParameter(String name)Map<String,Object>getParameters()intgetShortcutKeys()KeyStrokegetShortcutKeyStroke()Convenience Method for getShortcutKeys() and getShortcutModifiers()intgetShortcutModifiers()StringgetStringParam(String name)protected WorkbenchContextgetWorkbenchContext()voidinitialize(PlugInContext context)Called when Workbench starts up to allow plugins to initialize themselves.protected booleanisRollingBackInvalidEdits(PlugInContext context)booleanisShortcutEnabled()protected voidreportNothingToUndoYet(PlugInContext context)Indicates that this plug-in either (1) is undoable but hasn't modified the system yet or (2) does not modify the system.voidsetParameters(Map<String,Object> map)Set parameters with which to execute a plugin.voidsetShortcutKeys(int shortcutKeys)voidsetShortcutModifiers(int shortcutModifiers)static ActionListenertoActionListener(PlugIn plugIn, WorkbenchContext workbenchContext, TaskMonitorManager taskMonitorManager)StringtoString()
-
-
-
Constructor Detail
-
AbstractPlugIn
public AbstractPlugIn()
-
AbstractPlugIn
public AbstractPlugIn(String name)
-
-
Method Detail
-
setParameters
public void setParameters(Map<String,Object> map)
Description copied from interface:RecordableSet parameters with which to execute a plugin.- Specified by:
setParametersin interfaceRecordable- Parameters:
map- a map of parameters
-
execute
protected void execute(UndoableCommand command, PlugInContext context)
-
initialize
public void initialize(PlugInContext context) throws Exception
Description copied from interface:PlugInCalled when Workbench starts up to allow plugins to initialize themselves.- Specified by:
initializein interfacePlugIn- Parameters:
context- context of the PlugIn- Throws:
Exception- if an exception occur during initialization
-
execute
public boolean execute(PlugInContext context) throws Exception
Execute the PlugIn.- Specified by:
executein interfacePlugIn- Parameters:
context- context of this PlugIn- Returns:
- true if the PlugIn has been executed
- Throws:
Exception- if an Exception occurs during execution- See Also:
ThreadedPlugIn
-
reportNothingToUndoYet
protected void reportNothingToUndoYet(PlugInContext context)
Indicates that this plug-in either (1) is undoable but hasn't modified the system yet or (2) does not modify the system. In either case, the undo history will be preserved. If this method is not called, then this plug-in will be assumed to be non-undoable, and the undo history will be truncated.- Parameters:
context- plugin context
-
isRollingBackInvalidEdits
protected boolean isRollingBackInvalidEdits(PlugInContext context)
-
isShortcutEnabled
public boolean isShortcutEnabled()
- Specified by:
isShortcutEnabledin interfaceShortcutEnabled
-
getShortcutModifiers
public final int getShortcutModifiers()
- Specified by:
getShortcutModifiersin interfaceShortcutEnabled
-
setShortcutModifiers
public void setShortcutModifiers(int shortcutModifiers)
- Specified by:
setShortcutModifiersin interfaceShortcutEnabled
-
getShortcutKeys
public final int getShortcutKeys()
- Specified by:
getShortcutKeysin interfaceShortcutEnabled
-
setShortcutKeys
public void setShortcutKeys(int shortcutKeys)
- Specified by:
setShortcutKeysin interfaceShortcutEnabled
-
getShortcutKeyStroke
public KeyStroke getShortcutKeyStroke()
Description copied from interface:ShortcutEnabledConvenience Method for getShortcutKeys() and getShortcutModifiers()- Specified by:
getShortcutKeyStrokein interfaceShortcutEnabled- Returns:
- the KeyStroke associated to the shortcut
-
getEnableCheck
public EnableCheck getEnableCheck()
Use reflection to find an EnableCheck object defined by old method createEnableCheck in this plugin.- Specified by:
getEnableCheckin interfaceEnableChecked- Returns:
- the EnableCheck defined the old way
-
getIcon
public Icon getIcon()
Plugin icon assumed to be 16x16 by default
-
getIcon
public Icon getIcon(Dimension dim)
Use reflection to find the icon defined the old way by method getIcon or by attribute ICON.
-
getName
public String getName()
Description copied from interface:PlugInReturns a very brief description of this PlugIn e.g. for display as a menu item
-
toActionListener
public static ActionListener toActionListener(PlugIn plugIn, WorkbenchContext workbenchContext, TaskMonitorManager taskMonitorManager)
- Parameters:
plugIn- the pluginworkbenchContext- context of the applicationtaskMonitorManager- can be null if you do not wish to use the Task Monitor progress-reporting framework- Returns:
- an ActionListener for this PlugIn
-
execute
public static void execute(UndoableCommand command, LayerManagerProxy layerManagerProxy)
-
getContext
protected PlugInContext getContext()
-
getWorkbenchContext
protected WorkbenchContext getWorkbenchContext()
-
-