Class AbstractDiagramPresentationElement
java.lang.Object
com.nomagic.magicdraw.uml.core.impl.MDElementImpl
com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElement
- All Implemented Interfaces:
com.dassault_systemes.modeler.foundation.project.ModelElementProjectProvider,com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer,BaseElement,MDElement,ModelElementProvider,NameOwner,PropertyChangeListener,Cloneable,Comparable,EventListener
- Direct Known Subclasses:
DiagramPresentationElement
@OpenApi
public abstract class AbstractDiagramPresentationElement
extends PresentationElement
implements com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer
-
Field Summary
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DOTTED_STROKE, SOLID_STROKE -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(BasePresentationElementVisitor visitor) booleanRegisters the listener for changes in all symbols contained in the diagram.final voidclose()Closes diagram window.Collects all elements in this diagram recursively.Collects all visible manipulated elements in this diagram recursively.Collects all visible elements in this diagram recursively.voidEnsures that the diagram is loaded.final PresentationElementfindPresentationElement(com.dassault_systemes.modeler.foundation.model.ModelElement element, Class presentationElementClass) Finds a presentation element for a given model element of the given symbol type in this diagram.final PresentationElementfindPresentationElement(Element element, Class presentationElementClass) Finds a presentation element for a given model element of a given symbol type in this diagram.final PresentationElementfindPresentationElementForPathConnecting(BaseElement element, Class presentationElementClass) Finds a presentation element to connect some PathElement for given model element of the given type in this diagram.final Stream<PresentationElement> findPresentationElementsForPathConnecting(Element element, Class presentationElementClass) Finds all symbols to connect some PathElement for a given model element of a given type in this diagram.booleanisLoaded()Check if the diagram is loaded.booleanChecks if diagram displays symbols as its contents.voidopen()Open the diagramvoidopen(boolean showProgress) Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already openvoidopenInActiveTab(boolean showProgress) Open diagram in currently active diagram tab If no other diagram is opened yet, creates a new tab If this diagram is already opened, simply activates that tabbooleanUnregister the given listener from the diagram.Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
collectSubManipulatedElements, editName, editName, getBoundsShape, getElement, getManipulatedParent, getManipulatedPresentationElements, getMiddlePoint, getObjectParent, getParent, getPreferredDimension, getPresentationElementStroke, getPresentationElementStroke, getSelected, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, hasManipulatedPresentationElements, isSelected, onFind, onFind, setAllSelected, setSelected, setSelectedMethods inherited from class com.nomagic.magicdraw.uml.core.impl.MDElementImpl
canAdd, canAddChild, canBeDeleted, compareTo, createSortKeys, getClassType, getName, getResourceID, getSortKeys, hasListeners, isEditable, removeAllParents, removeAllPropertyChangeListeners, sGetID, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.nomagic.magicdraw.uml.BaseElement
canAdd, isSelfChangeable
-
Method Details
-
collectShowingManipulatedElementsRecursively
Collects all visible manipulated elements in this diagram recursively.- Returns:
- manipulated elements in this diagram
-
collectShowingPresentationElementsRecursively
Collects all visible elements in this diagram recursively.- Returns:
- visible elements in this diagram
-
collectPresentationElementsRecursively
Collects all elements in this diagram recursively.- Returns:
- elements in this diagram
-
addContentPropertyChangeListener
Registers the listener for changes in all symbols contained in the diagram.- Parameters:
listener- thePropertyChangeListenerto be added- Returns:
- true if listener was added - it wasn't there yet, otherwise false
-
removeContentPropertyChangeListener
Unregister the given listener from the diagram.- Parameters:
listener- the PropertyChangeListener to be removed- Returns:
- true if listener was removed
-
isSymbolDiagram
@OpenApi public boolean isSymbolDiagram()Checks if diagram displays symbols as its contents. Another type of diagrams may be tables, matrices.- Returns:
- true if diagram displays symbols
-
accept
- Throws:
Exception
-
isLoaded
@OpenApi public boolean isLoaded()Check if the diagram is loaded.- Returns:
- true if diagram contents is loaded
-
ensureLoaded
@OpenApi public void ensureLoaded()Ensures that the diagram is loaded. If the diagram is not loaded, load it. Make sure the project is active before invoking this method. Otherwise, the diagram may not be loaded. -
findPresentationElement
@OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull Element element, @CheckForNull Class presentationElementClass) Finds a presentation element for a given model element of a given symbol type in this diagram. Does recursive search in the diagram.- Parameters:
element- the given ModelElement.presentationElementClass- the class of presentation element or null if any.- Returns:
- found presentation element or null if given ModelElement does not have a presentation element in this diagram.
-
findPresentationElement
@OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull com.dassault_systemes.modeler.foundation.model.ModelElement element, @CheckForNull Class presentationElementClass) Finds a presentation element for a given model element of the given symbol type in this diagram. Does recursive search in the diagram.- Parameters:
element- the given ModelElement.presentationElementClass- the class of presentation element or null if any.- Returns:
- found presentation element or null if given ModelElement does not have a presentation element in this diagram.
-
findPresentationElementForPathConnecting
@CheckForNull @OpenApi public final PresentationElement findPresentationElementForPathConnecting(BaseElement element, Class presentationElementClass) Finds a presentation element to connect some PathElement for given model element of the given type in this diagram. Does recursive search.- Parameters:
element- the given ModelElementpresentationElementClass- the class of presentation element or null if any.- Returns:
- found presentation element or null if given ModelElement does not have a presentation element in this diagram.
-
findPresentationElementsForPathConnecting
@OpenApi public final Stream<PresentationElement> findPresentationElementsForPathConnecting(Element element, Class presentationElementClass) Finds all symbols to connect some PathElement for a given model element of a given type in this diagram. Does recursive search.- Parameters:
element- the given ModelElementpresentationElementClass- the class of presentation element or null if any.- Returns:
- a stream of presentation elements
-
open
@OpenApi public void open()Open the diagram -
open
@OpenApi public void open(boolean showProgress) Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already open- Parameters:
showProgress- show progress dialog
-
openInActiveTab
@OpenApi public void openInActiveTab(boolean showProgress) Open diagram in currently active diagram tab If no other diagram is opened yet, creates a new tab If this diagram is already opened, simply activates that tab- Parameters:
showProgress- show progress dialog
-
close
@OpenApi public final void close()Closes diagram window.
-