1 /** 2 * Object that is used to undo actions when a jagged connector changes its path 3 * @this {ConnectorHandleCommand} 4 * @constructor 5 * @param property {Null} 6 * @param previousValue {Array} of turning points 7 * @param currentValue {Array} of turning points 8 */ 9 function ConnectorHandleCommand(objectId, typeOfObject, property, previousValue, currentValue){ 10 this.objectId = objectId; 11 this.typeOfObject = typeOfObject; 12 this.property = property; 13 this.previousValue = previousValue; 14 this.currentValue = currentValue; 15 this.oType = "Connector Handle Action"; 16 } 17 18 ConnectorHandleCommand.prototype = { 19 /**This method got called every time the Command must execute*/ 20 redo : function(){ 21 this._doAction(this.currentValue); 22 }, 23 24 25 /**This method should be called every time the Command should be undone*/ 26 undo : function(){ 27 this._doAction(this.previousValue); 28 }, 29 30 _doAction:function(value){ 31 CONNECTOR_MANAGER.connectorGetById(this.objectId).turningPoints = value; 32 } 33 } 34