2014-03-18 16:01:24 +00:00
|
|
|
var Diagram = require('diagram-js');
|
2014-03-20 15:18:23 +00:00
|
|
|
|
|
|
|
var bpmnModule = require('./di').defaultModule,
|
|
|
|
Viewer = require('./Viewer');
|
|
|
|
|
|
|
|
require('./draw/BpmnRenderer');
|
2014-03-18 16:01:24 +00:00
|
|
|
|
2014-04-03 09:47:26 +00:00
|
|
|
require('diagram-js/lib/features/dnd/Visuals');
|
|
|
|
require('diagram-js/lib/features/selection/Visuals');
|
2014-03-18 16:01:24 +00:00
|
|
|
|
2014-03-20 15:18:23 +00:00
|
|
|
|
2014-04-08 13:23:52 +00:00
|
|
|
/**
|
|
|
|
* @class
|
|
|
|
*
|
|
|
|
* A modeler for BPMN 2.0 diagrams.
|
|
|
|
*
|
|
|
|
* @borrows Viewer as Modeler
|
|
|
|
*/
|
2014-04-04 16:48:37 +00:00
|
|
|
function Modeler(options) {
|
|
|
|
Viewer.call(this, options);
|
2014-03-18 16:01:24 +00:00
|
|
|
}
|
|
|
|
|
2014-04-04 16:48:37 +00:00
|
|
|
Modeler.prototype = Object.create(Viewer.prototype);
|
2014-03-18 16:01:24 +00:00
|
|
|
|
|
|
|
Modeler.prototype.createDiagram = function() {
|
2014-03-20 15:18:23 +00:00
|
|
|
|
|
|
|
return new Diagram({
|
|
|
|
canvas: { container: this.container },
|
|
|
|
modules: [ bpmnModule ],
|
2014-04-09 08:50:20 +00:00
|
|
|
components: [ 'selectionVisuals', 'dragVisuals' ]
|
2014-03-20 15:18:23 +00:00
|
|
|
});
|
2014-03-18 16:01:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Modeler;
|