Fix flicker.

Remove more code.
This commit is contained in:
Paulo Veiga
2011-08-29 20:10:05 -03:00
parent d94414775e
commit c74d2de32d
11 changed files with 83 additions and 155 deletions

View File

@@ -82,7 +82,6 @@
<filelist dir="${basedir}/src/main/javascript/" files="TextEditorFactory.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="VariableDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="util/Shape.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="util/Converter.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="FixedDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="BoardEntry.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ModelCodeName.js"/>

View File

@@ -88,7 +88,7 @@ mindplot.RelationshipLine = new Class({
this._positionateConnector(targetTopic);
if (this.isOnFocus()) {
this._refreshSelectedShape();
this._refreshShape();
}
this._focusShape.moveToBack();
this._controlPointsController.redraw();
@@ -149,17 +149,19 @@ mindplot.RelationshipLine = new Class({
setOnFocus : function(focus) {
// Change focus shape
if (focus) {
this._refreshSelectedShape();
this._controlPointsController.setLine(this);
}
this._focusShape.setVisibility(focus);
if (this.isOnFocus() != focus) {
if (focus) {
this._refreshShape();
this._controlPointsController.setLine(this);
}
this._focusShape.setVisibility(focus);
this._controlPointsController.setVisibility(focus);
this._onFocus = focus;
this._controlPointsController.setVisibility(focus);
this._onFocus = focus;
}
},
_refreshSelectedShape : function () {
_refreshShape : function () {
var sPos = this._line2d.getFrom();
var tPos = this._line2d.getTo();
var ctrlPoints = this._line2d.getControlPoints();
@@ -171,8 +173,6 @@ mindplot.RelationshipLine = new Class({
shapeCtrlPoints[1].x = ctrlPoints[1].x;
shapeCtrlPoints[1].y = ctrlPoints[1].y;
this._focusShape.updateLine();
//this._focusShape.setSrcControlPoint(ctrlPoints[0]);
//this._focusShape.setDestControlPoint(ctrlPoints[1]);
},
addEvent : function(type, listener) {

View File

@@ -28,8 +28,10 @@ mindplot.ScreenManager = new Class({
event.stopPropagation()
});
// @Todo: This must be resolved in other way ...
mindplot.util.Converter.setScreenManager(this);
this._divContainer.addEvent('dblclick', function(event) {
event.stopPropagation() ;
event.preventDefault();
});
},
setScale : function(scale) {
@@ -62,9 +64,9 @@ mindplot.ScreenManager = new Class({
}
},
getWorkspaceElementPosition : function(e) {
_getElementPosition : function(elem) {
// Retrieve current element position.
var elementPosition = e.getPosition();
var elementPosition = elem.getPosition();
var x = elementPosition.x;
var y = elementPosition.y;
@@ -105,10 +107,9 @@ mindplot.ScreenManager = new Class({
//Retrieve topic Position
var topic = iconGroup.getTopic();
var topicPosition = this.getWorkspaceElementPosition(topic);
var topicPosition = this._getElementPosition(topic);
topicPosition.x = topicPosition.x - (parseInt(topic.getSize().width) / 2);
// Remove decimal part..
return {x:x + topicPosition.x,y:y + topicPosition.y};
},

View File

@@ -47,8 +47,9 @@ mindplot.commands.AddTopicCommand = new Class(
if (this._animated) {
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()], true, doneFn);
} else
} else {
doneFn.attempt();
}
},
undoExecute: function(commandContext) {

View File

@@ -57,7 +57,7 @@ mindplot.commands.MoveControlPointCommand = new Class({
break;
}
if (this._line.isOnFocus()) {
this._line._refreshSelectedShape();
this._line._refreshShape();
this._ctrlPointControler.setLine(this._line);
}
this._line.getLine().updateLine(this._point);
@@ -86,7 +86,7 @@ mindplot.commands.MoveControlPointCommand = new Class({
this._line.getLine().updateLine(this._point);
if (this._line.isOnFocus()) {
this._ctrlPointControler.setLine(line);
line._refreshSelectedShape();
line._refreshShape();
}
}
});

View File

@@ -1,31 +0,0 @@
/*
* Copyright [2011] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
mindplot.util.Converter = {
topicToScreenPosition : function(topic) {
$assert(topic, "topic is not defined");
$assert(this._screenManager, "screenManager is not defined");
return this._screenManager.getWorkspaceElementPosition(topic);
}
};
mindplot.util.Converter.setScreenManager = function(instance) {
this._screenManager = instance;
};