Package com.nomagic.magicdraw.ui.browser
Class Browser
java.lang.Object
com.nomagic.magicdraw.ui.browser.Browser
The MagicDraw application UI part with trees, documentation, zoom and search panels.
The primary purpose of this class is to manages predefined Trees and Panels in MagicDraw application Browser.
It has five trees:
- containment
- diagrams
- inheritance
- extensions
- search results
- documentation
- zoom control
Sample of accessing Swing JTree of containment tree:
getContainmentTree().getTree()
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Browser initializer is an extension point for browser creation. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBrowserInitializer
(Browser.BrowserInitializer initializer) Add new new browser initializer.void
addPanel
(ExtendedPanel panel) Adds a new browser panel.Should be called during browser initialization only.void
addPanel
(ExtendedPanel panel, int index) Adds a new browser panel.Should be called during browser initialization only.addTree
(BrowserTabTree tree, boolean drag, boolean drop) Adds and does setup a new tree to the browser.addTree
(BrowserTabTree tree, boolean drag, boolean drop, int index) Adds and does setup a new tree to the browser.Returns reference to the active tree.Returns containment tree.Returns diagrams tree.Returns extensions tree.getExtensionsTree
(boolean addIfNotExists) Returns extensions tree.Returns inheritance tree if it exists, otherwise nullReturns Lock view tree.Returns last active or newly added search results tree.getSearchResultsTree
(boolean addIfNotExists) Returns last active or newly added search results tree.getTrees()
static void
removeBrowserInitializer
(Browser.BrowserInitializer initializer) Remove browser initializer.void
removePanel
(ExtendedPanel panel) Removes browser panel.void
removeTree
(BrowserTabTree tree) Removes a tree from the browser.Should be called during browser initialization only.void
removeTree
(BrowserTabTree tree, boolean saveLayout) Removes a tree from the browser.Should be called during browser initialization only.
-
Method Details
-
addPanel
Adds a new browser panel.Should be called during browser initialization only.- Parameters:
panel
- panel- See Also:
-
addPanel
Adds a new browser panel.Should be called during browser initialization only.- Parameters:
panel
- panelindex
- index- See Also:
-
removePanel
Removes browser panel. Should be called during browser initialization only.- Parameters:
panel
- panel- See Also:
-
addTree
Adds and does setup a new tree to the browser. Should be called during browser initialization only.- Parameters:
tree
- a new treedrag
- tree should be a drag operation sourcedrop
- tree should be a drop operation source- Returns:
- added tree
- See Also:
-
addTree
@OpenApi public BrowserTabTree addTree(@Nonnull BrowserTabTree tree, boolean drag, boolean drop, int index) Adds and does setup a new tree to the browser. Should be called during browser initialization only.- Parameters:
tree
- a new treedrag
- tree should be a drag operation sourcedrop
- tree should be a drop operation sourceindex
- the position of new tree among other trees- Returns:
- added tree
- See Also:
-
removeTree
Removes a tree from the browser.Should be called during browser initialization only.- Parameters:
tree
- a new tree- See Also:
-
removeTree
Removes a tree from the browser.Should be called during browser initialization only.- Parameters:
tree
- a new treesaveLayout
- save information about existing trees into project options- See Also:
-
getActiveTree
Returns reference to the active tree.- Returns:
- active tree.
-
getInheritanceTree
Returns inheritance tree if it exists, otherwise null- Returns:
- inheritance tree.
-
getLockViewTree
Returns Lock view tree.- Returns:
- lock view tree.
-
getContainmentTree
Returns containment tree.- Returns:
- containment tree.
-
getDiagramsTree
Returns diagrams tree.- Returns:
- diagrams tree.
-
getExtensionsTree
Returns extensions tree.- Returns:
- extensions tree.
-
getExtensionsTree
Returns extensions tree.- Parameters:
addIfNotExists
- add tree if not exists and it is allowed to have extension tree- Returns:
- extensions tree.
-
getSearchResultsTree
Returns last active or newly added search results tree.- Returns:
- search results tree.
-
getSearchResultsTree
Returns last active or newly added search results tree.- Parameters:
addIfNotExists
- add search result tree if it does not exist- Returns:
- search results tree.
-
getTrees
- Returns:
- a list of browser trees
-
getPanels
- Returns:
- a list of browser panels.
-
addBrowserInitializer
Add new new browser initializer.- Parameters:
initializer
- initializer
-
removeBrowserInitializer
Remove browser initializer.- Parameters:
initializer
- initializer
-