From 707e1864ef0f5d7118d85cd79992cc9c0b664b7f Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sun, 9 Oct 2011 18:14:28 -0300 Subject: [PATCH] Minor fixes. --- mindplot/src/main/javascript/ControlPoint.js | 9 +++++++-- mindplot/src/main/javascript/RelationshipLine.js | 4 +++- .../main/javascript/commands/MoveControlPointCommand.js | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mindplot/src/main/javascript/ControlPoint.js b/mindplot/src/main/javascript/ControlPoint.js index 41c2d981..446bcba3 100644 --- a/mindplot/src/main/javascript/ControlPoint.js +++ b/mindplot/src/main/javascript/ControlPoint.js @@ -18,8 +18,13 @@ mindplot.ControlPoint = new Class({ initialize:function() { - this._controlPointsController = [new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false}), - new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false})]; + var control1 = new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false}); + control1.setCursor('pointer'); + + var control2 = new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false}); + control2.setCursor('pointer'); + + this._controlPointsController = [control1,control2]; this._controlLines = [new web2d.Line({strokeColor:"#6589de", strokeWidth:1, opacity:0.3}), new web2d.Line({strokeColor:"#6589de", strokeWidth:1, opacity:0.3})]; diff --git a/mindplot/src/main/javascript/RelationshipLine.js b/mindplot/src/main/javascript/RelationshipLine.js index c4882c28..94246292 100644 --- a/mindplot/src/main/javascript/RelationshipLine.js +++ b/mindplot/src/main/javascript/RelationshipLine.js @@ -22,7 +22,6 @@ mindplot.RelationshipLine = new Class({ this._line2d.setIsSrcControlPointCustom(false); this._line2d.setIsDestControlPointCustom(false); - this._isOnfocus = false; this._focusShape = this._createLine(this.getLineType(), mindplot.ConnectionLine.SIMPLE_CURVED); this._focusShape.setStroke(2, "solid", "#3f96ff"); var ctrlPoints = this._line2d.getControlPoints(); @@ -70,6 +69,7 @@ mindplot.RelationshipLine = new Class({ var spoint = new core.Point(); spoint.x = parseInt(ctrlPoints[0].x) + parseInt(sourcePosition.x); spoint.y = parseInt(ctrlPoints[0].y) + parseInt(sourcePosition.y); + var tpoint = new core.Point(); tpoint.x = parseInt(ctrlPoints[1].x) + parseInt(targetPosition.x); tpoint.y = parseInt(ctrlPoints[1].y) + parseInt(targetPosition.y); @@ -160,6 +160,8 @@ mindplot.RelationshipLine = new Class({ this._controlPointsController.setVisibility(focus); this._onFocus = focus; + this._line2d.setCursor(this.isOnFocus() ? 'default' : 'pointer'); + } }, diff --git a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js b/mindplot/src/main/javascript/commands/MoveControlPointCommand.js index 1bce65a8..d640dfd4 100644 --- a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js +++ b/mindplot/src/main/javascript/commands/MoveControlPointCommand.js @@ -19,7 +19,7 @@ mindplot.commands.MoveControlPointCommand = new Class({ Extends:mindplot.Command, initialize: function(ctrlPointController, point) { $assert(ctrlPointController, 'line can not be null'); - $assert(point, 'point can not be null'); + $assert($defined(point), 'point can not be null'); this._ctrlPointControler = ctrlPointController; this._line = ctrlPointController._line; @@ -39,6 +39,7 @@ mindplot.commands.MoveControlPointCommand = new Class({ this._id = mindplot.Command._nextUUID(); this._point = point; }, + execute: function(commandContext) { var model = this._line.getModel(); switch (this._point) { @@ -62,6 +63,7 @@ mindplot.commands.MoveControlPointCommand = new Class({ } this._line.getLine().updateLine(this._point); }, + undoExecute: function(commandContext) { var line = this._line; var model = line.getModel();