var class1 = new UMLClass()
or class1.name = "New Name"
because all changes should be done via operations which supports by undo and redo.createModel
function of app.factory
to create a model element with an option object.id
: ID of factory function to create an element. To see the full ID list, execute app.factory.getModelIds()
.parent
: A parent element where the created element to be contained.field
(optional) : Field name of the parent element (default is ownedElements
).modelInitializer
(optional) : A function to initialize the created model element.createDiagram
function of app.factory
to create a diagram with an option object:id
: ID of Factory function to create a diagram. To see the full ID list, execute app.factory.getDiagramIds()
.parent
: A parent element where the created diagram to be contained.options
(optional) : An object containing the below options.diagramInitializer
(optional) : A function to initialize the created diagram.createModelAndView
function of app.factory
to create a model element and a view element at once with an option object.id
: ID of Factory function. To see the full ID list, execute Factory.getModelAndViewIds()
.parent
: A parent element where the created model element to be contained.diagram
: A diagram element where the created view element to be contained.modelInitializer
(optional) : A function to initialize the created model element.viewInitializer
(optional) : A function to initialize the created view element.x1
, y1
, x2
, y2
(optional) : Rectangle coordinate to initialize position and size of the created view element.tailView
, headView
(optional) : If you try to create a relationship (e.g. UMLAssociation
), the created view element connects these two view elements tailView
and headView
.tailModel
, and headModel
(optional) : If you try to create a relationship, the created model element connects these two model elements tailModel
and headModel
.containerView
(optional) : A view element where the created view element to be contained.createModelAndView
returns the created view element, so you need to get the create model element by accessing model
field. (e.g. classView1.model
). Following code will create two classes and a association connecting the two classes.createViewOf
function of app.factory
to create a view element of an existing model element with an option object.model
: A model element referenced by the created view element.diagram
: A diagram element where the created view element to be contained.viewInitializer
(optional) : A function to initialize the created view element.x
, y
(optional) : Position of the created view element.containerView
(optional) : A view element where the created view element to be contained.createModel
function with Tag
parameter of app.factory
. There are five kinds of Tag: String, Number, Boolean, Reference, and Hidden. Hidden tags are not shown in diagrams, but other tags are shown as properties. (Check Format > Show Property menu). Following code will create a string tag to the selected element.class1.name = "New Name"
because all changes should be done via operations which supports by undo and redo.app.engine.setProperty()
function as below: