Package com.nomagic.magicdraw.ui.browser
Class Browser
- java.lang.Object
-
- com.nomagic.magicdraw.ui.browser.Browser
-
@OpenApi public class Browser extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static interface
Browser.BrowserInitializer
Browser initializer is an extension point for browser creation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.BrowserTabTree
addTree(BrowserTabTree tree, boolean drag, boolean drop)
Adds and does setup a new tree to the browser.BrowserTabTree
addTree(BrowserTabTree tree, boolean drag, boolean drop, int index)
Adds and does setup a new tree to the browser.BrowserTabTree
getActiveTree()
Returns reference to the active tree.ContainmentTree
getContainmentTree()
Returns containment tree.DiagramsTree
getDiagramsTree()
Returns diagrams tree.ExtensionsTree
getExtensionsTree()
Returns extensions tree.ExtensionsTree
getExtensionsTree(boolean addIfNotExists)
Returns extensions tree.InheritanceTree
getInheritanceTree()
Returns inheritance tree if it exists, otherwise nullLockViewTree
getLockViewTree()
Returns Lock view tree.java.util.List<ExtendedPanel>
getPanels()
SearchResultsTree
getSearchResultsTree()
Returns last active or newly added search results tree.SearchResultsTree
getSearchResultsTree(boolean addIfNotExists)
Returns last active or newly added search results tree.java.util.List<BrowserTabTree>
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 Detail
-
addPanel
@OpenApi public void addPanel(ExtendedPanel panel)
Adds a new browser panel.Should be called during browser initialization only.- Parameters:
panel
- panel- See Also:
Browser.BrowserInitializer
-
addPanel
@OpenApi public void addPanel(ExtendedPanel panel, int index)
Adds a new browser panel.Should be called during browser initialization only.- Parameters:
panel
- panelindex
- index- See Also:
Browser.BrowserInitializer
-
removePanel
@OpenApi public void removePanel(ExtendedPanel panel)
Removes browser panel. Should be called during browser initialization only.- Parameters:
panel
- panel- See Also:
Browser.BrowserInitializer
-
addTree
@OpenApi public BrowserTabTree addTree(BrowserTabTree tree, boolean drag, boolean drop)
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:
Browser.BrowserInitializer
-
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:
Browser.BrowserInitializer
-
removeTree
@OpenApi public void removeTree(BrowserTabTree tree)
Removes a tree from the browser.Should be called during browser initialization only.- Parameters:
tree
- a new tree- See Also:
Browser.BrowserInitializer
-
removeTree
@OpenApi public void removeTree(BrowserTabTree tree, boolean saveLayout)
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:
Browser.BrowserInitializer
-
getActiveTree
@CheckForNull @OpenApi public BrowserTabTree getActiveTree()
Returns reference to the active tree.- Returns:
- active tree.
-
getInheritanceTree
@OpenApi @CheckForNull public InheritanceTree getInheritanceTree()
Returns inheritance tree if it exists, otherwise null- Returns:
- inheritance tree.
-
getLockViewTree
@CheckForNull @OpenApi public LockViewTree getLockViewTree()
Returns Lock view tree.- Returns:
- lock view tree.
-
getContainmentTree
@OpenApi public ContainmentTree getContainmentTree()
Returns containment tree.- Returns:
- containment tree.
-
getDiagramsTree
@OpenApi public DiagramsTree getDiagramsTree()
Returns diagrams tree.- Returns:
- diagrams tree.
-
getExtensionsTree
@OpenApi @CheckForNull public ExtensionsTree getExtensionsTree()
Returns extensions tree.- Returns:
- extensions tree.
-
getExtensionsTree
@OpenApi @CheckForNull public ExtensionsTree getExtensionsTree(boolean addIfNotExists)
Returns extensions tree.- Parameters:
addIfNotExists
- add tree if not exists and it is allowed to have extension tree- Returns:
- extensions tree.
-
getSearchResultsTree
@OpenApi public SearchResultsTree getSearchResultsTree()
Returns last active or newly added search results tree.- Returns:
- search results tree.
-
getSearchResultsTree
@CheckForNull @OpenApi public SearchResultsTree getSearchResultsTree(boolean addIfNotExists)
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
@OpenApi public java.util.List<BrowserTabTree> getTrees()
- Returns:
- a list of browser trees
-
getPanels
@OpenApi public java.util.List<ExtendedPanel> getPanels()
- Returns:
- a list of browser panels.
-
addBrowserInitializer
@OpenApi public static void addBrowserInitializer(Browser.BrowserInitializer initializer)
Add new new browser initializer.- Parameters:
initializer
- initializer
-
removeBrowserInitializer
@OpenApi public static void removeBrowserInitializer(Browser.BrowserInitializer initializer)
Remove browser initializer.- Parameters:
initializer
- initializer
-
-