Package com.nomagic.magicdraw.ui.browser
Class Browser
- java.lang.Object
-
- com.nomagic.magicdraw.ui.browser.Browser
-
@OpenApi public class Browser extends java.lang.ObjectThe 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 interfaceBrowser.BrowserInitializerBrowser initializer is an extension point for browser creation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddBrowserInitializer(Browser.BrowserInitializer initializer)Add new new browser initializer.voidaddPanel(ExtendedPanel panel)Adds a new browser panel.Should be called during browser initialization only.voidaddPanel(ExtendedPanel panel, int index)Adds a new browser panel.Should be called during browser initialization only.BrowserTabTreeaddTree(BrowserTabTree tree, boolean drag, boolean drop)Adds and does setup a new tree to the browser.BrowserTabTreeaddTree(BrowserTabTree tree, boolean drag, boolean drop, int index)Adds and does setup a new tree to the browser.BrowserTabTreegetActiveTree()Returns reference to the active tree.ContainmentTreegetContainmentTree()Returns containment tree.DiagramsTreegetDiagramsTree()Returns diagrams tree.ExtensionsTreegetExtensionsTree()Returns extensions tree.ExtensionsTreegetExtensionsTree(boolean addIfNotExists)Returns extensions tree.InheritanceTreegetInheritanceTree()Returns inheritance tree if it exists, otherwise nullLockViewTreegetLockViewTree()Returns Lock view tree.java.util.List<ExtendedPanel>getPanels()SearchResultsTreegetSearchResultsTree()Returns last active or newly added search results tree.SearchResultsTreegetSearchResultsTree(boolean addIfNotExists)Returns last active or newly added search results tree.java.util.List<BrowserTabTree>getTrees()static voidremoveBrowserInitializer(Browser.BrowserInitializer initializer)Remove browser initializer.voidremovePanel(ExtendedPanel panel)Removes browser panel.voidremoveTree(BrowserTabTree tree)Removes a tree from the browser.Should be called during browser initialization only.voidremoveTree(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
-
-