If you want to create nodes and/or links on the view,
you have to set the editable mode on the view component as follows:
<jvdf:diagramerView id="thediagrammer" editable="true" [...] />
For example, by calling the following extract of JavaScriptâ„¢
in
response to a user action, an interactor is set on the view. This
interactor allows you to create a link with the thetag
tag
in the JViews Diagrammer model attached to the view.
thediagrammer.setCreateLinkInteractor("thetag", true);
When the second parameter is set to true
,
the create
action is available only once.
If you want to have the interactor available permanently, you can
ignore that parameter.
Similarly, you can set a node creation interactor:
thediagrammer.setCreateNodeInteractor("anothertag", true);
In addition to the tag name, the interactor can be configured
to set some initial properties on the selected object at creation
time:
var properties = {propertyName1: "propertyValue1", propertyName2: "propertyValue2"};
thediagrammer.setCreateNodeInteractor("anothertag", true, properties);