Factory

Description

Factory creates model, view and diagram elements

This module dispatches these events:

  • diagramCreated: (diagram)
  • elementCreated: (model, view)

Functions Summary

Functions

_defaultModelPrecondition

Default precondition for model creation

param{Object}
options
Public API

createDiagram

Create a diagram

Returns: Diagram
param{string}
id
param{Model}
parent
param{Object}
options
Public API

createModel

Create a model element

Returns: Model
param{string}
id
param{Model}
parent
param{string}
field
param{Object}
options
Public API

createModelAndView

Create model and view elements

Returns: View
param{string}
id
param{Model}
parent
param{Diagram}
diagram
param{Object}
options
Public API

createViewAndRelationships

Create a view of a given model with relationship views

editor Editor
x number
y number
model Model
containerView View
Public API

createViewOf

Create a view element of a given model based on diagram type

param{Model}
model
param{Diagram}
diagram
param{Object}
options
Public API

defaultDiagramFn

Default function to create diagram.

parent Model
options Object
Options = { precondition, diagramType, diagramInitializer }
Public API

defaultDirectedRelationshipFn

Default function to create model and view elements of DirectedRelationship.

parent Model
diagram Diagram
options Object
Options = { precondition, modelType, viewType, field, modelInitializer, viewInitializer, x1, y1, x2, y2, containerView }
Public API

defaultEdgeViewOnlyFn

Default function to create edge view element only.

parent Model
diagram Diagram
options Object
Options = { precondition, viewType, viewInitializer, x1, y1, x2, y2, containerView }
Public API

defaultModelAndViewFn

Default function to create model and view elements.

parent Model
diagram Diagram
options Object
Options = { precondition, modelType, viewType, field, modelInitializer, viewInitializer, x1, y1, x2, y2, containerView }
Public API

defaultModelFn

Default function to create model element.

parent Model
field string
options Object
Options = { precondition, modelType, field, modelInitializer }
Public API

defaultUndirectedRelationshipFn

Default function to create model and view elements of UndirectedRelationship.

parent Model
diagram Diagram
options Object
Options = { precondition, modelType, viewType, field, modelInitializer, viewInitializer, x1, y1, x2, y2, containerView }
Public API

defaultViewOnlyFn

Default function to create view element only.

parent Model
diagram Diagram
options Object
Options = { precondition, viewType, viewInitializer, x1, y1, x2, y2, containerView }
Public API

getDiagramIds

Return all available Ids for 'createDiagram' function

Returns: Array.<string>
Public API

getModelAndViewIds

Return all available Ids for 'createModelAndView' function

Returns: Array.<string>
Public API

getModelIds

Return all available Ids for 'createModel' function

Returns: Array.<string>
Public API

registerDiagramFn

Register a function to create diagram.

param{string}
id
param{Function}
fn
Public API

registerModelAndViewFn

Register a function to create both model and view elements.

param{string}
id
param{Function}
fn
param{Object}
defaultOptions
Public API

registerModelFn

Register a function to create a model element.

param{string}
id
param{Function}
fn
Public API

registerViewOfFn

Register a function to create a view element based on diagram type.

param{string}
diagramType
param{Function}
fn