From ae9f05dd05337b074c9e67514b72cd2b4df57da9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 7 Mar 2012 20:35:06 -0300 Subject: [PATCH] Use FX class for delete node events. --- core-js/src/main/javascript/Utils.js | 70 ---------------- mindplot/pom.xml | 1 + .../javascript/StandaloneActionDispatcher.js | 3 +- mindplot/src/main/javascript/Topic.js | 32 +++++++- .../javascript/commands/AddTopicCommand.js | 80 ++++++++----------- .../javascript/layout/EventBusDispatcher.js | 2 +- .../src/main/javascript/util/FadeEffect.js | 50 ++++++++++++ web2d/src/main/javascript/Group.js | 5 ++ .../src/main/javascript/peer/svg/GroupPeer.js | 4 + wise-editor/src/main/webapp/html/editor.html | 38 ++++----- 10 files changed, 143 insertions(+), 142 deletions(-) create mode 100644 mindplot/src/main/javascript/util/FadeEffect.js diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js index 9c1f9651..ff870beb 100644 --- a/core-js/src/main/javascript/Utils.js +++ b/core-js/src/main/javascript/Utils.js @@ -140,57 +140,6 @@ core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos) { return [new core.Point(-srcPos.x + x1, -srcPos.y + y1),new core.Point(-tarPos.x + x2, -tarPos.y + y2)]; }; -core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn) { - core.Utils.animateVisibility(elems, isVisible, doneFn); -}; - -core.Utils.setChildrenVisibilityAnimated = function(rootElem, isVisible) { - var children = core.Utils.flattenTopicChildElements(rootElem); - core.Utils.animateVisibility(children, isVisible); -}; - -core.Utils.animateVisibility = function (elems, isVisible, doneFn) { - var _fadeEffect = null; - var _opacity = (isVisible ? 0 : 1); - if (isVisible) { - elems.forEach(function(child) { - if ($defined(child)) { - child.setOpacity(_opacity); - child.setVisibility(isVisible ? "visible" : "hidden"); - } - }); - } - var fadeEffect = function() { - var step = 10; - if ((_opacity <= 0 && !isVisible) || (_opacity >= 1 && isVisible)) { - $clear(_fadeEffect); - _fadeEffect = null; - elems.forEach(function(child) { - if ($defined(child)) { - child.setVisibility(isVisible ? "visible" : "hidden"); - } - - }); - if ($defined(doneFn)) - doneFn.attempt(); - } - else { - var fix = 1; - if (isVisible) { - fix = -1; - } - _opacity -= (1 / step) * fix; - elems.forEach(function(child) { - if ($defined(child)) { - child.setOpacity(_opacity); - } - }); - } - - }; - _fadeEffect = fadeEffect.periodical(10); -}; - core.Utils.animatePosition = function (elems, doneFn, designer) { var _moveEffect = null; var i = 10; @@ -231,22 +180,3 @@ core.Utils.animatePosition = function (elems, doneFn, designer) { }; _moveEffect = moveEffect.periodical(10); }; - -core.Utils.flattenTopicChildElements = function(topic) { - var result = []; - - var children = topic.getChildren(); - for (var i = 0; i < children.length; i++) { - - var child = children[i]; - result.push(child); - result.push(child.getOutgoingLine()); - - var relationships = child.getRelationships(); - result = result.concat(relationships); - - var innerChilds = core.Utils.flattenTopicChildElements(child); - result = result.concat(innerChilds); - } - return result; -}; \ No newline at end of file diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 2c29a931..dab5bd3c 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -81,6 +81,7 @@ + WiseMapping - Editor - + + + + + ---> - var options = {imageUrl:"images/logo-small.png", - imageWidth:80, - imageHeight:43, - metadata: "{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}" - }; - designer.addDraggedNode(event, options); - }); - --->