Add Free position integration...
This commit is contained in:
@@ -24,7 +24,6 @@ mindplot.EventBus = new Class({
|
||||
mindplot.EventBus.events = {
|
||||
NodeResizeEvent:'NodeResizeEvent',
|
||||
NodeMoveEvent:'NodeMoveEvent',
|
||||
NodeRepositionateEvent:'NodeRepositionateEvent',
|
||||
NodeShrinkEvent:'NodeShrinkEvent',
|
||||
NodeConnectEvent:'NodeConnectEvent',
|
||||
NodeDisconnectEvent:'NodeDisconnectEvent',
|
||||
|
@@ -39,7 +39,6 @@ mindplot.layout.EventBusDispatcher = new Class({
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMoveEvent, this._nodeMoveEvent.bind(this));
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeDisconnectEvent, this._nodeDisconnectEvent.bind(this));
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeConnectEvent, this._nodeConnectEvent.bind(this));
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeRepositionateEvent, this._nodeRepositionateEvent.bind(this));
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeShrinkEvent, this._nodeShrinkEvent.bind(this));
|
||||
mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.DoLayout, this._doLayout.bind(this));
|
||||
},
|
||||
@@ -48,9 +47,8 @@ mindplot.layout.EventBusDispatcher = new Class({
|
||||
this._layoutManager.updateNodeSize(args.node.getId(), args.size);
|
||||
},
|
||||
|
||||
_nodeMoveEvent: function(node) {
|
||||
console.log("mindplot.layout.EventBusDispatcher._nodeMoveEvent: Not Implemented yet");
|
||||
|
||||
_nodeMoveEvent: function(args) {
|
||||
this._layoutManager.moveNode(args.node.getId(), args.position);
|
||||
},
|
||||
|
||||
_nodeDisconnectEvent: function(node) {
|
||||
@@ -62,11 +60,6 @@ mindplot.layout.EventBusDispatcher = new Class({
|
||||
|
||||
},
|
||||
|
||||
_nodeRepositionateEvent: function(node) {
|
||||
console.log("mindplot.layout.EventBusDispatcher._nodeRepositionateEvent: Not Implemented yet");
|
||||
|
||||
},
|
||||
|
||||
_nodeShrinkEvent: function(node) {
|
||||
this._layoutManager.updateShrinkState(node.getId(), node.areChildrenShrunken());
|
||||
},
|
||||
|
@@ -51,7 +51,7 @@ mindplot.layout.LayoutManager = new Class({
|
||||
return this._treeSet.find(id);
|
||||
},
|
||||
|
||||
move: function(id, position) {
|
||||
moveNode: function(id, position) {
|
||||
$assert($defined(id), "id cannot be null");
|
||||
$assert($defined(position), "position cannot be null");
|
||||
$assert($defined(position.x), "x can not be null");
|
||||
|
@@ -168,8 +168,8 @@ mindplot.layout.Node = new Class({
|
||||
},
|
||||
|
||||
getVertex: function() {
|
||||
var a = {x: this.getPosition().x - this.getSize().width/2, y:this.getPosition().y - this.getSize().height/2};
|
||||
var b = {x: this.getPosition().x + this.getSize().width/2, y:this.getPosition().y + this.getSize().height/2};
|
||||
var a = {x: this.getPosition().x - this.getSize().width / 2, y:this.getPosition().y - this.getSize().height / 2};
|
||||
var b = {x: this.getPosition().x + this.getSize().width / 2, y:this.getPosition().y + this.getSize().height / 2};
|
||||
return {a:a, b:b};
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user