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:
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); |
You can find the code examples in
|