From d07fefa27741f571de4fa5d5ff94226e1e7e0392 Mon Sep 17 00:00:00 2001 From: "seongwon.shim" Date: Thu, 29 May 2014 18:45:31 +0900 Subject: [PATCH] ANIMATOR : Bug fix for change page Create AnimatorEditPart when page added Change-Id: I71424e315edbd7392d3fe513964de294daefd9b6 Signed-off-by: seongwon.shim --- .../AnimationCreateAndChangeFrameCommand.java | 47 ------------------ .../gef/command/AnimationCreateCommand.java | 42 ---------------- .../command/AnimationPathCurveCreateCommand.java | 34 +------------ .../gef/command/AnimationPathMoveCommand.java | 38 --------------- .../command/AnimationPropertyChangeCommand.java | 29 ----------- .../animator/model/AnimatorKeyframe.java | 12 +++++ .../animator/model/AnimatorSelector.java | 35 ++++++++++++++ .../animator/model/io/AnimatorFileWriter.java | 2 +- .../command/TimelineFrameCreateCommand.java | 56 ---------------------- .../command/TimelineFrameDeleteCommand.java | 40 ---------------- .../timeline/command/TimelineFrameEditCommand.java | 32 ------------- .../command/TimelineKeyframeDeleteCommand.java | 25 ---------- .../command/TimelineKeyframeEditCommand.java | 38 --------------- .../tizen/webuibuilder/ui/editor/PageDesigner.java | 2 + 14 files changed, 51 insertions(+), 381 deletions(-) diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateAndChangeFrameCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateAndChangeFrameCommand.java index 5cd2b13..cac83c4 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateAndChangeFrameCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateAndChangeFrameCommand.java @@ -134,45 +134,6 @@ public class AnimationCreateAndChangeFrameCommand extends Command { } else { animatorModelManager.fireEvent(true, currentSelector, AnimatorModelEvent.EventType.FRAME_EDIT, origin, frame); } - - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// if(oldSelector == null || newSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// AnimatorFrame frame = currentSelector.getAnimatorFrameByCurrentTime(currentTime); -// if(frame == null) { -// frame = currentSelector.createAnimatorFrame(currentTime); -// } -// -// if (frame != null) { -// AnimatorKeyframe currentKeyframe = (AnimatorKeyframe)frame.getParent(); -// AnimatorKeyframe previousParent = (AnimatorKeyframe) currentSelector.getPrevChild(currentKeyframe); -// int keyframeChildrenSize = currentKeyframe.getChildrenSize(); -// if (keyframeChildrenSize == 1) { -// if (currentKeyframe.getChildIndex(frame) == 0) { -// if (previousParent != null) { -// if(previousParent.getChildrenSize() == 1) { -// AnimatorFrame previousFrame = previousParent.getLastFrame(); -// previousFrame.addComputedPropertiesIfNotExist(properties.keySet()); -// } -// } -// } -// } -// -// frame.addOrEditProperties(properties); -// frame.setPredefined(false); -// currentSelector.mergeOrSplitKeyframe(); -// currentSelector.updateSelectorTime(); -// newSelector = currentSelector.cloneAnimatorSelector(); -// } -// } else { -// currentSelector.replaceAll(newSelector); -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, origin, currentSelector); } /* @@ -192,14 +153,6 @@ public class AnimationCreateAndChangeFrameCommand extends Command { */ @Override public void undo() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// currentSelector.replaceAll(oldSelector); -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, origin, currentSelector); - - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); if (frame != null) { AnimatorKeyframe keyframe = (AnimatorKeyframe)frame.getParent(); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateCommand.java index 7f29eef..8c688c8 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationCreateCommand.java @@ -88,35 +88,6 @@ public class AnimationCreateCommand extends Command { */ @Override public void execute() { - -// AnimatorModelManager animatorModelManager = appManager.getAnimatorModelManager(); -// -// if(newSelector == null || oldSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// List frames = animatorModelManager.getPredefinedAnimationFactory() -// .createPredefinedFrames(preDefinedAnimationDescriptor, delay); -// -// AnimatorKeyframe keyframe = currentSelector.createKeyframe(preDefinedAnimationDescriptor.getDisplayName(), delay); -// if (keyframe != null) { -// for (AnimatorFrame frame : frames) { -// keyframe.addChild(frame, false); -// } -// currentSelector.addChild(keyframe); -// currentSelector.updateSelectorTime(); -// -// currentSelector.mergeOrSplitKeyframe(); -// currentSelector.updateSelectorTime(); -// newSelector = currentSelector.cloneAnimatorSelector(); -// } -// } else { -// currentSelector.replaceAll(newSelector); -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, origin, currentSelector); - - AnimatorModelManager animatorModelManager = appManager.getAnimatorModelManager(); AnimatorKeyframe keyframe = null; if(frames == null) { @@ -149,12 +120,6 @@ public class AnimationCreateCommand extends Command { oldSelector = currentSelector.cloneAnimatorSelector(animatorModelManager.getModelFactory(), false); } isMerged = currentSelector.mergeOrSplitKeyframe(animatorModelManager.getModelFactory(), removedKeyframes); -// if(!isMerged) { -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe); -// } else { -// animatorModelManager.fireEvent(AnimatorModelEvent.EventType.KEYFRAME_ADD, origin, keyframe); -// } } /* @@ -174,13 +139,6 @@ public class AnimationCreateCommand extends Command { */ @Override public void undo() { -// AnimatorModelManager animatorModelManager = appManager.getAnimatorModelManager(); -// -// currentSelector.replaceAll(oldSelector); -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, origin, currentSelector); - - AnimatorModelManager animatorModelManager = appManager.getAnimatorModelManager(); if(isMerged) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathCurveCreateCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathCurveCreateCommand.java index 9d38df3..b6ccf0a 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathCurveCreateCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathCurveCreateCommand.java @@ -32,32 +32,7 @@ import org.tizen.webuibuilder.animator.utils.AnimatorUtils; */ public class AnimationPathCurveCreateCommand extends AnimationPathCommand { - public void execute() { -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// currentSelector = getModel().getSelector(); -// if(currentSelector != null) { -// if(oldSelector == null || newSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -//// getModel().updateAnimationPathKeyframe(); -// -// AnimationPathCurve curve = getModel().getCurve(getIndex(), getCurveIndex()); -// if(curve != null) { -// getModel().insertCurveToModel(animatorModelManager.getModelFactory(), getIndex(), getCurveIndex(), -// curve); -// } -// super.execute(); -// -// newSelector = currentSelector.cloneAnimatorSelector(); -// } else { -// currentSelector.replaceAll(newSelector); -// } -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.EDITOR, currentSelector); - + public void execute() { AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); AnimationPathCurve curve = getModel().getCurve(getIndex(), getCurveIndex()); @@ -70,13 +45,6 @@ public class AnimationPathCurveCreateCommand extends AnimationPathCommand { } public void undo() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// currentSelector.replaceAll(oldSelector); -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.EDITOR, currentSelector); - getModel().deleteCurveToModel(getIndex(), getCurveIndex()); super.undo(); } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathMoveCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathMoveCommand.java index b963552..2577705 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathMoveCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPathMoveCommand.java @@ -42,36 +42,6 @@ public class AnimationPathMoveCommand extends AnimationPathCommand { private Queue removedKeyframes = new LinkedList(); public void execute() { -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// currentSelector = getModel().getSelector(); -// if(currentSelector != null) { -// if(newSelector == null || oldSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -//// getModel().updateAnimationPathKeyframe(); -// -// if (getCurveIndex() == null) { -// Point p = getLocation(); -// setOldPoint(getModel().getKeyFrameLocationFromModel(getIndex())); -// getModel().setKeyFrameToModel(getIndex(), p.x, p.y); -// } else { -// setOldCurve(getModel().getCurveFromModel(getIndex(), getCurveIndex())); -// AnimationPathCurve curve = getModel().getCurve(getIndex(), getCurveIndex()); -// if(curve != null) { -// getModel().setCurveToModel(getIndex(), getCurveIndex(), curve); -// } -// } -// super.execute(); -// currentSelector.updateSelectorTime(); -// newSelector = currentSelector.cloneAnimatorSelector(); -// } else { -// currentSelector.replaceAll(newSelector); -// } -// } -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.PROPERTY, currentSelector); - - if (getCurveIndex() == null) { Point p = getLocation(); setOldPoint(getModel().getKeyFrameLocationFromModel(getIndex())); @@ -107,14 +77,6 @@ public class AnimationPathMoveCommand extends AnimationPathCommand { } public void undo() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// currentSelector.replaceAll(oldSelector); -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.PROPERTY, currentSelector); - - Point p = getOldPoint(); AnimationPathCurve curve = getOldCurve(); if (p != null) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPropertyChangeCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPropertyChangeCommand.java index a80c143..334b6bb 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPropertyChangeCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/AnimationPropertyChangeCommand.java @@ -81,28 +81,6 @@ public class AnimationPropertyChangeCommand extends Command { */ @Override public void execute() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// if(newSelector == null || oldSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// -// keyframe = currentSelector.findAnimatorKeyframe(keyframe); -// if(keyframe != null) { -// frame = keyframe.getFrameByCurrentTime(frame.getFrameTime() + keyframe.getDelay()); -// if(frame != null) { -// frame.addOrEditProperties(properties); -// newSelector = currentSelector.cloneAnimatorSelector(); -// } -// } -// } else { -// currentSelector.replaceAll(newSelector); -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.PROPERTY, currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); removedKeyframes.clear(); @@ -128,13 +106,6 @@ public class AnimationPropertyChangeCommand extends Command { */ @Override public void undo() { - - /*AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); - currentSelector.replaceAll(oldSelector); - - animatorModelManager.fireEvent(true, currentSelector, - AnimatorModelEvent.EventType.SELECTOR_REFRESH, Origin.PROPERTY, currentSelector);*/ - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); frame.removeOrEditProperties(animatorModelManager.getModelFactory(), oldProperties, properties, removedKeyframes); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorKeyframe.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorKeyframe.java index 1627771..54b71cc 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorKeyframe.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorKeyframe.java @@ -463,9 +463,21 @@ public class AnimatorKeyframe extends AnimatorModel { AnimatorFrame nextFrame = nextParent.getNextAnimatorFrameByTime(frame); if(nextFrame != null) { if (!frame.isPredefined() && !nextFrame.isPredefined() && !nextFrame.hasSamePropertyValue(frame)) { + //current Keyframe and next Keyframe are predefined + //current Keyframe and next Keyframe are have same Property value mergeFrame(nextFrame, true); result = true; removedKeyframes.add(nextParent); + } else { + AnimatorKeyframe nextCustomKeyframe = (AnimatorKeyframe) selector.getNextCustomAnimatorKeyframeByTime(this); + if(!nextParent.equals(nextCustomKeyframe)) { + + } + + + + + } } } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorSelector.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorSelector.java index ec6928f..2d2f045 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorSelector.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorSelector.java @@ -759,6 +759,41 @@ public class AnimatorSelector extends AnimatorModel { } return result; } + + public AnimatorKeyframe getNextCustomAnimatorKeyframeByTime(AnimatorModel model) { + //Return Next AnimatorKeyframe that located after passed AnimatorKeyframe + Double baseTime = 0.0; + if(model instanceof AnimatorKeyframe) { + baseTime = ((AnimatorKeyframe)model).getDelay(); + } else { + baseTime = ((AnimatorKeyframe)model.getParent()).getDelay(); + } + + AnimatorKeyframe result = null; + for(AnimatorKeyframe keyframe : getNextKeyframesByCurrentTime(baseTime)) { + if(keyframe.getName().equals("custom")) { + if(Double.compare(keyframe.getDelay() + keyframe.getDuration(), + ((AnimatorKeyframe)model).getDelay() + ((AnimatorKeyframe)model).getDuration()) > 0) { + if(result != null) { + if(Double.compare(result.getDelay() + result.getDuration(), keyframe.getDelay() + keyframe.getDuration()) > 0) { + result = keyframe; + } else if (Double.compare(result.getDelay() + result.getDuration(), keyframe.getDelay() + keyframe.getDuration()) == 0){ + if(result.getName().contains("custom")) { + continue; + } else { + if(keyframe.getName().contains("custom")) { + result = keyframe; + } + } + } + } else { + result = keyframe; + } + } + } + } + return result; + } public AnimatorFrame getPreviousAnimatorFrameByTime(AnimatorFrame currentFrame) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/io/AnimatorFileWriter.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/io/AnimatorFileWriter.java index 7cc9b39..5cd95dc 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/io/AnimatorFileWriter.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/io/AnimatorFileWriter.java @@ -204,7 +204,7 @@ public class AnimatorFileWriter { JsonObject scene = sceneElement.getAsJsonArray().get(0).getAsJsonObject(); scene.addProperty("show", true); - + array = jsonObject.get("scenes").getAsJsonArray().get(0).getAsJsonObject().get("aniGroups") .getAsJsonArray(); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameCreateCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameCreateCommand.java index 03c9a55..47bdb95 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameCreateCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameCreateCommand.java @@ -64,46 +64,6 @@ public class TimelineFrameCreateCommand extends Command { */ @Override public void execute() { - -// AnimatorModelManager manager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// if(oldSelectors == null || newSelectors == null) { -// -// oldSelectors = new ArrayList(); -// newSelectors = new ArrayList(); -// -// for(AnimatorModel model : currentSelectors) { -// AnimatorSelector currentSelector = (AnimatorSelector)model; -// oldSelectors.add(currentSelector.cloneAnimatorSelector()); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// -// AnimatorFrame frame = currentSelector.createOrGetAnimatorFrame(currentTime); -// if (frame != null) { -// AnimatorKeyframe keyframe = (AnimatorKeyframe) frame.getParent(); -// keyframe.addChild(frame, false); -// -// if (!currentSelector.isExistKeyframe(keyframe)) {// case 1 -// currentSelector.addChild(keyframe); -// } else {// case 2 -// frame.findAnimatedPropertyAndSetInFrame((AnimatorFrame) keyframe.getPrevChild(frame), -// (AnimatorFrame) keyframe.getNextChild(frame)); -// } -// } -// -// currentSelector.updateSelectorTime(); -// newSelectors.add(currentSelector.cloneAnimatorSelector()); -// manager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); -// } -// } else { -// for(AnimatorModel model : currentSelectors) { -// AnimatorSelector currentSelector = (AnimatorSelector)model; -// currentSelector.replaceAll((AnimatorSelector)newSelectors.get(currentSelectors.indexOf(currentSelector))); -// manager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); -// } -// } - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); for(AnimatorModel model : currentSelectors) { @@ -143,12 +103,6 @@ public class TimelineFrameCreateCommand extends Command { } } - -// -// if (frames.size() == 0) -// frames = manager.createOrGetAnimatorFrames(manager.getModelFactory(), currentSelectors, currentTime); -// -// manager.addAnimatorFrames(frames, currentTime, Origin.TIMELINE); } /* @@ -168,16 +122,6 @@ public class TimelineFrameCreateCommand extends Command { */ @Override public void undo() { -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// for(AnimatorModel model : currentSelectors) { -// AnimatorSelector currentSelector = (AnimatorSelector)model; -// currentSelector.replaceAll((AnimatorSelector)oldSelectors.get(currentSelectors.indexOf(currentSelector))); -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); -// } - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); for(AnimatorFrame frame : frames) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameDeleteCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameDeleteCommand.java index 5be3f24..7dfa7b9 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameDeleteCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameDeleteCommand.java @@ -81,38 +81,6 @@ public class TimelineFrameDeleteCommand extends Command { */ @Override public void execute() { - /*AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); - - if(oldSelector == null || oldSelector == null) { - oldSelector = currentSelector.cloneAnimatorSelector(); - currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); - keyframe = currentSelector.findAnimatorKeyframe(keyframe); - if(keyframe != null) { - frame = keyframe.getFrameByCurrentTime(frame.getFrameTime() + keyframe.getDelay()); - if(frame != null) { - AnimatorFrame previousFrame = (AnimatorFrame) keyframe.getPrevChild(frame); - if (previousFrame != null) { - List curveFrames = previousFrame.getCurveFrames(); - if (curveFrames != null) { - ((AnimatorFrame) previousFrame).setCurveFrames(new ArrayList()); - - } - } - - keyframe.removeChild(frame, true); - - currentSelector.updateSelectorTime(); - newSelector = currentSelector.cloneAnimatorSelector(); - } - } - - } else { - currentSelector.replaceAll(newSelector); - } - - animatorModelManager.fireEvent(true, currentSelector, - AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector);*/ - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); if (curveFrames != null) { @@ -146,14 +114,6 @@ public class TimelineFrameDeleteCommand extends Command { */ @Override public void undo() { - - /*AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); - currentSelector.replaceAll(oldSelector); - - animatorModelManager.fireEvent(true, currentSelector, - AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector);*/ - - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); keyframe.updateTimeForFrameAdd(currentTime); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameEditCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameEditCommand.java index 860a635..63991ab 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameEditCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineFrameEditCommand.java @@ -64,30 +64,6 @@ public class TimelineFrameEditCommand extends Command { */ @Override public void execute() { - // AnimatorModelManager animatorModelManager = - // AnimatorUtils.getAppManager().getAnimatorModelManager(); - // - // if(oldSelector == null || oldSelector == null) { - // oldSelector = currentSelector.cloneAnimatorSelector(); - // currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); - // //Change new keyframe and frame from currentSelector - // keyframe = currentSelector.findAnimatorKeyframe(keyframe); - // frame = keyframe.getFrameByCurrentTime(keyframe.getDelay() + frame.getFrameTime()); - // - // frame.setFrameTime(afterFrameTime); - // keyframe.removeChild(frame, false); - // keyframe.addChild(frame, false); - // - // currentSelector.updateSelectorTime(); - // newSelector = currentSelector.cloneAnimatorSelector(); - // } else { - // currentSelector.replaceAll(newSelector); - // } - // - // animatorModelManager.fireEvent(true, currentSelector, - // AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, - // currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); @@ -122,14 +98,6 @@ public class TimelineFrameEditCommand extends Command { */ @Override public void undo() { - // AnimatorModelManager animatorModelManager = - // AnimatorUtils.getAppManager().getAnimatorModelManager(); - // currentSelector.replaceAll(oldSelector); - // - // animatorModelManager.fireEvent(true, currentSelector, - // AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, - // currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeDeleteCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeDeleteCommand.java index 402ff42..c8c6d7c 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeDeleteCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeDeleteCommand.java @@ -56,24 +56,6 @@ public class TimelineKeyframeDeleteCommand extends Command { */ @Override public void execute() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// if(newSelector == null || oldSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// keyframe = currentSelector.findAnimatorKeyframe(keyframe); -// currentSelector.removeChild(keyframe); -// -// currentSelector.updateSelectorTime(); -// newSelector = currentSelector.cloneAnimatorSelector(); -// } else { -// currentSelector.replaceAll(newSelector); -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); @@ -100,13 +82,6 @@ public class TimelineKeyframeDeleteCommand extends Command { */ @Override public void undo() { - - /*AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); - currentSelector.replaceAll(oldSelector); - - animatorModelManager.fireEvent(true, currentSelector, - AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector);*/ - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); currentSelector.addChild(currentKeyframe); diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeEditCommand.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeEditCommand.java index e1c3f8e..d978d06 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeEditCommand.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/command/TimelineKeyframeEditCommand.java @@ -81,37 +81,6 @@ public class TimelineKeyframeEditCommand extends Command { */ @Override public void execute() { -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// -// if(newSelector == null || oldSelector == null) { -// oldSelector = currentSelector.cloneAnimatorSelector(); -// currentSelector.replaceAll(currentSelector.cloneAnimatorSelector()); -// keyframe = currentSelector.findAnimatorKeyframe(keyframe); -// keyframe.setDelay(afterStart); -// -// if (beforeDuration != afterDuration) { -// keyframe.editFramesTime(afterDuration); -// keyframe.setDuration(afterDuration); -// } -// -// int size = keyframe.getChildrenSize(); -// -// ((AnimatorFrame) keyframe.getChild(0)).setFrameTime(0.0); -// ((AnimatorFrame) keyframe.getChild(size - 1)).setFrameTime(afterDuration); -// -// ((AnimatorSelector)keyframe.getParent()).removeChild(keyframe); -// ((AnimatorSelector)keyframe.getParent()).addChild(keyframe); -// -// currentSelector.updateSelectorTime(); -// newSelector = currentSelector.cloneAnimatorSelector(); -// -// } else { -// currentSelector.replaceAll(newSelector); -// } -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); keyframe = currentSelector.getAnimatorKeyframeById(keyframe.getId()); @@ -158,13 +127,6 @@ public class TimelineKeyframeEditCommand extends Command { */ @Override public void undo() { - -// AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); -// currentSelector.replaceAll(oldSelector); -// -// animatorModelManager.fireEvent(true, currentSelector, -// AnimatorModelEvent.EventType.SELECTOR_REFRESH, AnimatorModelEvent.Origin.TIMELINE, currentSelector); - AnimatorModelManager animatorModelManager = AnimatorUtils.getAppManager().getAnimatorModelManager(); if(isMerged) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java index 9179dde..a0c32f0 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java @@ -1836,12 +1836,14 @@ public class PageDesigner extends GraphicalEditor implements CommandStackListene @Override public void pageAdded(PageDataSetEvent e) { designer.setContents(appManager.getPageDataSet().getBaseRootPart()); + animator.setContents(appManager.getPageDataSet().getBaseRootPart()); } @Override public void pageRemoved(PageDataSetEvent e) { designer.setContents(appManager.getPageDataSet().getBaseRootPart()); + animator.setContents(appManager.getPageDataSet().getBaseRootPart()); } @Override -- 2.7.4