ANIMATOR : Fix prevents 10/18210/1
authorseongwon.shim <seongwon.shim@samsung.com>
Tue, 18 Mar 2014 09:55:40 +0000 (18:55 +0900)
committerseongwon.shim <seongwon.shim@samsung.com>
Tue, 18 Mar 2014 09:55:40 +0000 (18:55 +0900)
Fix prevents in animator related source(On going) -31985, 31984, 31981, 31982, 30420, 30421, 30422, 31962, 31999

Change-Id: I7cc270e3c407fd592d31149d4024799bd491a733
Signed-off-by: seongwon.shim <seongwon.shim@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/ActoinAnimationGroupChangeCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/gef/command/ActoinAnimationGroupCreateCommand.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorModelFactory.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorModelManager.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/AnimatorPredefinedAnimationFactory.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/deserializer/AnimatorAnimationDeserializer.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/model/deserializer/AnimatorWidgetDeserializer.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/utils/AnimatorUtils.java

index 25d609e..9f7b2aa 100644 (file)
@@ -150,6 +150,8 @@ public class ActoinAnimationGroupChangeCommand extends Command {
             case GOTOTIME_ANIMATIONGROUP:
                 actionType = "setCurrentTime";
                 break;
+            default:
+               actionType = "";
         }
         return actionType;
     }
index 790c35a..8eb11d2 100644 (file)
@@ -137,6 +137,8 @@ public class ActoinAnimationGroupCreateCommand extends Command {
             case GOTOTIME_ANIMATIONGROUP:
                 actionType = "setCurrentTime";
                 break;
+            default :
+               actionType ="";
         }
         return actionType;
     }
index 5fe7db8..a1ba5d4 100644 (file)
@@ -79,7 +79,8 @@ public class AnimatorModelFactory {
                case ACTION_VIDEO:
                }
                
-               model.setModelFactory(this);
+               if(model != null)
+                       model.setModelFactory(this);
                
                return model;
        }
