85782689
MD2021xR2
3
Page History
Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
A modeling tool developed by No Magic Inc. allows displaying symbols that are related to a given symbol via relationships. The com.nomagic.magicdraw.uml.symbols.DisplayRelatedSymbols class provides API methods for this. Using this class you can control any of the following behaviors for displaying the related symbols logic:
- What relationship types should be included.
- The depth of a relationship tree.
- Whether or not existing symbols should be reused.
Example: Displaying related generalizations and interface realizations
Code Block | ||
---|---|---|
| ||
SessionManager sessionManager = SessionManager.getInstance(); sessionManager.createSession(project, "Display related"); Set linkTypes = new HashSet(); linkTypes.add(new LinkType(Generalization.class)); linkTypes.add(new LinkType(InterfaceRealization.class)); DisplayRelatedSymbolsInfo info = new DisplayRelatedSymbolsInfo(linkTypes); info.setDepthLimited(true); info.setDepthLimit(3); PresentationElement view = ...; // A symbol for which you need to invoke the displaying related symbols action. DisplayRelatedSymbols.displayRelatedSymbols(view, info); sessionManager.closeSession(project); |
Info |
---|
You can find the code examples in
|