feat(modeling): implement create via palette/context-pad

Related to #137
This commit is contained in:
Nico Rehwaldt
2014-12-07 13:08:50 +01:00
parent 982033074b
commit 6041717c6c
11 changed files with 234 additions and 226 deletions

View File

@ -24,15 +24,16 @@ var CreateShapeHandler = require('diagram-js/lib/features/modeling/cmd/CreateSha
* BPMN 2.0 modeling features activator
*
* @param {EventBus} eventBus
* @param {ElementFactory} elementFactory
* @param {CommandStack} commandStack
*/
function Modeling(eventBus, commandStack) {
BaseModeling.call(this, eventBus, commandStack);
function Modeling(eventBus, elementFactory, commandStack) {
BaseModeling.call(this, eventBus, elementFactory, commandStack);
}
Modeling.prototype = Object.create(BaseModeling.prototype);
Modeling.$inject = [ 'eventBus', 'commandStack' ];
Modeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack' ];
module.exports = Modeling;
@ -63,30 +64,6 @@ Modeling.prototype.updateLabel = function(element, newLabel) {
};
/**
* Append a flow node to the element with the given source
* at the specified position.
*/
Modeling.prototype.appendFlowNode = function(source, type, position) {
position = position || {
x: source.x + source.width + 100,
y: source.y + source.height / 2
};
return this.appendShape(source, { type: type }, position, null, { attrs: { type: 'bpmn:SequenceFlow' } });
};
Modeling.prototype.appendTextAnnotation = function(source, type, position) {
position = position || {
x: source.x + source.width / 2 + 75,
y: source.y - (source.height / 2) - 100
};
return this.appendShape(source, { type: type }, position, null, { attrs: { type: 'bpmn:Association' } });
};
Modeling.prototype.connect = function(source, target, attrs) {
var sourceBo = source.businessObject,