feat(modeling): inherit default handlers

This commit is contained in:
Nico Rehwaldt 2015-01-06 16:28:39 +01:00
parent 41df1f378b
commit 39d5fa2e9c
1 changed files with 5 additions and 33 deletions

View File

@ -4,23 +4,7 @@ var _ = require('lodash');
var BaseModeling = require('diagram-js/lib/features/modeling/Modeling'); var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
var CreateShapeHandler = require('diagram-js/lib/features/modeling/cmd/CreateShapeHandler'), var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler');
DeleteShapeHandler = require('diagram-js/lib/features/modeling/cmd/DeleteShapeHandler'),
MoveShapeHandler = require('diagram-js/lib/features/modeling/cmd/MoveShapeHandler'),
MoveShapesHandler = require('diagram-js/lib/features/modeling/cmd/MoveShapesHandler'),
ResizeShapeHandler = require('diagram-js/lib/features/modeling/cmd/ResizeShapeHandler'),
UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
AppendShapeHandler = require('diagram-js/lib/features/modeling/cmd/AppendShapeHandler'),
CreateLabelHandler = require('diagram-js/lib/features/modeling/cmd/CreateLabelHandler'),
CreateConnectionHandler = require('diagram-js/lib/features/modeling/cmd/CreateConnectionHandler'),
DeleteConnectionHandler = require('diagram-js/lib/features/modeling/cmd/DeleteConnectionHandler'),
MoveConnectionHandler = require('diagram-js/lib/features/modeling/cmd/MoveConnectionHandler'),
LayoutConnectionHandler = require('diagram-js/lib/features/modeling/cmd/LayoutConnectionHandler');
/** /**
* BPMN 2.0 modeling features activator * BPMN 2.0 modeling features activator
@ -39,24 +23,12 @@ Modeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack' ];
module.exports = Modeling; module.exports = Modeling;
Modeling.prototype.getHandlers = function() {
var handlers = BaseModeling.prototype.getHandlers.call(this);
Modeling.prototype.registerHandlers = function(commandStack) { handlers['element.updateProperties'] = UpdatePropertiesHandler;
commandStack.registerHandler('shape.create', CreateShapeHandler);
commandStack.registerHandler('shape.delete', DeleteShapeHandler);
commandStack.registerHandler('shape.move', MoveShapeHandler);
commandStack.registerHandler('shapes.move', MoveShapesHandler);
commandStack.registerHandler('shape.resize', ResizeShapeHandler);
commandStack.registerHandler('shape.append', AppendShapeHandler); return handlers;
commandStack.registerHandler('label.create', CreateLabelHandler);
commandStack.registerHandler('element.updateProperties', UpdatePropertiesHandler);
commandStack.registerHandler('connection.create', CreateConnectionHandler);
commandStack.registerHandler('connection.delete', DeleteConnectionHandler);
commandStack.registerHandler('connection.move', MoveConnectionHandler);
commandStack.registerHandler('connection.layout', LayoutConnectionHandler);
}; };