Interface JMapGuiService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Auto-hide means the window is hidden but accessible with a tab.static final int
Docked means the window is docked inside the main window.static final int
Floating means the window is in a floating container.static final int
Hidden means the window is hidden. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDockableComponent
(JComponent component, HashMap<String, Object> properties) Adds a component (usually a panel) into the application.addMenuItem
(String menuKey, AbstractAction menuAction, boolean addSeparatorBefore) Adds a menu action to the the specified menu in the application menu bar.void
addMenuItem
(String menuKey, JMenuItem menuItem, boolean addSeparatorBefore) Adds a menu item to the the specified menu in the application menu bar.void
addStatusBar
(JPanel statusBar) Adds a status bar at the bottom of the application.void
addToolBar
(ToolBar toolBar, HashMap<String, Object> properties) Adds a tool bar to the application.void
dispose()
Releases all GUI resources used by this Service.getDockableComponent
(String componentKey) Returns the component specified by the componentKey.Returns the factory that should be used to create user interface components for the current application toolkit.Returns the layer bar.Returns the layer tree bar.Returns the main button group.Returns the menu identified by the specified key.Returns the application menu bar.getMenuItem
(Class actionClass) Returns the menu item identified by the specified class.getToolBar
(String toolBarKey) Returns the tool bar identified by the specified key.boolean
isDockableComponentVisible
(String componentKey) To know if a dockable component registered is visible or notvoid
removeDockableComponent
(String componentKey) Removes the component specified by the componentKey.void
removeDockableComponent
(String componentKey, boolean onlyIfFloating) Removes the component specified by the componentKey.void
removeMenuItem
(String menuKey, JMenuItem menuItem) Removes a menu item from the specified menu in the application menu bar.void
Removes the current status bar.void
removeToolBar
(String toolBarKey) Removes a tool bar.void
setDockableComponentTitle
(String componentKey, String title) Sets the title of a dockable component specified by the componentKey.void
setDockableComponentVisible
(String componentKey, boolean visible) Show or hide a dockable component specified by the componentKey.void
setToolBarVisible
(String toolBarKey, boolean visible) Shows or hides a tool bar.
-
Field Details
-
STATE_HIDDEN
static final int STATE_HIDDENHidden means the window is hidden.- See Also:
-
STATE_FLOATING
static final int STATE_FLOATINGFloating means the window is in a floating container.- See Also:
-
STATE_AUTOHIDE
static final int STATE_AUTOHIDEAuto-hide means the window is hidden but accessible with a tab.- See Also:
-
STATE_DOCKED
static final int STATE_DOCKEDDocked 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
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
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
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
Adds a menu action to the the specified menu in the application menu bar.- Parameters:
menuKey
- the menu bar item to add tomenuAction
- the menu action to addaddSeparatorBefore
- if true, aJPopupMenu.Separator
will be added before the menuItem- Returns:
- the menu item created with the abstract action
-
addMenuItem
Adds a menu item to the the specified menu in the application menu bar.- Parameters:
menuKey
- the menu bar item to add tomenuItem
- the menu item to addaddSeparatorBefore
- if true, aJPopupMenu.Separator
will be added before the menuItem
-
removeMenuItem
Removes a menu item from the specified menu in the application menu bar.- Parameters:
menuKey
- the menu bar item to remove frommenuItem
- the menu item to remove
-
addToolBar
Adds a tool bar to the application. Available properties are :CONTEXT_INIT_SIDE
(optional) with possible valuesSwingConstants.EAST
,SwingConstants.WEST
,SwingConstants.NORTH
(default),SwingConstants.SOUTH
- Parameters:
toolBar
- the tool bar to addproperties
- the specifications used to place the component- See Also:
-
removeToolBar
Removes a tool bar.- Parameters:
toolBarKey
- the tool bar key
-
setToolBarVisible
Shows or hides a tool bar.- Parameters:
toolBarKey
- the tool bar keyvisible
-
-
addDockableComponent
Adds a component (usually a panel) into the application. Available properties are :KEY
(mandatory) - A uniqueString
value in the Docking environmentFRAME_ICON
(optional) - The icon used in the title barTITLE
(optional) - The text in the title barAVAILABLE_BUTTONS
(optional) - TODO : docCONTEXT_INIT_MODE
(optional) with possible valuesSTATE_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 sideCONTEXT_DOCKED_WIDTH
(optional) - The width of the componentCONTEXT_DOCKED_HEIGHT
(optional) - The height of the componentCONTEXT_FLOATING_X
(optional) - Specify the X position of the component in floating modeCONTEXT_FLOATING_Y
(optional) - Specify the Y position of the component in floating modeCONTEXT_INIT_SIDE
(optional) with possible valuesSwingConstants.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 addproperties
- the specifications used to place the component
-
getDockableComponent
Returns the component specified by the componentKey. May returnnull
if the componentKey is not found.- Parameters:
componentKey
- the KEY of the component to retrieve- Returns:
- the component associated with the specified componentKey
-
removeDockableComponent
Removes the component specified by the componentKey.- Parameters:
componentKey
- the KEY of the component to remove
-
removeDockableComponent
Removes the component specified by the componentKey.- Parameters:
componentKey
- the KEY of the component to removeonlyIfFloating
- remove only if the component is floating
-
setDockableComponentVisible
Show or hide a dockable component specified by the componentKey.- Parameters:
componentKey
- the KEY of the component to show or hidevisible
- the visibility state
-
setDockableComponentTitle
Sets the title of a dockable component specified by the componentKey.- Parameters:
componentKey
- the KEY of the component to set the titletitle
- 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 benull
if the application doesn't use the layer bar.- Returns:
- the layer bar
- See Also:
-
getLayerTreeBar
LayerTreeBar getLayerTreeBar()Returns the layer tree bar. May benull
if the application doesn't use the layer tree bar.- Returns:
- the layer tree bar
- See Also:
-
addStatusBar
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
To know if a dockable component registered is visible or not- Parameters:
componentKey
-- Since:
- 6.0
-