public AnimatorBrowserViewer(AppManager appManager, ScreenSize screen, IEditorInput editorInput) {
super(appManager, screen, editorInput);
-// AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
-// AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
-
- AnimatorPagePart pagePart = (AnimatorPagePart)appManager.getPageData(appManager.getPageIndex(pageData)).getPagePart();
+ // AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
+ // AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
+
+ AnimatorPagePart pagePart =
+ (AnimatorPagePart) appManager.getPageData(appManager.getPageIndex(pageData))
+ .getPagePart();
List<AnimatorAnimation> animations = pagePart.getAnimations();
if (!animations.isEmpty()) {
this.currentAnimationGroupId = animations.get(0).getId();
protected void handleDispose(DisposeEvent e) {
super.handleDispose(e);
-// AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
-// ((AnimatorPart)manager.getRootPart()).removeAnimatorModelListener(animatorModelEventAdapter);
-
- ((AnimatorPart)appManager.getPageDataSet().getBaseRootPart()).removeAnimatorModelListener(animatorModelEventAdapter);
+ // AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
+ // ((AnimatorPart)manager.getRootPart()).removeAnimatorModelListener(animatorModelEventAdapter);
+
+ AnimatorPart rootPart = (AnimatorPart) appManager.getPageDataSet().getBaseRootPart();
+ if (rootPart != null) {
+ rootPart.removeAnimatorModelListener(animatorModelEventAdapter);
+ }
}
/**
* @param rootPart
*/
public void setAnimatorModelListener(Part rootPart) {
- if(rootPart == null){
+ if (rootPart == null) {
return;
}
-
- ((AnimatorPart)rootPart).addAnimatorModelListener(animatorModelEventAdapter);
+
+ ((AnimatorPart) rootPart).addAnimatorModelListener(animatorModelEventAdapter);
}
/**
*/
public void showAnimationAtMoment(String animationGroupId, double pointTime) {
this.pointTime = pointTime;
- getGoingBridge().aniBridge_setCurrentTime(animationGroupId, (int) (pointTime * 1000));
+ if (getGoingBridge() != null) {
+ getGoingBridge().aniBridge_setCurrentTime(animationGroupId, (int) (pointTime * 1000));
+ }
}
/**
* play animation using javascript framework API.
*/
public void playCurrentAnimation() {
-// AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
-// AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
-//
-// String pageId = pagePart.getPropertyValue("id");
-
- getGoingBridge().aniBridge_play(appManager.getPageData(appManager.getPageIndex(pageData)).getName(),
- currentAnimationGroupId);
+ // AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
+ // AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
+ //
+ // String pageId = pagePart.getPropertyValue("id");
+
+ getGoingBridge().aniBridge_play(appManager.getPageData(appManager.getPageIndex(pageData))
+ .getName(), currentAnimationGroupId);
}
/**
*/
public void pauseAnimation(double pointTime) {
this.pointTime = pointTime;
-// AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
-// AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
-//
-// String pageId = pagePart.getPropertyValue("id");
- getGoingBridge().aniBridge_pause(appManager.getPageData(appManager.getPageIndex(pageData)).getName());
+ // AnimatorModelManager manager = AnimatorModelManager.getInstance(appManager);
+ // AnimatorPagePart pagePart = (AnimatorPagePart) manager.getPagePart();
+ //
+ // String pageId = pagePart.getPropertyValue("id");
+ getGoingBridge().aniBridge_pause(appManager.getPageData(appManager.getPageIndex(pageData))
+ .getName());
}
/**
public void initAnimationFW() {
getGoingBridge()
.aniBridge_initFW(AnimatorFileWriter
- .getOneAnimationGroupModelString(appManager.getPageData(appManager.getPageIndex(pageData)).getName(),
+ .getOneAnimationGroupModelString(appManager
+ .getPageData(appManager
+ .getPageIndex(pageData))
+ .getName(),
currentAnimationGroupId,
- appManager, appManager.getPageDataSet().getBaseRootPart()),
- AnimatorFileWriter.getOnePageAnimatorKeyFrameString(appManager.getPageDataSet().getBaseRootPart(),
- appManager.getPageData(appManager.getPageIndex(pageData)).getPagePart()));
+ appManager,
+ appManager
+ .getPageDataSet()
+ .getBaseRootPart()),
+ AnimatorFileWriter.getOnePageAnimatorKeyFrameString(appManager
+ .getPageDataSet().getBaseRootPart(), appManager
+ .getPageData(appManager.getPageIndex(pageData))
+ .getPagePart()));
}
/**
* framework API.
*/
private void updateAnimationModel() {
-
+
getGoingBridge()
- .aniBridge_setAnimationCss(AnimatorFileWriter.getOnePageAnimatorKeyFrameString(appManager.getPageDataSet().getBaseRootPart(),
- appManager.getPageData(appManager.getPageIndex(pageData)).getPagePart()));
+ .aniBridge_setAnimationCss(AnimatorFileWriter
+ .getOnePageAnimatorKeyFrameString(appManager
+ .getPageDataSet()
+ .getBaseRootPart(),
+ appManager
+ .getPageData(appManager
+ .getPageIndex(pageData))
+ .getPagePart()));
getGoingBridge()
- .aniBridge_setAnimationJs(AnimatorFileWriter
- .getOneAnimationGroupModelString(appManager.getPageData(appManager.getPageIndex(pageData)).getName(),
- currentAnimationGroupId,
- appManager,
- appManager.getPageDataSet().getBaseRootPart()));
+ .aniBridge_setAnimationJs(AnimatorFileWriter.getOneAnimationGroupModelString(appManager
+ .getPageData(appManager
+ .getPageIndex(pageData))
+ .getName(),
+ currentAnimationGroupId,
+ appManager,
+ appManager
+ .getPageDataSet()
+ .getBaseRootPart()));
}
/**
* Apply status(lock and invisible) to widget from animation model.
*/
public void checkLockInvisibleWidget() {
- AnimatorPagePart pagePart = (AnimatorPagePart)appManager.getPageData(appManager.getPageIndex(pageData)).getPagePart();
- AnimatorAnimation animation = pagePart.getAnimation(currentAnimationGroupId);
+ AnimatorPagePart pagePart =
+ (AnimatorPagePart) appManager.getPageData(appManager.getPageIndex(pageData))
+ .getPagePart();
+ AnimatorAnimation animation = pagePart.getAnimation(currentAnimationGroupId);
if (animation == null) {
return;
}
if (part.getPartId() != null && !part.getPartId().isEmpty()) {
WidgetPosition pos = widgetPositions.get(part.getPartId());
if (pos != null) {
-// if (isFireEvent) {
- ((AnimatorPart)part).setAnimationVisualPosition(pos);
-// } else {
-// ((AnimatorPart)part).setAnimationVisualPosition(pos);
-// }
+ // if (isFireEvent) {
+ ((AnimatorPart) part).setAnimationVisualPosition(pos);
+ // } else {
+ // ((AnimatorPart)part).setAnimationVisualPosition(pos);
+ // }
}
}
*
*/
private class AnimatorModelEventAdapter extends AnimatorModelListenerAdapter {
-
- /*
+
+ /*
* (non-Javadoc)
*
* @see
- * org.tizen.webuibuilder.animator.model.AnimatorModelListenerAdapter#selectorRefresh(org.tizen
- * .webuibuilder.animator.model.AnimatorModelEvent)
+ * org.tizen.webuibuilder.animator.model.AnimatorModelListenerAdapter#selectorRefresh(org
+ * .tizen .webuibuilder.animator.model.AnimatorModelEvent)
*/
- @Override
- public void selectorRefresh(AnimatorModelEvent e) {
- updateAnimationModel();
+ @Override
+ public void selectorRefresh(AnimatorModelEvent e) {
+ updateAnimationModel();
AnimatorSelector selector = (AnimatorSelector) e.getModel();
updateAnimationFWAndDetect(selector, currentAnimationGroupId, pointTime);
- }
+ }
- /*
+ /*
* (non-Javadoc)
*
* @see
/*
* Add the first keyframe in Selector
*/
- if (Double.compare(keyFrame.getDelay(),selector.getDelay()) == 0) {
+ if (Double.compare(keyFrame.getDelay(), selector.getDelay()) == 0) {
updateAnimationFWAndDetect(selector, currentAnimationGroupId, pointTime);
} else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
+ updateAnimationFW(selector, currentAnimationGroupId, pointTime);
}
/*
* Add the last keyframe in Selector
*/
- /*else if (Double.compare(keyFrame.getDelay() + keyFrame.getDuration(), selector.getDelay()
- + selector.getDuration()) == 0) {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else if (Double.compare(keyFrame.getDelay() + keyFrame.getDuration(),
+ * selector.getDelay() + selector.getDuration()) == 0) { updateAnimationFW(selector,
+ * currentAnimationGroupId, pointTime); }
+ */
/*
* Add the middle keyframe in Selector
*/
- /*else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else { updateAnimationFW(selector, currentAnimationGroupId, pointTime); }
+ */
}
/*
if (keyFrame.getDelay() < selector.getDelay()) {
updateAnimationFWAndDetect(selector, currentAnimationGroupId, pointTime);
} else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
+ updateAnimationFW(selector, currentAnimationGroupId, pointTime);
}
/*
* Remove the last keyframe in Selector (KeyFrame's delay + duration) > (Selector's
* delay + duration)
*/
- /*else if (keyFrame.getDelay() + keyFrame.getDuration() > selector.getDelay()
- + selector.getDuration()) {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else if (keyFrame.getDelay() + keyFrame.getDuration() > selector.getDelay() +
+ * selector.getDuration()) { updateAnimationFW(selector, currentAnimationGroupId,
+ * pointTime); }
+ */
/*
* Remove the middle keyframe in Selector
*/
- /*else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else { updateAnimationFW(selector, currentAnimationGroupId, pointTime); }
+ */
}
/*
if (0.0 <= pointTime && pointTime < delay) {
updateAnimationFWAndDetect(selector, currentAnimationGroupId, pointTime);
} else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
+ updateAnimationFW(selector, currentAnimationGroupId, pointTime);
}
// Add to middle
- /*else if (delay < pointTime && pointTime < duration) {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else if (delay < pointTime && pointTime < duration) { updateAnimationFW(selector,
+ * currentAnimationGroupId, pointTime); }
+ */
// Add to end
- /*else {
- updateAnimationFW(selector, currentAnimationGroupId, pointTime);
- }*/
+ /*
+ * else { updateAnimationFW(selector, currentAnimationGroupId, pointTime); }
+ */
}
/*