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 Details

    • shortcutModifiers

      protected int shortcutModifiers
    • shortcutKeys

      protected int shortcutKeys
  • Constructor Details

    • AbstractPlugIn

      public AbstractPlugIn()
    • AbstractPlugIn

      public AbstractPlugIn(String name)
  • Method Details

    • addParameter

      public void addParameter(String name, Object value)
    • getParameter

      public Object getParameter(String name)
    • getBooleanParam

      public Boolean getBooleanParam(String name)
    • getIntegerParam

      public Integer getIntegerParam(String name)
    • getDoubleParam

      public Double getDoubleParam(String name)
    • getStringParam

      public String getStringParam(String name)
    • setParameters

      public void setParameters(Map<String,Object> map)
      Description copied from interface: Recordable
      Set parameters with which to execute a plugin.
      Specified by:
      setParameters in interface Recordable
      Parameters:
      map - a map of parameters
    • getParameters

      public Map<String,Object> getParameters()
    • execute

      protected void execute(UndoableCommand command, PlugInContext context)
    • initialize

      public void initialize(PlugInContext context) throws Exception
      Description copied from interface: PlugIn
      Called when Workbench starts up to allow plugins to initialize themselves.
      Specified by:
      initialize in interface PlugIn
      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:
      execute in interface PlugIn
      Parameters:
      context - context of this PlugIn
      Returns:
      true if the PlugIn has been executed
      Throws:
      Exception - if an Exception occurs during execution
      See Also:
    • 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:
      isShortcutEnabled in interface ShortcutEnabled
    • getShortcutModifiers

      public final int getShortcutModifiers()
      Specified by:
      getShortcutModifiers in interface ShortcutEnabled
    • setShortcutModifiers

      public void setShortcutModifiers(int shortcutModifiers)
      Specified by:
      setShortcutModifiers in interface ShortcutEnabled
    • getShortcutKeys

      public final int getShortcutKeys()
      Specified by:
      getShortcutKeys in interface ShortcutEnabled
    • setShortcutKeys

      public void setShortcutKeys(int shortcutKeys)
      Specified by:
      setShortcutKeys in interface ShortcutEnabled
    • getShortcutKeyStroke

      public KeyStroke getShortcutKeyStroke()
      Description copied from interface: ShortcutEnabled
      Convenience Method for getShortcutKeys() and getShortcutModifiers()
      Specified by:
      getShortcutKeyStroke in interface ShortcutEnabled
      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:
      getEnableCheck in interface EnableChecked
      Returns:
      the EnableCheck defined the old way
    • getIcon

      public Icon getIcon()
      Plugin icon assumed to be 16x16 by default
      Specified by:
      getIcon in interface Iconified
    • getIcon

      public Icon getIcon(int height)
      Specified by:
      getIcon in interface Iconified
    • getIcon

      public Icon getIcon(Dimension dim)
      Use reflection to find the icon defined the old way by method getIcon or by attribute ICON.
      Specified by:
      getIcon in interface Iconified
      Parameters:
      dim - dimension of the icon
      Returns:
      the Icon of this PlugIn
    • getName

      public 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
      Returns:
      the class name, minus "PlugIn", with spaces inserted at the appropriate point before each uppercase+lowercase and lowercase+uppercase combination.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createName

      public static String createName(Class<? extends PlugIn> plugInClass)
    • toActionListener

      public static ActionListener toActionListener(PlugIn plugIn, WorkbenchContext workbenchContext, TaskMonitorManager taskMonitorManager)
      Parameters:
      plugIn - the plugin
      workbenchContext - context of the application
      taskMonitorManager - 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()