Class DisplayRelatedSymbols

java.lang.Object
com.nomagic.magicdraw.uml.symbols.DisplayRelatedSymbols

@OpenApiAll public class DisplayRelatedSymbols extends Object

Provides API to the display related symbols functionality.

MagicDraw allows displaying symbols that are related to a given symbol via relationships. The DisplayRelatedSymbols class provides API methods for this. Using this class you can control any of the following behaviors for displaying related symbols logic:

  • What relationship types should be included.
  • Depth of a relationship tree.
  • Whether or not existing symbols should be reused.

      Example: Displaying related generalizations and interface realizations

       SessionManager sessionManager = SessionManager.getInstance();
       sessionManager.createSession("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);
      
       //For multiple symbol selection to display related symbols use the code below
       List<PresentationElement> viewList = ...; //List of symbols for which you need to invoke the displaying related symbols action.
      
       DisplayRelatedSymbols.displayRelatedSymbols(viewList, info);
      
       sessionManager.closeSession();
       
See Also: