Package com.nomagic.magicdraw.uml
Class Refactoring.Converting
java.lang.Object
com.nomagic.magicdraw.uml.Refactoring.Converting
- Enclosing class:
- Refactoring
Converts elements in the model.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Element
convert
(Element source, ConvertElementInfo info) Converts given element according given conversion info.static Element
convert
(Element source, Element target, ConvertElementInfo info) Converts element with another element according given conversion info.static ShapeElement
convertCommentToNote
(ShapeElement comment) Converts Comment into Note.static ShapeElement
convertNoteToComment
(ShapeElement note, Stereotype commentStereotype) Converts Note into Comment.static PartView
convertPortToPart
(PortView portView) Converts Port symbol to Part symbolstatic PartView
convertPortToPartAndRemovePortSymbol
(PortView portView) Convert port symbol to part symbol by creating new part symbol for port element After that remove unused port symbol
-
Constructor Details
-
Converting
public Converting()
-
-
Method Details
-
convert
public static Element convert(Element source, ConvertElementInfo info) throws ReadOnlyElementException Converts given element according given conversion info.- Parameters:
source
- element to convert.info
- conversion rules.- Returns:
- newly created element after conversion, null if conversion didn't succeed.
- Throws:
ReadOnlyElementException
- if given element is not editable (read-only).
-
convert
public static Element convert(Element source, @CheckForNull Element target, ConvertElementInfo info) throws ReadOnlyElementException Converts element with another element according given conversion info.- Parameters:
source
- element to convert.target
- element with which to convert, can be null, in this case a new element will be created.info
- conversion rules.- Returns:
- target element.
- Throws:
ReadOnlyElementException
- if given element is not editable (read-only).
-
convertNoteToComment
public static ShapeElement convertNoteToComment(ShapeElement note, @CheckForNull Stereotype commentStereotype) throws ReadOnlyElementException Converts Note into Comment.- Parameters:
note
- note shapecommentStereotype
- apply given stereotypes to created Comment- Returns:
- Comment shape
- Throws:
ReadOnlyElementException
- if given Note symbol is not editable (read-only) or diagram owner is not editableIllegalArgumentException
- if given symbol is not a Note symbol
-
convertCommentToNote
public static ShapeElement convertCommentToNote(ShapeElement comment) throws ReadOnlyElementException Converts Comment into Note.- Parameters:
comment
- comment shape- Returns:
- Note shape
- Throws:
ReadOnlyElementException
- if given Comment symbol is not editable (read-only) or Comment is not editableIllegalArgumentException
- if given symbol is not a Comment symbol
-
convertPortToPartAndRemovePortSymbol
public static PartView convertPortToPartAndRemovePortSymbol(PortView portView) throws ReadOnlyElementException Convert port symbol to part symbol by creating new part symbol for port element After that remove unused port symbol- Throws:
ReadOnlyElementException
-
convertPortToPart
Converts Port symbol to Part symbol- Parameters:
portView
- port symbol- Returns:
- part symbol
- Throws:
ReadOnlyElementException
- if given port symbol is not editable (read-only)
-