index 17fbc16..46ee5fb 100644 (file)
@@ -788,6 +788,10 @@ public class AnimatorModelManager implements ISelectionListener, IPageDataSetLis
     private void findAnimatedPropertyAndSetInFrame(AnimatorFrame frame, AnimatorKeyframe keyframe) {
         AnimatorFrame previousFrame = (AnimatorFrame) keyframe.getPrevChild(frame);
         AnimatorFrame nextFrame = (AnimatorFrame) keyframe.getNextChild(frame);
+        if(previousFrame == null || nextFrame == null) {
+               return;
+        }
+        
         Set<String> animatedProperties = getAnimatedProperties(previousFrame, nextFrame);
         // set the interpolated value
         double middle =
@@ -858,7 +862,9 @@ public class AnimatorModelManager implements ISelectionListener, IPageDataSetLis
         AnimatorKeyframe keyframe = getKeyframeByCurrentTime(selector, currentTime);
         if (keyframe != null) {
             frame = keyframe.getFrameByCurrentTime(currentTime);
-            frame.addOrEditProperties(properties);
+            if(frame != null) {
+               frame.addOrEditProperties(properties);
+            }
         } else {
             throw new RuntimeException(
                                        "exception in AnimatorModelManager.editAnimatorFrame(precondition not satisfied)");
index d81f5eb..10753be 100644 (file)
@@ -53,6 +53,10 @@ public class AnimatorPredefinedAnimationFactory {
                List<AnimatorFrame> frames = new ArrayList<AnimatorFrame>();
         List<CssAnimationPropertyDescriptor> defaultKeyFrames =
                 preDefinedAnimationDescriptor.getDefaultKeyFrames();
+        
+        if(defaultKeyFrames == null) {
+               return frames;
+        }              
 
         double duration =
                 AnimatorUtils.convertTimeToDouble(preDefinedAnimationDescriptor
index bdf7755..bf6751f 100644 (file)
@@ -92,12 +92,22 @@ public class AnimatorAnimationDeserializer extends AnimatorModelDeserializer<Ani
                     AnimatorWidget widget = (AnimatorWidget) animation.getChild(id);
                     Part widgetPart = null;
                     if (widget == null) {
-                        widgetPart = (Part) getPagePart().getChildOfIdPropertyValue(id, true);
-                        widget = (AnimatorWidget)getModelFactory().createAnimatorModel(AnimatorModelType.WIDGET);
-                        widget.setPartLink(widgetPart);
-                        widget.setId(widgetPart.getPropertyValue("id"));
-                        widget.setParent(animation);
-                        animation.addChild(widget);
+                       widgetPart = (Part) getPagePart().getChildOfIdPropertyValue(id, true);
+                       if(widgetPart != null) {
+                               widget = (AnimatorWidget)getModelFactory().createAnimatorModel(AnimatorModelType.WIDGET);
+                               if(widget != null) {
+                                       widget.setPartLink(widgetPart);
+                                widget.setId(widgetPart.getPropertyValue("id"));
+                                widget.setParent(animation);
+                                animation.addChild(widget);
+                               }
+                       }
+//                        widgetPart = (Part) getPagePart().getChildOfIdPropertyValue(id, true);
+//                        widget = (AnimatorWidget)getModelFactory().createAnimatorModel(AnimatorModelType.WIDGET);
+//                        widget.setPartLink(widgetPart);
+//                        widget.setId(widgetPart.getPropertyValue("id"));
+//                        widget.setParent(animation);
+//                        animation.addChild(widget);
                     }
 
                     widget.setLock(membersObject.get("lock").getAsBoolean());
index 20d45d2..46595c3 100644 (file)
@@ -66,21 +66,24 @@ public class AnimatorWidgetDeserializer extends AnimatorModelDeserializer<Animat
                     (Part) getPagePart().getChildOfIdPropertyValue(jobject.get("id")
                                                                              .getAsString(), true);
 
-            widget = (AnimatorWidget)getModelFactory().createAnimatorModel(AnimatorModelType.WIDGET);
-            widget.setPartLink(widgetPart);
-            widget.setId(widgetPart.getPropertyValue("id"));
-            widget.setLock(jobject.get("lock").getAsBoolean());
-            widget.setVisibility(jobject.get("visibility").getAsBoolean());
+            if(widgetPart != null) {
+                widget = (AnimatorWidget)getModelFactory().createAnimatorModel(AnimatorModelType.WIDGET);
+                if(widget != null) {
+                        widget.setPartLink(widgetPart);
+                     widget.setId(widgetPart.getPropertyValue("id"));
+                     widget.setLock(jobject.get("lock").getAsBoolean());
+                     widget.setVisibility(jobject.get("visibility").getAsBoolean());
 
-            if (jobject.has("animation")) {
-                AnimatorSelector selector = null;
-                for (JsonElement animationsElement : jobject.get("animation").getAsJsonArray()) {
-                    selector = context.deserialize(animationsElement, AnimatorSelector.class);
-                    selector.setParent(widget);
-                    widget.addChild(selector);
-                }
+                     if (jobject.has("animation")) {
+                         AnimatorSelector selector = null;
+                         for (JsonElement animationsElement : jobject.get("animation").getAsJsonArray()) {
+                             selector = context.deserialize(animationsElement, AnimatorSelector.class);
+                             selector.setParent(widget);
+                             widget.addChild(selector);
+                         }
+                     }
+                }
             }
-
         }
         return widget;
     }
index cb4096e..73b47ff 100644 (file)
@@ -404,7 +404,9 @@ public class AnimatorUtils {
      * @return
      */
     public static double convertTimeToDouble(String duration) {
-        return Double.parseDouble(duration.replace("s", ""));
+       if(duration != null)
+               return Double.parseDouble(duration.replace("s", ""));
+       return 0.0;
     }
 
     /**