Class DisplayRelatedSymbols
- java.lang.Object
 - 
- com.nomagic.magicdraw.uml.symbols.DisplayRelatedSymbols
 
 
- 
@OpenApiAll public class DisplayRelatedSymbols extends java.lang.ObjectProvides API to the display related symbols functionality.
MagicDraw allows displaying symbols that are related to a given symbol via relationships. The
DisplayRelatedSymbolsclass 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.displayMultipleRelatedSymbols(viewList, info); sessionManager.closeSession(); 
- See Also:
 DisplayRelatedSymbolsInfo,LinkType
 
- 
- 
Constructor Summary
Constructors Constructor Description DisplayRelatedSymbols() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Collection<PresentationElement>displayRelatedSymbols(PresentationElement view, DisplayRelatedSymbolsInfo info)Displays related symbols for a given symbol.static java.util.Collection<PresentationElement>displayRelatedSymbols(java.util.List<PresentationElement> viewList, DisplayRelatedSymbolsInfo info)Displays related symbols for given multiple symbols.static java.util.Set<LinkType>getPossibleLinkTypes(PresentationElement view)Given a symbol, gets all relationship types which it has in the model. 
 - 
 
- 
- 
Method Detail
- 
displayRelatedSymbols
public static java.util.Collection<PresentationElement> displayRelatedSymbols(PresentationElement view, DisplayRelatedSymbolsInfo info) throws ReadOnlyElementException
Displays related symbols for a given symbol.- Parameters:
 view- symbol for which to display related symbols.info- configuration of display related behavior.- Returns:
 - symbols which were displayed successfully.
 - Throws:
 ReadOnlyElementException- if given element is not editable (read-only).
 
- 
displayRelatedSymbols
public static java.util.Collection<PresentationElement> displayRelatedSymbols(java.util.List<PresentationElement> viewList, DisplayRelatedSymbolsInfo info) throws ReadOnlyElementException
Displays related symbols for given multiple symbols.- Parameters:
 viewList- symbol list for which to display related symbols.info- configuration of display related behavior.- Returns:
 - symbols which were displayed successfully.
 - Throws:
 ReadOnlyElementException- if given element is not editable (read-only).
 
- 
getPossibleLinkTypes
public static java.util.Set<LinkType> getPossibleLinkTypes(PresentationElement view)
Given a symbol, gets all relationship types which it has in the model.- Parameters:
 view- symbol for which to retrieve possible relationship types.- Returns:
 - possible relationship types for a given symbol.
 
 
 - 
 
 -