@OpenApi public class DiagramPresentationElement extends PresentationElement implements com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner, StereotypesDisplayModeOwner, com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer
ModelElementsManager
class.PresentationElementsManager
class.ModelElementsManager
,
PresentationElementsManager
DASHED_STROKE, DOTTED_STROKE, SOLID_STROKE
DSL_STEREOTYPE_DISPLAY_MODE_ALL, DSL_STEREOTYPE_DISPLAY_MODE_LAST, DSL_STEREOTYPE_DISPLAY_MODE_NONE, DSL_STEREOTYPE_DISPLAY_MODES, STEREOTYPE_DISPLAY_MODE_DO_NOT_DISPLAY_STEREOTYPES, STEREOTYPE_DISPLAY_MODE_ICON, STEREOTYPE_DISPLAY_MODE_SHAPE_IMAGE, STEREOTYPE_DISPLAY_MODE_SHAPE_IMAGE_AND_TEXT, STEREOTYPE_DISPLAY_MODE_TEXT, STEREOTYPE_DISPLAY_MODE_TEXT_AND_ICON, STEREOTYPES_DISPLAY_MODES, STEREOTYPES_DISPLAY_MODES_SIMPLE
Constructor and Description |
---|
DiagramPresentationElement()
Constructs new empty diagram.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Method accepts visitor, and calls method visit<class name>(this) of visitor .
|
boolean |
addContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the listener all diagram elements.
|
void |
close()
Closes diagram window.
|
java.util.Collection<PresentationElement> |
collectPresentationElementsRecursively()
Collects all elements in this diagram recursively.
|
java.util.Collection<PresentationElement> |
collectShowingManipulatedElementsRecursively()
Collects all visible manipulated elements in this diagram recursively.
|
java.util.Collection<PresentationElement> |
collectShowingPresentationElementsRecursively()
Collects all visible elements in this diagram recursively.
|
void |
ensureLoaded()
Ensures that diagram is loaded.
|
PresentationElement |
findPresentationElement(Element element,
java.lang.Class presentationElementClass)
Finds presentation element for given model element of given symbol type in this diagram.
|
PresentationElement |
findPresentationElementForPathConnecting(BaseElement element,
java.lang.Class presentationElementClass)
Finds presentation element to connect some PathElement for given model element of given type in this diagram.
|
java.util.stream.Stream<PresentationElement> |
findPresentationElementsForPathConnecting(Element element,
java.lang.Class presentationElementClass)
Finds presentations element to connect some PathElement for given model element of given type in this diagram.
|
Diagram |
getDiagram()
Returns Diagram model element of this presentation element.
|
DiagramFrameView |
getDiagramFrame()
Get the frame of the diagram.
|
DiagramType |
getDiagramType()
Returns the type of the diagram.
|
java.util.Collection<Element> |
getUsedModelElements()
Returns collection of model elements that has views in this diagram.
|
java.util.Collection<Element> |
getUsedModelElements(boolean checkOnlyPersistent)
Deprecated.
checkOnlyPersistent parameter is ignored. Use
getUsedModelElements() |
java.util.Set<Element> |
getUsedModelElements(UsedElementPolicy usedElementPolicy)
Returns collection of model elements that are used in this diagram.
|
boolean |
isElementInDiagram(Element element)
Checks if given element exist in any diagram.
|
boolean |
isElementInDiagram(Element element,
UsedElementPolicy usedElementPolicy)
Checks if given element exist in any diagram.
|
boolean |
isInitialFrameSizeSet() |
boolean |
isLoaded()
Check if diagram is loaded.
|
boolean |
isSymbolDiagram()
Checks if diagram displays symbols as its contents.
|
boolean |
layout(boolean useCommands)
Layout the diagram using default layouter.
|
boolean |
layout(boolean useCommands,
DiagramLayouter layouter)
Layouts the diagram with the specified layouter.
|
boolean |
layout(boolean useCommands,
DiagramLayouter diagramLayouter,
AbstractDiagramLayouterOptionsGroup options)
Layout the diagram.
|
void |
open()
Open the diagram
|
void |
open(boolean showProgress)
Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already open
|
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
|
boolean |
removeContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregister the given listener from the element.
|
void |
setDiagramType(DiagramType type)
Sets the type of the diagram and fires
the property change event with name ExtendedPropertyNames.EDIT_DIAGRAM_TYPE .
|
void |
setInitialFrameSizeSet(boolean value)
Set a flag that diagram frame size should not be recalculated on opening.
|
void |
sSetDiagramType(DiagramType type)
Sets the type of the diagram.
|
addProperty, collectSubManipulatedElements, editName, editName, getBounds, getBoundsShape, getDiagramPresentationElement, getDiagramSurface, getElement, getManipulatedParent, getManipulatedPresentationElements, getMiddlePoint, getObjectParent, getParent, getPreferredSize, getPresentationElements, getPresentationElementStroke, getPresentationElementStroke, getProperty, getPropertyManager, getSelected, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, hasManipulatedPresentationElements, isSelected, onFind, onFind, setAllSelected, setSelected, setSelected, useParentProperties
clone
accept, addPropertyChangeListener, atInsert, canAdd, canAdd, canAddChild, canAddChild, canAddInstance, canBeDeleted, canChangeParent, canDeleteChild, compareTo, createSortKeys, dispose, firePropertyChange, generateID, getClassType, getCommandForAppending, getHumanName, getHumanType, getID, getName, getProject, getProjectImpl, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, isParentOf, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setMDElement, setProjectProvider, sGetID, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getStereotypesDisplayMode, getUseStereotypeMode, isShowAbbreviatedDiagramType, isShowContextKind, isShowContextName, isShowContextType, isShowDiagramName, isShowDiagramType, isShowParameters
getDSLStereotypesDisplayMode, getStereotypesDisplayMode, setDSLStereotypesDisplayMode, setStereotypesDisplayMode, sSetDSLStereotypesDisplayMode, sSetStereotypesDisplayMode
@OpenApi public DiagramPresentationElement()
@OpenApi public void sSetDiagramType(@CheckForNull DiagramType type)
type
- the type of the diagram@OpenApi public void setDiagramType(DiagramType type)
type
- the type of the diagramExtendedPropertyNames.EDIT_DIAGRAM_TYPE
,
Project
@OpenApi public DiagramType getDiagramType()
DiagramTypeConstants.UML_CLASS_DIAGRAM
,
DiagramTypeConstants.UML_USECASE_DIAGRAM
,
DiagramTypeConstants.UML_COMMUNICATION_DIAGRAM
,
DiagramTypeConstants.UML_SEQUENCE_DIAGRAM
,
DiagramTypeConstants.UML_STATECHART_DIAGRAM
,
DiagramTypeConstants.UML_PROTOCOL_STATE_MACHINE_DIAGRAM
,
DiagramTypeConstants.UML_ACTIVITY_DIAGRAM
,
DiagramTypeConstants.UML_COMPOSITE_STRUCTURE_DIAGRAM
,
DiagramTypeConstants.UML_OBJECT_DIAGRAM
,
DiagramTypeConstants.UML_PACKAGE_DIAGRAM
,
DiagramTypeConstants.UML_COMPONENT_DIAGRAM
,
DiagramTypeConstants.UML_DEPLOYMENT_DIAGRAM
,
DiagramTypeConstants.UML_PROFILE_DIAGRAM
@OpenApi public Diagram getDiagram()
getElement()
@OpenApi public void accept(Visitor visitor) throws java.lang.Exception
MDElement
@OpenApi public void open()
@OpenApi public void open(boolean showProgress)
showProgress
- show progress dialog@OpenApi public void openInActiveTab(boolean showProgress)
showProgress
- show progress dialog@OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull Element element, @CheckForNull java.lang.Class presentationElementClass)
element
- the given ModelElement.presentationElementClass
- the class of presentation element or null if any.@CheckForNull @OpenApi public final PresentationElement findPresentationElementForPathConnecting(BaseElement element, java.lang.Class presentationElementClass)
element
- the given ModelElementpresentationElementClass
- the class of presentation element or null if any.@OpenApi public final java.util.stream.Stream<PresentationElement> findPresentationElementsForPathConnecting(Element element, java.lang.Class presentationElementClass)
element
- the given ModelElementpresentationElementClass
- the class of presentation element or null if any.@OpenApi public boolean isLoaded()
@OpenApi public void ensureLoaded()
@OpenApi public final void close()
@OpenApi public boolean layout(boolean useCommands)
Make sure before doing layout:
open()
to open diagram.SessionManager.closeSession()
to close session.PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.useCommands
- true to create commands. If true, this command will be available in project's command history.@OpenApi public boolean layout(boolean useCommands, DiagramLayouter layouter)
Make sure before doing layout:
open()
to open diagram.SessionManager.closeSession()
to close session.PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.useCommands
- true to create commands. If true, this command will be available in project's command history.layouter
- layouter to be used for layouting.@OpenApi public boolean layout(boolean useCommands, DiagramLayouter diagramLayouter, AbstractDiagramLayouterOptionsGroup options)
Make sure before doing layout:
open()
to open diagram.SessionManager.closeSession()
to close session.PresentationElement.setSelected(java.util.List)
()} to selects symbols in the diagram.useCommands
- true to create commands. If true, this command will be available in project's command history.diagramLayouter
- layouter to useoptions
- layout options@OpenApi @Deprecated public java.util.Collection<Element> getUsedModelElements(boolean checkOnlyPersistent)
getUsedModelElements()
checkOnlyPersistent
- if true, result includes elements for symbols which are saved to XMI and not created at run-time. If false, includes all elements.@OpenApi public java.util.Collection<Element> getUsedModelElements()
@OpenApi public java.util.Set<Element> getUsedModelElements(UsedElementPolicy usedElementPolicy)
usedElementPolicy
- used element policy@OpenApi public java.util.Collection<PresentationElement> collectShowingManipulatedElementsRecursively()
@OpenApi public java.util.Collection<PresentationElement> collectShowingPresentationElementsRecursively()
@OpenApi public java.util.Collection<PresentationElement> collectPresentationElementsRecursively()
@OpenApi public boolean isElementInDiagram(Element element)
element
- element@OpenApi public boolean isElementInDiagram(Element element, UsedElementPolicy usedElementPolicy)
element
- element@OpenApi @CheckForNull public DiagramFrameView getDiagramFrame()
@OpenApi public boolean addContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener
to be added.PropertyChangeSupport
@OpenApi public boolean removeContentPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removed.PropertyChangeSupport
@OpenApi public boolean isInitialFrameSizeSet()
@OpenApi public void setInitialFrameSizeSet(boolean value)
value
- new value@OpenApi public boolean isSymbolDiagram()