Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


 

To create a com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement for given ModelElement in the givencom.nomagic.magicdraw.uml.symbols.DiagramPresentationElement, use method com.nomagic.magicdraw.openapi.uml.PresentationElementsManager#createShapeElement(...). The location of the created shape will be (0,0).

The following code example shows how to do this:

Code Block
languagejava
    com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class clazz = ...; 
    DiagramPresentationElement diagram = ...; 
    SessionManager.getInstance().createSession("Test");
    ShapeElement shape = PresentationElementsManager.getInstance().createShapeElement(clazz, diagram); 
    SessionManager.getInstance().closeSession();

Info

 You can find the code examples in

  • <installation_directory>\openapi\examples\symbolcreation
  • <installation_directory>\openapi\examples\sequencecreation



Panel
titleRelated pages