Class PresentationElementsManager
- java.lang.Object
-
- com.nomagic.magicdraw.openapi.uml.PresentationElementsManager
-
@OpenApiAll public class PresentationElementsManager extends java.lang.Object
The utility class for ShapesElements and PathElement creating, moving and properties changing. Works together withSessionManager
.This manager can be used only if some session was created with SessionManager. See code sample in SessionManager description for more details.
- See Also:
SessionManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PresentationElementsManager()
Private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changePathBreakPoints(PathElement element, java.util.List newBreakPoints)
Changes the break points of the given PathElement.void
changePathPoints(PathElement element, java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.Point> newBreakPoints)
Changes the points of the given PathElement.PathElement
connectComment(ShapeElement comment, PresentationElement target)
Connects given comment with note anchor to the given presentation element.PathElement
connectNote(ShapeElement noteOrComment, PresentationElement target)
Connects given note or comment shape with an anchor to the given presentation element.PathElement
createContainmentLink(PresentationElement parentView, PresentationElement childView)
Connects given parent and child elements with containment link.ContentShape
createContentShape(PresentationElement parent, java.awt.Point location, Element pack)
Creates a ContentShape in the given parent.DurationConstraintView
createDurationConstraint(DurationConstraint durationConstraint, PathElement firstConstrainedView, PathElement secondConstrainedView)
Creates DurationConstraint presentation element between the given two end views, that can be either SeqMessageView or ActivationViewPathElement
createFoundMessage(Message message, ShapeElement from, Message insertAfter, int verticalGap)
Creates a found message symbol for given message from the given shape element.ShapeElement
createGenericView(Element element, PresentationElement parent, java.lang.String identifier)
Creates Generic viewShapeElement
createImageShape(PresentationElement parent, java.io.File imageFile)
Creates an image shape in the given parent.ShapeElement
createImageShape(PresentationElement parent, java.io.File imageFile, java.awt.Point location)
Creates an image shape in the given parent.PathElement
createLostMessage(Message message, ShapeElement from, Message insertAfter, int verticalGap)
Creates a lost message symbol for given message from the given shape element.ShapeElement
createNote(PresentationElement parent)
Creates a note in the given parent.ShapeElement
createNote(PresentationElement parent, java.awt.Point location)
Creates a note in the given parent.PartView
createPartShape(Property part, PresentationElement parent, java.util.List<Property> nestedPath, boolean createRelationships, java.awt.Point location)
Creates part shape on the diagram at a given coordinate.PathElement
createPathElement(Element relationship, PresentationElement client, PresentationElement supplier)
Creates a PathElement for given relationship between given client and supplier PresentationElements.ShapeElement
createPathToSelfShapeElement(Element relationship, PresentationElement client)
ShapeElement
createRectangularShape(PresentationElement parent)
Creates a rectangular shape in the given parent.ShapeElement
createRectangularShape(PresentationElement parent, java.awt.Point location)
Creates a rectangular shape in the given parent.ShapeElement
createSeparator(PresentationElement parent)
Creates a separator shape in the given parent.ShapeElement
createSeparator(PresentationElement parent, java.awt.Point location)
Creates a separator shape in the parent.PathElement
createSequenceMessage(Message message, MessageSort sort, ShapeElement from, ShapeElement to, boolean recursive, int diagonal, Message insertAfter, int verticalGap)
Creates a PathElement for given message between given client (from) and supplier (to) PresentationElements.ShapeElement
createShapeElement(Element element, PresentationElement parent)
Creates a ShapeElement for given ModelElement in the given diagram.ShapeElement
createShapeElement(Element element, PresentationElement parent, boolean createRelationships)
Creates a ShapeElement for given ModelElement in the given diagram.ShapeElement
createShapeElement(Element element, PresentationElement parent, boolean createRelationships, java.awt.Point location)
Creates a ShapeElement for given ModelElement in the given diagram.SwimlaneView
createSwimlane(java.util.List<? extends ActivityPartition> horizontal, java.util.List<? extends ActivityPartition> vertical, DiagramPresentationElement diagram)
Creates a swimlane in a given diagram.ShapeElement
createTextBox(PresentationElement parent)
Creates a text box in the given parent.ShapeElement
createTextBox(PresentationElement parent, java.awt.Point location)
Creates a text box in the given parent.PathElement
createVirtualRelation(PresentationElement clientView, PresentationElement supplierView, java.lang.String ruleKey)
Creates Virtual Relation viewvoid
deletePresentationElement(PresentationElement element)
Removes given element from the diagram.static PresentationElementsManager
getInstance()
Returns an instance of this manager.protected boolean
isPresentationElementEditable(PresentationElement element)
void
movePresentationElement(PresentationElement view, PresentationElement parent, java.awt.Point location)
Moves a presentation element to the given parent and the specified location.void
movePresentationElement(PresentationElement view, PresentationElement parent, java.awt.Point location, boolean canChangeElementOwner)
Moves a presentation element to the given parent and the specified location.void
movePresentationElement(PresentationElement view, java.awt.Point location)
Moves a presentation element to the specified location.void
movePresentationElements(java.util.List<PresentationElement> views, PresentationElement parent, java.awt.Point location)
Moves a list of presentation elements to the given parent and the specified location.void
movePresentationElements(java.util.List<PresentationElement> views, PresentationElement parent, java.awt.Point location, boolean canChangeElementOwner)
Moves a list of presentation elements to the given parent and the specified location.void
movePresentationElements(java.util.List<PresentationElement> views, java.awt.Point location)
Moves a list of presentation elements to the specified location.void
resetLabelPositions(PathElement element)
Moves all given PathElement's labels to the default position(for example default position for name label is a middle of the path).void
reshapeShapeElement(ShapeElement element, java.awt.Rectangle newBounds)
Reshapes given ShapeElement.void
setConstraintForNote(ShapeElement note, Constraint constraint)
Shows given constraint in the given note.void
setPresentationElementProperties(PresentationElement view, PropertyManager propertyManager)
Changes symbol properties of a given presentation element.void
setText(ShapeElement shape, java.lang.String text)
Sets text for given symbol.
-
-
-
Method Detail
-
getInstance
public static PresentationElementsManager getInstance()
Returns an instance of this manager.- Returns:
- instance of this manager.
-
createShapeElement
public ShapeElement createShapeElement(Element element, PresentationElement parent) throws ReadOnlyElementException
Creates a ShapeElement for given ModelElement in the given diagram. The created shape location is (0,0). The relationships to other symbols are not created.- Parameters:
element
- the given ModelElement to create ShapeElement for.parent
- presentation element in which symbol should be created. In case created symbol is illegal in such parent method can produce unpredictable results. Valid combination is such as package in package, class in package etc.- Returns:
- created shape element.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createShapeElement
public ShapeElement createShapeElement(Element element, PresentationElement parent, boolean createRelationships, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates a ShapeElement for given ModelElement in the given diagram. The created shape location is (0,0).- Parameters:
element
- the given ModelElement to create ShapeElement for.createRelationships
- create relationships to other symbols or not.parent
- presentation element in which symbol should be created. In case created symbol is illegal in such parent method can produce unpredictable results. Valid combination is such as package in package, class in package etc.location
- the location where the new symbol is placed- Returns:
- created shape element.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createShapeElement
public ShapeElement createShapeElement(Element element, PresentationElement parent, boolean createRelationships) throws ReadOnlyElementException
Creates a ShapeElement for given ModelElement in the given diagram. The created shape location is (0,0).- Parameters:
element
- the given ModelElement to create ShapeElement for.createRelationships
- create relationships to other symbols or not.parent
- presentation element in which symbol should be created. In case created symbol is illegal in such parent method can produce unpredictable results. Valid combination is such as package in package, class in package etc.- Returns:
- created shape element.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createPathElement
public PathElement createPathElement(Element relationship, PresentationElement client, PresentationElement supplier) throws ReadOnlyElementException
Creates a PathElement for given relationship between given client and supplier PresentationElements. The PathElement will be created in the same diagram as client's and supplier's PresentationElements are.
ModelElement of client must be equal to relationship's client.
ModelElement of supplier must be equal to relationship's supplier.- Parameters:
relationship
- the given relationship.client
- a PresentationElement of relationship client.supplier
- a PresentationElement of relationship supplier.- Returns:
- created PathElement for given a relationship.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createPathToSelfShapeElement
public ShapeElement createPathToSelfShapeElement(Element relationship, PresentationElement client) throws ReadOnlyElementException
- Throws:
ReadOnlyElementException
-
deletePresentationElement
public void deletePresentationElement(PresentationElement element) throws ReadOnlyElementException
Removes given element from the diagram.- Parameters:
element
- the element to remove.- Throws:
ReadOnlyElementException
- if diagram is read only.
-
isPresentationElementEditable
protected boolean isPresentationElementEditable(PresentationElement element)
-
movePresentationElement
public void movePresentationElement(PresentationElement view, PresentationElement parent, java.awt.Point location) throws ReadOnlyElementException
Moves a presentation element to the given parent and the specified location. During this operation parent of the symbol can change both at the symbols and at the model level. If model is read-only, model element parent does not change, only symbol coordinates change.- Parameters:
view
- presentation element to move.parent
- parent to move into.location
- location to move to.- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
movePresentationElement
public void movePresentationElement(PresentationElement view, PresentationElement parent, java.awt.Point location, boolean canChangeElementOwner) throws ReadOnlyElementException
Moves a presentation element to the given parent and the specified location. During this operation parent of the symbol can change both at the symbols and at the model level. If model is read-only, model element parent does not change, only symbol coordinates change.- Parameters:
view
- presentation element to move.parent
- parent to move into.location
- location to move to.canChangeElementOwner
- allow to change Element owner if needed by symbols structure- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
movePresentationElement
public void movePresentationElement(PresentationElement view, java.awt.Point location) throws ReadOnlyElementException
Moves a presentation element to the specified location. During this operation parent of the symbol does not change, only geometrical position changes.- Parameters:
view
- symbol to move.location
- location to move to.- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
movePresentationElements
public void movePresentationElements(java.util.List<PresentationElement> views, PresentationElement parent, java.awt.Point location) throws ReadOnlyElementException
Moves a list of presentation elements to the given parent and the specified location. During this operation parent of symbols can change both at the symbols and at the model level. If model is read-only, model element parent does not change, only symbol coordinates change.- Parameters:
views
- presentation elements to move.parent
- parent to move into.location
- location to move to.- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
movePresentationElements
public void movePresentationElements(java.util.List<PresentationElement> views, PresentationElement parent, java.awt.Point location, boolean canChangeElementOwner) throws ReadOnlyElementException
Moves a list of presentation elements to the given parent and the specified location. During this operation parent of symbols can change both at the symbols and at the model level. If model is read-only, model element parent does not change, only symbol coordinates change.- Parameters:
views
- presentation elements to move.parent
- parent to move into.location
- location to move to.canChangeElementOwner
- allow to change Element owner if needed by symbols structure- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
movePresentationElements
public void movePresentationElements(java.util.List<PresentationElement> views, java.awt.Point location) throws ReadOnlyElementException
Moves a list of presentation elements to the specified location. During this operation parent of symbols does not change.- Parameters:
views
- presentation elements to move.location
- location to move to.- Throws:
ReadOnlyElementException
- if element permissions prohibited to perform this operation.
-
reshapeShapeElement
public void reshapeShapeElement(ShapeElement element, java.awt.Rectangle newBounds) throws ReadOnlyElementException
Reshapes given ShapeElement.- Parameters:
element
- the ShapeElement to reshape.newBounds
- a new bounds of the element.- Throws:
ReadOnlyElementException
- if element is read only.
-
changePathBreakPoints
public void changePathBreakPoints(PathElement element, java.util.List newBreakPoints) throws ReadOnlyElementException
Changes the break points of the given PathElement. The order of break points is from supplier to client.- Parameters:
element
- the given PathElement.newBreakPoints
- a list of new PathElement break points- Throws:
ReadOnlyElementException
- if given element is read only and can't edit.java.lang.IllegalArgumentException
- if given element is null or if given breakpoints are null
-
changePathPoints
public void changePathPoints(PathElement element, java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.Point> newBreakPoints) throws ReadOnlyElementException
Changes the points of the given PathElement. The order of break points is from supplier to client.- Parameters:
element
- the given PathElement.supplierPoint
- new supplierclientPoint
- new client pointnewBreakPoints
- a list of new PathElement break points- Throws:
ReadOnlyElementException
- if given element is read only and can't editjava.lang.IllegalArgumentException
- if given element is null or if given breakpoints are null
-
resetLabelPositions
public void resetLabelPositions(PathElement element) throws ReadOnlyElementException
Moves all given PathElement's labels to the default position(for example default position for name label is a middle of the path).- Parameters:
element
- the given PathElement to reset labels for.- Throws:
ReadOnlyElementException
- if given element is read only and can not be editedjava.lang.IllegalArgumentException
- if given element is null.
-
setPresentationElementProperties
public void setPresentationElementProperties(PresentationElement view, PropertyManager propertyManager) throws ReadOnlyElementException
Changes symbol properties of a given presentation element. Make sure to pass the newly created or cloned property manager, not the old one.Example:
PresentationElement view = // some view ChoiceProperty property = (ChoiceProperty) view.getProperty(PropertyID.TAGGED_VALUES_DISPLAY_MODE); // important to create a new property or clone the old one! Property clonedProperty = property.clone(); clonedProperty.setValue(ClassifierView.IN_COMPARTMENT); // important to create a new property manager or clone the old one! PropertyManager properties = new PropertyManager(); properties.addProperty(clonedProperty); PresentationElementsManager.getInstance().setPresentationElementProperties(view, properties);
- Parameters:
view
- symbol for which to change the property manager.propertyManager
- a newly created or cloned manager with new properties, do not reuse the old property manager.- Throws:
ReadOnlyElementException
- if given element is null and can not be edited.java.lang.IllegalArgumentException
- if given element and properties is null and the element 's type can't have properties.
-
createNote
public ShapeElement createNote(PresentationElement parent) throws ReadOnlyElementException
Creates a note in the given parent. The created shape location is (0,0).- Parameters:
parent
- the parent to create ShapeElement in- Returns:
- created shape element
- Throws:
ReadOnlyElementException
- if diagram is read only and cannot editjava.lang.IllegalArgumentException
- if given parent is null
-
createNote
public ShapeElement createNote(PresentationElement parent, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates a note in the given parent.- Parameters:
parent
- the parent to create Note inlocation
- location of created Note- Returns:
- created Note
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if parent is null
-
createTextBox
public ShapeElement createTextBox(PresentationElement parent) throws ReadOnlyElementException
Creates a text box in the given parent. The created shape location is (0,0).- Parameters:
parent
- the parent to create ShapeElement in.- Returns:
- created shape element
- Throws:
ReadOnlyElementException
- if diagram is read only and cannot editjava.lang.IllegalArgumentException
- if given parent is null
-
createImageShape
public ShapeElement createImageShape(PresentationElement parent, java.io.File imageFile, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates an image shape in the given parent.- Parameters:
parent
- the parent to create Image Shape inimageFile
- image filelocation
- location of created Image Shape- Returns:
- created Image Shape
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if parent is null
-
createImageShape
public ShapeElement createImageShape(PresentationElement parent, java.io.File imageFile) throws ReadOnlyElementException
Creates an image shape in the given parent. The created shape location is (0,0).- Parameters:
parent
- the parent to create Image Shape inimageFile
- image file- Returns:
- created shape element
- Throws:
ReadOnlyElementException
- if parent is read only and cannot editjava.lang.IllegalArgumentException
- if given parent is null
-
createTextBox
public ShapeElement createTextBox(PresentationElement parent, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates a text box in the given parent.- Parameters:
parent
- the parent to create TextBox inlocation
- location of TextBox- Returns:
- created TextBox
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if given parent is null
-
createContentShape
public ContentShape createContentShape(PresentationElement parent, @CheckForNull java.awt.Point location, Element pack) throws ReadOnlyElementException
Creates a ContentShape in the given parent.- Parameters:
parent
- the parent to create ContentShape inlocation
- location of shapepack
- content shape root content- Returns:
- created TextBox
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if given parent is null
-
createSeparator
public ShapeElement createSeparator(PresentationElement parent) throws ReadOnlyElementException
Creates a separator shape in the given parent. The created shape location is (0,0).- Parameters:
parent
- the parent to create ShapeElement in- Returns:
- created shape element
- Throws:
ReadOnlyElementException
- if diagram is read only and cannot editjava.lang.IllegalArgumentException
- if given parent is null
-
createSeparator
public ShapeElement createSeparator(PresentationElement parent, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates a separator shape in the parent.- Parameters:
parent
- the parent to create Separator inlocation
- location of Separator- Returns:
- created Separator
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if given parent is null
-
createRectangularShape
public ShapeElement createRectangularShape(PresentationElement parent) throws ReadOnlyElementException
Creates a rectangular shape in the given parent. The created shape location is (0,0).- Parameters:
parent
- the parent to create ShapeElement in- Returns:
- created shape element
- Throws:
ReadOnlyElementException
- if diagram is read only and cannot editjava.lang.IllegalArgumentException
- if given parent is null
-
createRectangularShape
public ShapeElement createRectangularShape(PresentationElement parent, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates a rectangular shape in the given parent.- Parameters:
parent
- the parent to create Rectangular Shape inlocation
- location of shape- Returns:
- created shaped
- Throws:
ReadOnlyElementException
- if diagram is read only and can not be editedjava.lang.IllegalArgumentException
- if given parent is null
-
connectNote
public PathElement connectNote(ShapeElement noteOrComment, PresentationElement target) throws ReadOnlyElementException
Connects given note or comment shape with an anchor to the given presentation element.- Parameters:
noteOrComment
- the given note or comment shape.target
- the presentation element to connect note (or comment) to.- Returns:
- created anchor.
- Throws:
ReadOnlyElementException
- if note (or comment) is read-only and cannot edit.java.lang.IllegalArgumentException
- if given note is not instance of NoteView or comment is not instance of CommentView.
-
connectComment
public PathElement connectComment(ShapeElement comment, PresentationElement target) throws ReadOnlyElementException
Connects given comment with note anchor to the given presentation element.- Parameters:
comment
- comment to connect.target
- the presentation element to connect comment to.- Returns:
- created shape element.
- Throws:
ReadOnlyElementException
- if comment is read-only and not editable.java.lang.IllegalArgumentException
- if given comment is not an instance of CommentView.
-
setText
public void setText(ShapeElement shape, java.lang.String text) throws ReadOnlyElementException
Sets text for given symbol. Given symbol can be note, text box or separator.- Parameters:
shape
- the given symbol.text
- a new text for a given symbol.- Throws:
ReadOnlyElementException
- if diagram is read only.java.lang.IllegalArgumentException
- if given node is not instance of NoteView,TextBoxView,SeparatorView.
-
setConstraintForNote
public void setConstraintForNote(ShapeElement note, Constraint constraint) throws ReadOnlyElementException
Shows given constraint in the given note. Constraint must be added into model already. Constraint must be assigned to ModelElement of symbol connected to the given note. If these conditions are not true, constraint may not be shown inside the note.- Parameters:
note
- the given note.constraint
- the given constraint.- Throws:
ReadOnlyElementException
- if note is read only and cannot edit.java.lang.IllegalArgumentException
- if given node is not instance of NoteView.
-
createSwimlane
public SwimlaneView createSwimlane(java.util.List<? extends ActivityPartition> horizontal, java.util.List<? extends ActivityPartition> vertical, DiagramPresentationElement diagram) throws ReadOnlyElementException
Creates a swimlane in a given diagram. Adds horizontal and vertical partitions to the created swimlane.- Parameters:
horizontal
- list of horizontal partitionsvertical
- list of vertical partitionsdiagram
- parent for swimlane- Returns:
- created swimlane
- Throws:
ReadOnlyElementException
- if given diagram is read only and cannot edit.java.lang.IllegalArgumentException
- if given diagram is null.
-
createContainmentLink
public PathElement createContainmentLink(PresentationElement parentView, PresentationElement childView) throws ReadOnlyElementException
Connects given parent and child elements with containment link.- Parameters:
parentView
- the presentation element of the parent element.childView
- the presentation element of the child element.- Returns:
- created link.
- Throws:
ReadOnlyElementException
- if diagram is read only.java.lang.IllegalArgumentException
- if parent element does not contain child element.
-
createLostMessage
public PathElement createLostMessage(Message message, ShapeElement from, @CheckForNull Message insertAfter, int verticalGap) throws ReadOnlyElementException
Creates a lost message symbol for given message from the given shape element. The given message is initialized (message ends are created and set, message sort is assigned) in this method.- Parameters:
message
- the given messagefrom
- a ShapeElement of message client lifelineinsertAfter
- the new message is inserted after this message, or null to insert before all messagesverticalGap
- vertical gap before the new message- Returns:
- created symbol for a given message
- Throws:
ReadOnlyElementException
- if diagram is read only
-
createFoundMessage
public PathElement createFoundMessage(Message message, ShapeElement from, @CheckForNull Message insertAfter, int verticalGap) throws ReadOnlyElementException
Creates a found message symbol for given message from the given shape element. The given message is initialized (message ends are created and set, message sort is assigned) in this method.- Parameters:
message
- the given messagefrom
- a ShapeElement of message client lifelineinsertAfter
- the new message is inserted after this message, or null to insert before all messagesverticalGap
- vertical gap before the new message- Returns:
- created symbol for a given message
- Throws:
ReadOnlyElementException
- if diagram is read only
-
createSequenceMessage
public PathElement createSequenceMessage(Message message, MessageSort sort, ShapeElement from, ShapeElement to, boolean recursive, int diagonal, @CheckForNull Message insertAfter, int verticalGap) throws ReadOnlyElementException
Creates a PathElement for given message between given client (from) and supplier (to) PresentationElements. The given message is initialized (message ends are created and set, message sort is assigned) in this method. The diagram should be opened to make the messages' layout correctly.- Parameters:
message
- the given message.sort
- message sort.from
- a ShapeElement of message client lifeline.to
- a ShapeElement of message supplier lifeline.recursive
- true if message is recursive (recursive message can be only when from == to).diagonal
- vertical size of diagonal message, or 0 if the message is not diagonal.insertAfter
- the new message is inserted after this message, or null to insert before all messages.verticalGap
- vertical gap before the new message.- Returns:
- created PathElement for given message.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createDurationConstraint
@CheckForNull public DurationConstraintView createDurationConstraint(DurationConstraint durationConstraint, PathElement firstConstrainedView, PathElement secondConstrainedView) throws ReadOnlyElementException
Creates DurationConstraint presentation element between the given two end views, that can be either SeqMessageView or ActivationView- Parameters:
durationConstraint
- model element for the DurationConstraintViewfirstConstrainedView
- first endsecondConstrainedView
- second end- Throws:
ReadOnlyElementException
- if diagram is not editable
-
createPartShape
@CheckForNull public PartView createPartShape(Property part, PresentationElement parent, java.util.List<Property> nestedPath, boolean createRelationships, @CheckForNull java.awt.Point location) throws ReadOnlyElementException
Creates part shape on the diagram at a given coordinate. Parent symbol can be specified. If nested parts path is specified, nesting level is displayed in dot notation. It can be specified whether to create connected relationships.- Parameters:
part
- part for which to create a shape.parent
- parent symbol in which to add the part.nestedPath
- a list of nested parts in which to nest the given part symbol.createRelationships
- controls whether to display connected paths.location
- location on the diagram where to move the part.- Returns:
- created part symbol or null if it was not possible to create it.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createVirtualRelation
@CheckForNull public PathElement createVirtualRelation(PresentationElement clientView, PresentationElement supplierView, java.lang.String ruleKey) throws ReadOnlyElementException
Creates Virtual Relation view- Parameters:
clientView
- relation client viewsupplierView
- relation supplier viewruleKey
- Virtual relation rule key- Returns:
- created virtual relation symbol or null if it was not possible to create it.
- Throws:
ReadOnlyElementException
- if diagram is read only.
-
createGenericView
public ShapeElement createGenericView(Element element, PresentationElement parent, java.lang.String identifier) throws ReadOnlyElementException
Creates Generic view- Parameters:
element
- element for which the generic view is createdparent
- created view parent elementidentifier
- Generic view unique identifier, you can have different Generic views for same element when the identifier is different- Throws:
ReadOnlyElementException
- if diagram is read only.
-
-