import org.tizen.webuibuilder.animator.model.AnimatorModelManager;
import org.tizen.webuibuilder.animator.model.AnimatorWidget;
import org.tizen.webuibuilder.animator.model.part.AnimatorPagePart;
+import org.tizen.webuibuilder.animator.model.part.AnimatorPart;
import org.tizen.webuibuilder.animator.model.part.AnimatorWidgetPart;
import org.tizen.webuibuilder.animator.utils.AnimatorUtils;
import org.tizen.webuibuilder.model.Part;
} else {
group.getParent().insertChildBefore(child, nextSibling, true);
}
-
- List<AnimatorModel> animatorWidgets = new ArrayList<AnimatorModel>();
- AnimatorPagePart pagePart = (AnimatorPagePart)child.getOwnerPage();
- AnimatorAnimation currentAnimation = pagePart.getCurrentAnimation();
- Iterator<Entry<AnimatorModel, Integer>> iterator = animatorWidgetGroup.entrySet().iterator();
- while(iterator.hasNext()) {
- Entry<AnimatorModel, Integer> next = iterator.next();
- AnimatorModel animatorWidget = (AnimatorWidget)next.getKey();
- if (animatorWidget != null) {
- if(animatorWidget.getPartLink().equals(child)) {
- AnimatorAnimation animation = (AnimatorAnimation) animatorWidget.getParent();
- animation.addChild(next.getValue(), animatorWidget);
-
- if (currentAnimation != null) {
- if (currentAnimation.equals(animation))
- animatorWidgets.add(animatorWidget);
- }
- }
- }
- }
-
-
- animatorModelManager
- .fireEvent(currentAnimation, EventType.WIDGET_ADD, Origin.EDITOR, null, animatorWidgets);
- animatorModelManager.fireEvent(EventType.WIDGET_ADD, Origin.EDITOR, null);
}
}
+
+ AnimatorAnimation currentAnimation = null;
+ List<AnimatorModel> animatorWidgets = new ArrayList<AnimatorModel>();
+ Iterator<Entry<AnimatorModel, Integer>> iterator = animatorWidgetGroup.entrySet().iterator();
+ while(iterator.hasNext()) {
+ Entry<AnimatorModel, Integer> next = iterator.next();
+ AnimatorModel animatorWidget = (AnimatorWidget)next.getKey();
+ if (animatorWidget != null) {
+ AnimatorPart animatorPart = (AnimatorPart)animatorWidget.getPartLink();
+ AnimatorPagePart pagePart = (AnimatorPagePart)animatorPart.getOwnerPage();
+ currentAnimation = pagePart.getCurrentAnimation();
+ AnimatorAnimation animation = (AnimatorAnimation) animatorWidget.getParent();
+ animation.addChild(next.getValue(), animatorWidget);
+ if (currentAnimation != null) {
+ if (currentAnimation.equals(animation))
+ animatorWidgets.add(animatorWidget);
+ }
+ }
+ }
+
+ animatorModelManager
+ .fireEvent(currentAnimation, EventType.WIDGET_ADD, Origin.EDITOR, null, animatorWidgets);
+ animatorModelManager.fireEvent(EventType.WIDGET_ADD, Origin.EDITOR, null);
}
}
\ No newline at end of file