Interface JMapGuiService


public interface JMapGuiService
  • Field Details

    • STATE_HIDDEN

      static final int STATE_HIDDEN
      Hidden means the window is hidden.
      See Also:
    • STATE_FLOATING

      static final int STATE_FLOATING
      Floating means the window is in a floating container.
      See Also:
    • STATE_AUTOHIDE

      static final int STATE_AUTOHIDE
      Auto-hide means the window is hidden but accessible with a tab.
      See Also:
    • STATE_DOCKED

      static final int STATE_DOCKED
      Docked means the window is docked inside the main window.
      See Also:
  • Method Details

    • getGuiFactory

      JMapGuiFactory getGuiFactory()
      Returns the factory that should be used to create user interface components for the current application toolkit.
      Returns:
      the factory instance to use when creating user interface components.
    • getToolBar

      ToolBar getToolBar(String toolBarKey)
      Returns the tool bar identified by the specified key. null is returned if there is no tool bar associated with the key.
      Parameters:
      toolBarKey - the tool bar key
      Returns:
      a tool bar
    • getMenu

      JMenu getMenu(String menuKey)
      Returns the menu identified by the specified key. null is returned if there is no menu associated with the key.
      Parameters:
      menuKey - the menu key
      Returns:
      a menu
    • getMenuItem

      JMenuItem getMenuItem(Class actionClass)
      Returns the menu item identified by the specified class. null is returned if there is no menu item associated with the class.
      Parameters:
      actionClass - the menu action class
      Returns:
      a menu item
    • getMenuBar

      JMenuBar getMenuBar()
      Returns the application menu bar. null is return if there is no menu bar in the application.
      Returns:
      the application menu bar
    • addMenuItem

      JMenuItem addMenuItem(String menuKey, AbstractAction menuAction, boolean addSeparatorBefore)
      Adds a menu action to the the specified menu in the application menu bar.
      Parameters:
      menuKey - the menu bar item to add to
      menuAction - the menu action to add
      addSeparatorBefore - if true, a JPopupMenu.Separator will be added before the menuItem
      Returns:
      the menu item created with the abstract action
    • addMenuItem

      void addMenuItem(String menuKey, JMenuItem menuItem, boolean addSeparatorBefore)
      Adds a menu item to the the specified menu in the application menu bar.
      Parameters:
      menuKey - the menu bar item to add to
      menuItem - the menu item to add
      addSeparatorBefore - if true, a JPopupMenu.Separator will be added before the menuItem
    • removeMenuItem

      void removeMenuItem(String menuKey, JMenuItem menuItem)
      Removes a menu item from the specified menu in the application menu bar.
      Parameters:
      menuKey - the menu bar item to remove from
      menuItem - the menu item to remove
    • addToolBar

      void addToolBar(ToolBar toolBar, HashMap<String,Object> properties)
      Adds a tool bar to the application. Available properties are :

      CONTEXT_INIT_SIDE (optional) with possible values SwingConstants.EAST, SwingConstants.WEST, SwingConstants.NORTH (default), SwingConstants.SOUTH

      Parameters:
      toolBar - the tool bar to add
      properties - the specifications used to place the component
      See Also:
    • removeToolBar

      void removeToolBar(String toolBarKey)
      Removes a tool bar.
      Parameters:
      toolBarKey - the tool bar key
    • setToolBarVisible

      void setToolBarVisible(String toolBarKey, boolean visible)
      Shows or hides a tool bar.
      Parameters:
      toolBarKey - the tool bar key
      visible -
    • addDockableComponent

      void addDockableComponent(JComponent component, HashMap<String,Object> properties)
      Adds a component (usually a panel) into the application. Available properties are :

      KEY (mandatory) - A unique String value in the Docking environment

      FRAME_ICON (optional) - The icon used in the title bar

      TITLE (optional) - The text in the title bar

      AVAILABLE_BUTTONS (optional) - TODO : doc

      CONTEXT_INIT_MODE (optional) with possible values STATE_HIDDEN, STATE_FLOATING, STATE_DOCKED (default)

      CONTEXT_INIT_INDEX (optional) - The index of the docked component. Useful if you have more than one component in the same side

      CONTEXT_DOCKED_WIDTH (optional) - The width of the component

      CONTEXT_DOCKED_HEIGHT (optional) - The height of the component

      CONTEXT_FLOATING_X (optional) - Specify the X position of the component in floating mode

      CONTEXT_FLOATING_Y (optional) - Specify the Y position of the component in floating mode

      CONTEXT_INIT_SIDE (optional) with possible values SwingConstants.EAST, SwingConstants.WEST, SwingConstants.NORTH (default), SwingConstants.SOUTH

      ADD_TO_VIEW_MENU (optional) - Add a menu item in the View menu to show the added component

      Parameters:
      component - the component to add
      properties - the specifications used to place the component
    • getDockableComponent

      JComponent getDockableComponent(String componentKey)
      Returns the component specified by the componentKey. May return null if the componentKey is not found.
      Parameters:
      componentKey - the KEY of the component to retrieve
      Returns:
      the component associated with the specified componentKey
    • removeDockableComponent

      void removeDockableComponent(String componentKey)
      Removes the component specified by the componentKey.
      Parameters:
      componentKey - the KEY of the component to remove
    • removeDockableComponent

      void removeDockableComponent(String componentKey, boolean onlyIfFloating)
      Removes the component specified by the componentKey.
      Parameters:
      componentKey - the KEY of the component to remove
      onlyIfFloating - remove only if the component is floating
    • setDockableComponentVisible

      void setDockableComponentVisible(String componentKey, boolean visible)
      Show or hide a dockable component specified by the componentKey.
      Parameters:
      componentKey - the KEY of the component to show or hide
      visible - the visibility state
    • setDockableComponentTitle

      void setDockableComponentTitle(String componentKey, String title)
      Sets the title of a dockable component specified by the componentKey.
      Parameters:
      componentKey - the KEY of the component to set the title
      title - the title
    • getMainButtonGroup

      ButtonGroup getMainButtonGroup()
      Returns the main button group. This button group is a multiple-exclusion scope for a set of tools used on the active view.
      Returns:
      a button group
    • getLayerBar

      LayerBar getLayerBar()
      Returns the layer bar. May be null if the application doesn't use the layer bar.
      Returns:
      the layer bar
      See Also:
    • getLayerTreeBar

      LayerTreeBar getLayerTreeBar()
      Returns the layer tree bar. May be null if the application doesn't use the layer tree bar.
      Returns:
      the layer tree bar
      See Also:
    • addStatusBar

      void addStatusBar(JPanel statusBar)
      Adds a status bar at the bottom of the application.
      Parameters:
      statusBar -
      Since:
      5.0
    • removeStatusBar

      void removeStatusBar()
      Removes the current status bar.
      Since:
      5.0
    • dispose

      void dispose()
      Releases all GUI resources used by this Service.
    • isDockableComponentVisible

      boolean isDockableComponentVisible(String componentKey)
      To know if a dockable component registered is visible or not
      Parameters:
      componentKey -
      Since:
      6.0