@OpenApiAll
public class DisplayRelatedSymbols
extends java.lang.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:
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();
DisplayRelatedSymbolsInfo
,
LinkType
Constructor and Description |
---|
DisplayRelatedSymbols() |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<PresentationElement> |
displayRelatedSymbols(java.util.List<PresentationElement> viewList,
DisplayRelatedSymbolsInfo info)
Displays related symbols for given multiple symbols.
|
static java.util.Collection<PresentationElement> |
displayRelatedSymbols(PresentationElement view,
DisplayRelatedSymbolsInfo info)
Displays related symbols for a given symbol.
|
static java.util.Set<LinkType> |
getPossibleLinkTypes(PresentationElement view)
Given a symbol, gets all relationship types which it has in the model.
|
public static java.util.Collection<PresentationElement> displayRelatedSymbols(PresentationElement view, DisplayRelatedSymbolsInfo info) throws ReadOnlyElementException
view
- symbol for which to display related symbols.info
- configuration of display related behavior.ReadOnlyElementException
- if given element is not editable (read-only).public static java.util.Collection<PresentationElement> displayRelatedSymbols(java.util.List<PresentationElement> viewList, DisplayRelatedSymbolsInfo info) throws ReadOnlyElementException
viewList
- symbol list for which to display related symbols.info
- configuration of display related behavior.ReadOnlyElementException
- if given element is not editable (read-only).public static java.util.Set<LinkType> getPossibleLinkTypes(PresentationElement view)
view
- symbol for which to retrieve possible relationship types.