Components
Component classes constitute the application.
AppContext
The global application context.
An instance of this class can be accessed via the global app
variable.
Do not try to create an instance using new
keyword.
new AppContext()
Extends
EventEmitter
Example
var appName = app.name
console.log(appName)
Instance Members
Application name
name
Type:
string
Application version
version
Type:
string
An instance of Repository
repository
Type:
Repository
An instance of Engine
engine
Type:
Engine
An instance of Factory
factory
Type:
Factory
An instance of CommandPalette
commandPalette
Type:
CommandPalette
▸
elementListPickerDialog
▸
elementListEditorDialog
Returns the full path to the application directory.
Returns
!string
:
fullPath reference
Returns the full path to the user data directory.
Returns
!string
:
fullPath reference
ProjectManager
Project Manager
new ProjectManager()
Extends
EventEmitter
Instance Members
Return current filename.
Returns
string
:
Close project
closeProject()
Save project to file
Parameters
Returns
Project
:
The saved project
Load from a file
Parameters
Returns
Project
:
The loaded project. (null if failed to load)
▸
loadAsTemplate(fullPath)
Load from a file as template
Parameters
Returns
Project
:
The loaded project. (null if failed to load)
Load project from JSON
Parameters
Returns
Project
:
The loaded project. (null if failed to load)
▸
importFromFile(parent, fullPath)
Import model fragment from a file.
Parameters
parent (Element)
Element to contain the imported element.
Returns
Element
:
The imported element (null if failed to import)
▸
importFromJson(parent, data)
Import from JSON
Parameters
parent (Element)
Element to contain the imported element.
Returns
Element
:
The imported element (null if failed to import)
▸
exportToFile(elem, fullPath)
Export model fragment to a file.
Parameters
elem (Element)
Element to be exported.
Returns
Element
:
The exported element
Events
Triggered when a project is created
projectCreated
Properties
project (Project)
: The created project
Triggered before the project is closed
beforeProjectClose
Properties
filename (string)
: File name of the project
project (Project)
: The closing project
Triggered after the project is closed
projectClosed
Triggered after the project is saved
projectSaved
Properties
filename (string)
: File name of the project
project (Project)
: The saved project
Triggered after a project is loaded
projectLoaded
Properties
filename (string)
: File name of the project
project (Project)
: The loaded project
Triggered after a model fragment is imported
imported
Properties
filename (string)
: File name of the model fragment
elem (Element)
: The imported model fragment
Triggered after a model fragment is exported
exported
Properties
filename (string)
: File name of the model fragment
elem (Element)
: The exported model fragment
CommandManager
Manages global application commands that can be called from menu items, key bindings, or subparts
of the application.
new CommandManager()
Extends
EventEmitter
Instance Members
Map of all registered global commands
commands
Command names
commandNames
▸
register(id, commandFn, name)
Registers a global command.
Parameters
id (string)
unique identifier for command.
Core commands in app use a simple command title as an id, for example "open.file".
Extensions should use the following format: "author.myextension.mycommandname".
For example, "lschmitt.csswizard.format.css".
commandFn (function)
the function to call when the command is executed. Any arguments passed to
execute() (after the id) are passed as arguments to the function. If the function is asynchronous,
it must return a jQuery promise that is resolved when the command completes. Otherwise, the
CommandManager will assume it is synchronous, and return a promise that is already resolved.
name (string)
The name of command.
Looks up and runs a global command. Additional arguments are passed to the command.
Parameters
id (string)
The ID of the command to run.
Returns
object
:
Result of the registered command function
Events
Triggered when a command is registered
commandRegistered
Properties
id (string)
: The ID of the command
Triggered before a command is executed
beforeExecuteCommand
Properties
id (string)
: The ID of the command
Repository
Repository maintains a set of elements.
Reponsibilities:
- Applies operations. (Undo/Redo)
- Query for retrieve elements.
new Repository()
Extends
EventEmitter
Instance Members
Do an Operation
If operation.bypass == true, the operation will not be pushed to UndoStack.
doOperation(operation:
Object)
Parameters
Clear all maps and stacks
clear()
Return whether project is modified or not.
Returns
boolean
:
Return true if the given parameter is an element in this Repository.
Parameters
Returns
boolean
:
Return an array of elements selected by selector expression.
This is a quite heavy operation, so you need to concern about performance.
Selector expression
- Children selector
ex) Package1:: -- all children of Package1
- Type selector: "@<type>"
ex) Package1::@UMLClass
- Field selector: ".<field>"
ex) Class1.attributes, Package1.owendElements
- Value selector: "[field=value]"
ex) Class1.operations[isAbstract=false]
- Name selector: "<name>" (equivalent to "[name=<name>]")
ex) Class1, Class1::Attribute1
Selector examples:
Parameters
Returns
Array<Element>
:
Return element by id.
Parameters
id (string)
Identifier of element.
Returns
Element
:
Element of id.
▸
getInstancesOf(_typeName)
Return instances of a specified type name(s).
Parameters
Returns
Array<Element>
:
instances of the type name(s).
Find the first matched element satisfying the predicate.
Parameters
predicate (function (Element): boolean)
A function to filter elements.
Returns
Element
:
A matched element.
Find all elements satisfying the predicate.
Parameters
predicate (function (Element): boolean)
A function to filter elements.
Returns
Array<Element>
:
All matched elements.
▸
search(keyword, typeFilter)
Search elements by keyword and type
Parameters
Returns
Array<Element>
:
elements
▸
lookupAndFind(namespace, name, typeFilter)
Lookup an element and then find. (See Element.prototype.lookup
and find
).
Parameters
namespace (!Element)
Element to start to lookup.
name (string)
Name of element to find
typeFilter (constructor)
Type filter. (e.g.
type.UMLClass
)
Returns
Element
:
A matched element.
▸
getRefsTo(elem, iterator)
Return all elements referencing to the given element.
Parameters
elem (Element)
Element. (model element, view element, or diagram)
iterator (function (Element): boolean?)
if given, returns instances only satisfying iterator function.
Returns
Array<Element>
:
Elements referencing to.
▸
getRelationshipsOf(model, iterator)
Return all instances of Relationship connected to the given model element.
Parameters
model (Model)
Model element.
iterator (function (Element): boolean?)
if given, returns instances only satisfying iterator function.
Returns
Array<Model>
:
Instances of Relationship.
Return all views associated with the given model.
Parameters
model (Model)
Model element.
Returns
Array<View>
:
View elements associated with.
Events
Triggered when order of an element is changed
reordered
Properties
elem (Element)
: The reordered element
Triggered when an element is relocated to another parent element
relocated
Properties
elem (Element)
: The relocated element
field (Element)
: The field name of the parent
Triggered after elements were created
created
Properties
createdElements (Array<Element>)
: An array of created elements
Triggered after elements were deleted
deleted
Properties
deletedElems (Array<Element>)
: An array of deleted elements
Triggered after elements were updated
updated
Properties
updatedElems (Array<Element>)
: An array of updated elements
Triggered before an operation is executed
beforeExecuteOperation
Properties
operation (Object)
: Operation to be executed
Triggered after an operation is executed
operationExecuted
Properties
operation (Object)
: Operation has executed
Triggered before undo an operation
beforeUndo
Properties
operation (Object)
: Operation to be unexecuted
Triggered after undo an operation
undo
Properties
operation (Object)
: Operation has unexecuted
Triggered before redo an operation
beforeRedo
Properties
operation (Object)
: Operation to be reexecuted
Triggered after redo an operation
redo
Properties
operation (Object)
: Operation has reexecuted
OperationBuilder
OperationBuilder is used to build an operation
new OperationBuilder()
Extends
EventEmitter
Instance Members
Return timestamp
getTimestamp()
▸
begin(name, bypass, opName)
Begin to make an operation.
begin(name: any, bypass: any, opName:
string)
Parameters
opName (string)
Operation name
Finish to make an operation.
end()
Discard currently making operation.
discard()
Return currently made operation.
Returns
Object
:
Insert an element.
Parameters
Remove an element.
Parameters
▸
fieldAssign(elem, field, val)
Assign value to field.
Parameters
▸
fieldInsert(elem, field, val)
Insert an element to array field.
Parameters
▸
fieldInsertAt(elem, field, val, pos)
Insert a value to array field at a specific position (index).
Parameters
▸
fieldRemove(elem, field, val)
Remove a value from array field.
Parameters
▸
fieldRemoveAt(elem, field, val, pos, value)
Remove a value from array field at a specific position.
Parameters
▸
fieldReorder(elem, field, val, pos)
Change order of a value in array field.
Parameters
pos (number)
Position to be placed
▸
fieldRelocate(elem, field, oldParent, newParent)
Relocate an element to another parent.
Parameters
elem (Element)
Element to be relocated
field (string)
Field name of parent
oldParent (number)
Current parent
newParent (number)
New parent to be located in
Engine
Engine has fundamental operations to manipulate model and view elements.
new Engine()
Instance Members
▸
addModel(parent, field, model)
Add a model element
Parameters
model (Model)
model element to be added
Returns
Model
:
▸
addViews(diagram, views)
Add view elements.
addViews(diagram: diagram, views:
Array<Core.View>)
Parameters
diagram (diagram)
Diagram where added views to be placed.
views (Array<Core.View>)
Views to be added.
▸
addModelAndView(diagram, model, view, parent, parentField, containerView)
Add a model element and a view element.
Parameters
diagram (Diagram)
Diagram where added views to be placed.
model (Model)
Model element to be added.
view (View)
View element to be added.
parent (Model)
Parent element to contain the model element
parentField (string?)
Array field name of the parent (default = 'ownedElements')
containerView (View?)
Container view where the view element to be contained (optional)
▸
setProperty(elem, field, value)
Set value to a property of an element.
Parameters
▸
setProperties(elem, fieldValueMap)
Set values to multiple properties of an elements.
setProperties(elem:
Element, fieldValueMap: any)
Parameters
▸
setElemsProperty(elems, field, value, views)
Set value to a property of multiple elements
Parameters
▸
deleteElements(models, views)
Delete elements.
Parameters
models (Array<Model>)
Model elements to be deleted.
views (Array<View>)
View elements to be deleted.
▸
addItem(elem, field, val)
Add an item to a particular array field of an element.
Parameters
▸
removeItem(elem, field, val)
Remove an item from a particular array field of an element.
Parameters
▸
moveUp(parent, field, elem)
Reorder an item of array field of an element to index - 1.
Parameters
▸
moveDown(parent, field, elem)
Reorder an item of array field of an element to index + 1.
Parameters
▸
relocate(elem, newOwner, field)
Relocate an element to a new owner (parent).
Parameters
▸
moveViews(editor, views, dx, dy)
▸
moveParasiticView(editor, view, alpha, distance)
Move a parasitic view.
Parameters
▸
resizeNode(editor, node, left, top, right, bottom)
Resize a node view.
Parameters
▸
modifyEdge(editor, edge, points)
Modify points of an edge view.
modifyEdge(editor: Editor, edge:
EdgeView, points: Points)
Parameters
▸
reconnectEdge(editor, edge, points, newParticipant, newParticipantModel, isTailSide)
Reconnect an end (head-side or tail-side) of edge view to new element.
reconnectEdge(editor: Editor, edge:
EdgeView, points: Points, newParticipant:
NodeView, newParticipantModel: any, isTailSide:
boolean)
Parameters
newParticipantModel (any)
▸
moveViewsChangingContainer(editor, views, dx, dy, containerView, containerModel)
Move views by changing their container view.
moveViewsChangingContainer(editor: Editor, views:
Array<
View>, dx:
number, dy:
number, containerView:
View, containerModel: any)
Parameters
▸
setFillColor(editor, views, color)
Change fill color of views.
Parameters
color (string)
(color string in CSS style: e.g. "#ffffff")
▸
setLineColor(editor, views, color)
Change line color of views.
Parameters
color (string)
(color string in CSS style: e.g. "#ffffff")
▸
setFont(editor, views, face, size, color)
Change font of views.
Parameters
face (string)
Font face (family)
size (number)
Font size (in pixel)
▸
setFontColor(editor, views, color)
Change font color of views.
Parameters
color (string)
Font color (color string in CSS style: e.g. "#ffffff")
▸
setFontFace(editor, views, fontFace)
Change font face of views.
Parameters
▸
setFontSize(editor, views, fontSize)
Change font size of views.
Parameters
▸
setStereotypeDisplay(editor, views, stereotypeDisplay)
Change stereotypeDisplay of views.
setStereotypeDisplay(editor: Editor, views:
Array<
View>, stereotypeDisplay:
string)
Parameters
▸
setLineStyle(editor, views, lineStyle)
Change lineStyle of edge views.
Parameters
▸
setAutoResize(editor, views, autoResize)
Change autoResize of node views.
Parameters
▸
layoutDiagram(editor, diagram, direction, separations, edgeLineStyle)
Layout diagram
Parameters
SelectionManager
Selection Manager
new SelectionManager()
Extends
EventEmitter
Instance Members
Return selected model elements.
Returns
Array<Model>
:
Array of selected model elements.
Return selected view elements.
Returns
Array<View>
:
Array of selected view elements.
Deselect all elements.
deselectAll()
Select elements (models and views)
Parameters
models (Array<Model>)
Model elements to be selected.
views (Array<View>)
View elements to be selected.
Select a model element
selectModel(model:
Model)
Parameters
model (Model)
Model element to be selected.
Select view elements
Parameters
views (Array<View>)
Array of view elements to be selected.
Return the first selected model element.
getSelected()
Events
Triggered when selection is changed
selectionChanged
Properties
selectedModels (Array<Model>)
: An array of selected model elements
selectedViews (Array<View>)
: An array of selected view elements
PreferenceManager
PreferenceManager only works in browser (it uses global localStorage object).
new PreferenceManager()
Extends
EventEmitter
Instance Members
Return value of key
Parameters
Returns
Object
:
Change value of key
Parameters
Factory
Factory creates model, view and diagram elements
new Factory()
Extends
EventEmitter
Instance Members
Create a diagram
Parameters
Returns
Diagram
:
Create a model element
Parameters
Returns
Model
:
▸
createModelAndView(options)
Create model and view elements
Parameters
Returns
View
:
Create a view element of a given model based on diagram type
Parameters
▸
createViewAndRelationships(editor, x, y, model, containerView, viewType)
Create a view of a given model with relationship views
Parameters
Events
Triggered when a diagram is created
diagramCreated
Properties
diagram (Diagram)
: The created diagram
Triggered when model and/or view elements are created
elementCreated
Properties
model (Model)
: The created model element
view (View)
: The created view element
Menu Manager
new MenuManager()
Instance Members
Context Menu Manager
new ContextMenuManager()
Instance Members
DiagramManager
Diagram Manager manages working diagrams
new DiagramManager()
Extends
EventEmitter
Instance Members
Open diagram and add to working set
Parameters
Update the diagram.
Parameters
Close the diagram.
Parameters
Save a list of working diagrams of current project.
saveWorkingDiagrams()
▸
restoreWorkingDiagrams()
Restore a list of working diagrams and current diagram of current project.
restoreWorkingDiagrams()
Close all diagrams except active diagram.
closeOthers()
Close all diagrams
closeAll()
▸
setCurrentDiagram(diagram, skipEvent)
Set current diagram.
Parameters
Return current diagram
Returns
Diagram
:
Set next diagram as current diagram
nextDiagram()
Set previous diagram as current diagram
previousDiagram()
Select all view elements.
selectAll()
Deselect all.
deselectAll()
Select view in diagram. Open diagram if diagram is not opened and then scroll to the view.
selectInDiagram(view:
View)
Parameters
Set zoom level
Parameters
value (number)
Zoom level between 0 and 1.
Return zoom level
Returns
number
:
Zoom level between 0 and 1.
Return whether grid is visible.
Returns
boolean
:
Return view size.
getViewportSize(x: Point)
Parameters
x (Point)
is width, y is height.
Return left, top, right, bottom of diagram area with zoom level
getDiagramArea(): Rect
Returns
Rect
:
Events
Triggered when an diagram is open (added to working diagrams)
workingDiagramAdd
Properties
diagram (Diagram)
: The diagram opened
Triggered when an working diagram is updated
workingDiagramUpdate
Properties
diagram (Diagram)
: The diagram updated
Triggered when an working diagram is closed
workingDiagramRemove
Properties
diagram (Diagram)
: The diagram closed
Triggered when current diagram has repainted
repaint
currentDiagramChanged
Properties
Font
Font
new Font(face: any, size: any, style: any)
Parameters
Static Members
Font Style: Normal (0)
FS_NORMAL
Type:
number
Font Style: Bold (1)
FS_BOLD
Type:
number
Font Style: Italic (2)
FS_ITALIC
Type:
number
Font Style: Bold Italic (3)
FS_BOLD_ITALIC
Type:
number
Instance Members
UI Components
User interface components.
DialogManager
DialogManager
new DialogManager()
Instance Members
▸
showTextDialog(message, text)
Show Text Dialog (Multiline Text)
Parameters
Returns
Dialog
:
▸
showSelectRadioDialog(message, options, items)
Show Select Dialog (Radio-type)
Parameters
Returns
Dialog
:
▸
showSelectDropdownDialog(message, options, items)
Show Select Dialog (Dropdown-type)
Parameters
Returns
Dialog
:
Show Color Dialog
Parameters
Returns
Dialog
:
Show Font Dialog
showFontDialog(font: Graphics.Font):
Dialog
Parameters
font (Graphics.Font)
Initial font
Returns
Dialog
:
▸
showSimpleDialog(message)
Show Simple Dialog. This is a synchronous system dialog.
Parameters
Returns
string
:
button id
▸
showConfirmDialog(message)
Show Confirm Dialog. This is a synchronous system dialog.
Parameters
Returns
string
:
button id
▸
showAlertDialog(message)
Show Alert Dialog. This is a synchronous system dialog.
Parameters
Returns
string
:
button id
▸
showInfoDialog(message)
Show Information Dialog. This is a synchronous system dialog.
Parameters
Returns
string
:
button id
▸
showOpenDialog(title, defaultPath, filters, options)
Show Open Dialog. This is a synchronous system dialog.
Parameters
Returns
Array<string>
:
filenames or null
▸
showSaveDialog(title, defaultPath, filters)
Show SaveDialog. This is a synchronous system dialog.
Parameters
Returns
string
:
filename or null
▸
showSaveConfirmDialog(filename)
Show Save Confirmation Dialog. This is a synchronous system dialog.
Parameters
Returns
number
:
dialog modal result
▸
showErrorDialog(message)
Show Error Dialog. This is a synchronous system dialog.
showErrorDialog(message:
string)
Parameters
Dialog
new Dialog($dlg: $.Element, promise:
Promise)
Parameters
$dlg ($.Element)
The dialog jQuery element
promise (Promise)
A promise that will be resolved with the ID of the clicked button when the dialog
is dismissed. Never rejected.
Instance Members
Closes the dialog if is visible
close()
Adds a 'then' callback to the dialog promise
then(callback: function (result: any))
Parameters
callback (function (result: any))
EditorsHolderView
EditorsHolder contains StyleEditorView, PropertyEditorView, and DocumentationEditorView
new EditorsHolderView()
Instance Members
Toggle EditorsHolder
toggle()
Show EditorsHolder
show()
Hide EditorsHolder
hide()
Return whether EditorsHolder is visible or not
Returns
boolean
:
ElementPickerDialog
Element Picker Dialog
new ElementPickerDialog()
Instance Members
▸
expand(elem, expandAllParents)
Expand a tree node
expand(elem: Core.Model, expandAllParents:
boolean?)
Parameters
elem (Core.Model)
Element to be expanded
expandAllParents (boolean?)
Whether expand all parents or not
Select an element
select(elem: Core.Model, scrollTo:
boolean?)
Parameters
elem (Core.Model)
Element to be selected
scrollTo (boolean?)
Whether scroll to the element or not
▸
showDialog(title, selected, type)
Show Element Picker Dialog
Parameters
title (string)
Title of the dialog
selected (Element?)
Initial selected element when the dialog is shown
Returns
Dialog
:
ElementListEditorDialog
Element List Editor Dialog
new ElementListEditorDialog()
Instance Members
▸
showDialog(elem, field)
Show Element List Editor Dialog.
Parameters
field (string)
Array field name to be listed
Returns
Dialog
:
ElementListPickerDialog
Element List Picker Dialog
new ElementListPickerDialog()
Instance Members
▸
showDialog(title, elems)
Show Element List Picker Dialog.
Parameters
elems (Array<Core.Model>)
Returns
Dialog
:
Panel
Represents a panel below the editor area (a child of ".content").
Don'y try to instantiate, use PanelManager.createBottomPanel()
.
new Panel($panel: jQueryObject, minSize:
number)
Parameters
$panel (jQueryObject)
The entire panel, including any chrome, already in the DOM.
minSize (number)
Minimum height of panel in px.
Instance Members
Return whether this panel is visible or not.
Returns
boolean
:
Set the visibility of the panel
Parameters
PanelManager
PanelManager
new PanelManager()
Instance Members
▸
createBottomPanel(id, $panel, minSize)
Creates a new panel beneath the editor area and above the status bar footer. Panel is initially invisible.
Parameters
id (string)
Unique id for this panel. Use package-style naming, e.g. "myextension.feature.panelname"
$panel (jQueryObject)
DOM content to use as the panel. Need not be in the document yet.
minSize (number)
Minimum height of panel in px.
Returns
Panel
:
TagEditorDialog
Tag Editor Dialog
new TagEditorDialog()
Instance Members
Show Tag Editor Dialog.
showDialog(elem: Core.Model):
Dialog
Parameters
elem (Core.Model)
An element
Returns
Dialog
:
TagValueEditorDialog
Tag Value Editor Dialog
new TagValueEditorDialog()
Instance Members
Show Tag Value Editor Dialog.
showDialog(tag: Core.Tag, attr: UMLAttribute):
Dialog
Parameters
tag (Core.Tag)
A tag element
attr (UMLAttribute)
A corresponding Attribute of Stereotype
Returns
Dialog
:
ToastManager
ToastManager
new ToastManager()
Instance Members
Show information toast.
Parameters
Show warning toast.
Parameters
Show error toast.
Parameters
Toolbar
new ToolbarView()
Instance Members
Toolbox View
new ToolboxView()
Extends
EventEmitter
Instance Members
Elements
Element classes constitute a software model.
Element
Element
new Element()
Static Members
Constant for Attribute Kind ('prim'
)
AK_PRIM
Type:
string
Constant for Attribute Kind ('enum'
)
AK_ENUM
Type:
string
Constant for Attribute Kind ('ref'
)
AK_REF
Type:
string
Constant for Attribute Kind ('refs'
)
AK_REFS
Type:
string
Constant for Attribute Kind ('obj'
)
AK_OBJ
Type:
string
Constant for Attribute Kind ('objs'
)
AK_OBJS
Type:
string
Constant for Attribute Kind ('var'
)
AK_VAR
Type:
string
Constant for Attribute Kind ('custom'
)
AK_CUSTOM
Type:
string
Return a super type of a given type.
Parameters
Returns
constructor
:
superType of subType
Return a generalized type of given elements.
Parameters
Returns
constructor
:
▸
getNewName(array, prefix)
Find an available name in a given array. (e.g. Class1, Class2, ... )
Parameters
prefix (string)
Prefix for name
Returns
string
:
Return a new name
▸
mergeProps(elems, prop)
Merge values of a particular property of an array of elements
If all values are same, then return the value. Otherwise, return null.
Parameters
Instance Members
globaly unique identifier
_id
Type:
string
reference to its parent
_parent
Type:
object
Return class name for display (e.g. "Class" rather than "UMLClass").
Returns
string
:
Return Class. (equivalent to type[element.getClassName()])
Returns
constructor
:
Return Class name.
Returns
string
:
Return name of parent's field containing this object.
Returns
string
:
Field name (e.g. 'ownedElements')
Return CSS class name of icon for this object. (Shown in Explorer)
Returns
string
:
iconClass명 (e.g. 'icon-UMLClass')
Return textual string for this object. (Shown in Explorer)
Parameters
Returns
string
:
Text (e.g. '<
>Class1')
Return ordering priority number. (Lower value comes first in Explorer)
Parameters
Returns
Number
:
Return all child nodes to be shown in Explorer.
Parameters
Returns
Array<Element>
:
Traverse all nodes in the tree structure. (Breadth-First Traversal)
traverse(fun: function (elem:
Element))
Parameters
▸
traverseDepthFirst(fun)
Traverse all nodes in the tree structure. (Depth-First Traversal)
traverseDepthFirst(fun: function (elem:
Element))
Parameters
▸
traverseField(field, fun)
Traverse a specific field chains. (Breadth-First Traversal)
Parameters
field (string)
Field name to traverse (e.g. 'ownedElements')
▸
traverseFieldDepthFirst(field, fun)
Traverse a specific field chains. (Depth-First Traversal)
Parameters
field (string)
Field name to traverse (e.g. 'ownedElements')
Traverse up along with the _parent
chain.
Parameters
▸
lookup(name, typeFilter, namespace)
Find an element by name. Find through ownedElements
chain, and then lookup through _parent
chain.
Parameters
namespace (Element)
Lookup only inside of namespace
Returns
Element
:
Return the first matched element.
Find by name in child elements
Parameters
Returns
Element
:
Look down an element along parent-children chains.
Parameters
Returns
Element
:
▸
isOneOfTheContainers(elem)
Return true only if a given elem is one of the container.
Parameters
Returns
boolean
:
Return true only if it can contain the kind of elements
Parameters
Returns
Boolean
:
Return true only if it can contain a given element.
Parameters
Returns
Boolean
:
Return true only if it could be copied.
Returns
Boolean
:
Return true only if it could be deleted alone.
Returns
Boolean
:
Return true only if it could be hidden without deletion.
Returns
Boolean
:
▸
canPaste(kind, copyContext)
Return true only if it can accomodate elements in clipboard
based on a given kind and copyContext.
Parameters
Returns
Boolean
:
Model
Model
new Model()
Extends
Element
Instance Members
Get path to from a given base
Parameters
Returns
Array<string>
:
Return full pathname
Returns
string
:
Return true only if it can contain a given element.
Parameters
Returns
Boolean
:
▸
canContainDiagramKind(kind)
Determines whether a given diagram type name can be contained or not.
Parameters
Returns
Boolean
:
▸
canContainDiagram(diagram)
Determines whether a given diagram can be contained or not.
Parameters
Returns
Boolean
:
Determines whether this object can be relocated to a given element.
Parameters
Returns
Boolean
:
Tag
Tag
new Tag()
Extends
Model
Static Members
TagKind: String ('string'
)
TK_STRING
Type:
string
TagKind: Reference ('reference'
)
TK_REFERENCE
Type:
string
TagKind: Boolean ('boolean'
)
TK_BOOLEAN
Type:
string
TagKind: Number ('number'
)
TK_NUMBER
Type:
string
Instance Members
Hyperlink
Hyperlink
new Hyperlink()
Extends
Model
Instance Members
ExtensibleModel
ExtensibleModel
new ExtensibleModel()
Extends
Model
Instance Members
Return whether element has a specific tag
Parameters
Returns
Boolean
:
Return a specific tag by name
Parameters
Returns
(Tag | undefined)
:
DirectedRelationship
DirectedRelationship
new DirectedRelationship()
Extends
Relationship
Instance Members
RelationshipEnd
RelationshipEnd
new RelationshipEnd()
Extends
ExtensibleModel
Instance Members
UndirectedRelationship
UndirectedRelationship
new UndirectedRelationship()
Extends
Relationship
Instance Members
View
View
new View()
Extends
Element
Static Members
Constant for Selectable Kind
SK_NO
Type:
number
Constant for Selectable Kind
SK_YES
Type:
number
Constant for Selectable Kind
SK_PROPAGATE
Type:
number
Instance Members
Traverse all sub views recursively (Breadth-First Traversal)
Parameters
▸
traverseDepthFirst(fun)
Traverse all sub views recursively (Depth-First Traversal)
Parameters
Return a diagram containg this view object.
Returns
View
:
NodeView
NodeView
new NodeView()
Extends
View
Static Members
Sizing Mode: None (0)
SZ_NONE
Type:
number
Sizing Mode: Horizontal (1)
SZ_HORZ
Type:
number
Sizing Mode: Vertical (2)
SZ_VERT
Type:
number
Sizing Mode: Ratio (3)
SZ_RATIO
Type:
number
Sizing Mode: Free (4)
SZ_FREE
Type:
number
Move Mode: None (0)
MM_NONE
Type:
number
Move Mode: Horizontal (1)
MM_HORZ
Type:
number
Move Mode: Vertical (2)
MM_VERT
Type:
number
Move Mode: Free (3)
MM_FREE
Type:
number
Instance Members
setRight(value: any)
Parameters
setBottom(value: any)
Parameters
EdgeView
EdgeView
new EdgeView()
Extends
View
Static Members
Line Mode: Solid (0)
LM_SOLID
Type:
number
Line Mode: Dot (1)
LM_DOT
Type:
number
Line Mode: Dash (2)
LM_DASH
Type:
number
Line Style: Rectilinear (0)
LS_RECTILINEAR
Type:
number
Line Style: Oblique (1)
LS_OBLIQUE
Type:
number
Line Style: RoundRect (2)
LS_ROUNDRECT
Type:
number
Line Style: Curve (3)
LS_CURVE
Type:
number
Line Style: Direct (4)
LS_DIRECT
Type:
number
Line End Style: Flat (0)
ES_FLAT
Type:
number
Line End Style: Stick Arrow (1)
ES_STICK_ARROW
Type:
number
Line End Style: Solid Arrow (2)
ES_SOLID_ARROW
Type:
number
Line End Style: Triangle (3)
ES_TRIANGLE
Type:
number
Line End Style: Filled Triangle (4)
ES_FILLED_TRIANGLE
Type:
number
Line End Style: Diamond (5)
ES_DIAMOND
Type:
number
Line End Style: Filled Diamond (6)
ES_FILLED_DIAMOND
Type:
number
Line End Style: Arrow Diamond (7)
ES_ARROW_DIAMOND
Type:
number
▸
ES_ARROW_FILLED_DIAMOND
Line End Style: Arrow Filled Diamond (8)
ES_ARROW_FILLED_DIAMOND
Type:
number
Line End Style: Plus (9)
ES_PLUS
Type:
number
Line End Style: Circle (10)
ES_CIRCLE
Type:
number
Line End Style: Circle Plus (11)
ES_CIRCLE_PLUS
Type:
number
Instance Members
LabelView
LabelView
new LabelView()
Extends
NodeView
Static Members
Direction Kind: Horizontal (0)
DK_HORZ
Type:
number
Direction Kind: Vertical (1)
DK_VERT
Type:
number
Instance Members
horizontalAlignment
Type:
number
verticalAlignment
Type:
number
ParasiticView
ParasiticView
new ParasiticView()
Extends
NodeView
Instance Members
NodeParasiticView
NodeParasiticView
new NodeParasiticView()
Extends
ParasiticView
Instance Members
EdgeParasiticView
EdgeParasiticView
new EdgeParasiticView()
Extends
ParasiticView
Static Members
Edge Position: Head (0)
EP_HEAD
Type:
number
Edge Position: Middle (1)
EP_MIDDLE
Type:
number
Edge Position: Tail (2)
EP_TAIL
Type:
number
Instance Members
NodeLabelView
NodeLabelView
new NodeLabelView()
Extends
NodeParasiticView
Instance Members
EdgeLabelView
EdgeLabelView
new EdgeLabelView()
Extends
EdgeParasiticView
Instance Members
Diagram
Diagram
new Diagram()
Extends
ExtensibleModel
Static Members
Diagram Layout Direction: Top to Bottom ('TB'
)
LD_TB
Type:
string
Diagram Layout Direction: Bottom to Top ('BT'
)
LD_BT
Type:
string
Diagram Layout Direction: Left to Right ('LR'
)
LD_LR
Type:
string
Diagram Layout Direction: Right to Left ('RL'
)
LD_RL
Type:
string
Instance Members
▸
getViewOf(model, viewType)
Get a view of a specific model
Parameters
Returns
View
:
FreelineEdgeView
FreelineEdgeView
new FreelineEdgeView()
Extends
EdgeView
Unique token used to indicate user-driven cancellation of Save As (as opposed to file IO error)