ANIMATOR : Modified Filter in Linux Platform 86/22186/2
authorjinwooim.bae <jinwooim.bae@samsung.com>
Thu, 29 May 2014 16:26:16 +0000 (01:26 +0900)
committerjinwooim.bae <jinwooim.bae@samsung.com>
Thu, 29 May 2014 16:42:18 +0000 (01:42 +0900)
Refresh TimelineView in linux platform.

Change-Id: I0db42bd32d7f477082be6771c0cefe00abb83fd1
Signed-off-by: jinwooim.bae <jinwooim.bae@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/TimelineViewer.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/header/AnimationGroupCreateDialog.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/header/TimelineOutlineHeader.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimeTreeElement.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimelineOutlineElement.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/animator/ui/views/timeline/tree/TimelineWidgetElement.java

index bf78735..227d03e 100644 (file)
@@ -201,6 +201,45 @@ public class TimelineViewer extends TreeViewer implements ISelectionChangedListe
 
     /*
      * (non-Javadoc)
+     * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#setContents(java.lang.Object)
+     */
+    public void setContents(Object contents) {
+       super.setContents(contents);
+       refreshTreeItem();
+    }
+
+    /**
+     * RefreshTreeItem
+     */
+    private void refreshTreeItem() {
+        if (Platform.getOS().equals(Platform.OS_LINUX)
+                || Platform.getOS().equals(Platform.OS_MACOSX)) {
+            Tree contentTree = (Tree)getControl();
+            TreeItem[] items = contentTree.getItems();
+
+            for(TreeItem item : items) {
+                TreeItem[] childItems = item.getItems();
+                if(item.getExpanded()) {
+                    Event event = new Event();
+                    event.item = item;
+                    getControl().notifyListeners(SWT.Expand, event);
+                    for(TreeItem childItem : childItems) {
+                        TimeTreeElement element = (TimeTreeElement)childItem.getData("ReferentTreeWidget");
+                        if(element != null) {
+                            element.redraw();
+                        }
+                    }
+                } else {
+                    Event event = new Event();
+                    event.item = item;
+                    getControl().notifyListeners(SWT.Collapse, event);
+                }
+            }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
      * 
      * @see
      * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers
@@ -547,8 +586,9 @@ public class TimelineViewer extends TreeViewer implements ISelectionChangedListe
         TimelineEditPart pageEditPart = getPageEditPart();
         pageEditPart.refresh();
 
-        Tree contentTree = (Tree) getControl();
-        contentTree.pack();
+        refreshTree();
+        
+        refreshTreeItem();
         // refreshTimelineViewer();
     }
 
index a601b3a..4a88888 100644 (file)
@@ -102,9 +102,7 @@ public class AnimationGroupCreateDialog extends Dialog {
      * Create Control
      */
     private void createContents() {
-        
-        
-        
+
         int iterLationLeft = 10;
         int iterSpinnerkHeight = 22;
         int infinityLeft = 44;
@@ -117,7 +115,7 @@ public class AnimationGroupCreateDialog extends Dialog {
          
         } else if(Platform.getOS().equals(Platform.OS_LINUX) ||
                 Platform.getOS().equals(Platform.OS_MACOSX)) {
-            iterLationLeft = 20;
+            iterLationLeft = 10;
             iterSpinnerkHeight = 26;
             infinityLeft = 20;
             infinityWidth = 70;
index 2af2f65..8f783ad 100644 (file)
@@ -610,6 +610,7 @@ public class TimelineOutlineHeader extends Composite {
                             .getKeyframeHeader().getTimeBar();
 
             timeBar.setPosition(0);
+            timeBar.getPlayHeader().refreshPlayHeaderLine();
         }
     }
 
index b1b0e04..39ab9fd 100644 (file)
@@ -63,6 +63,7 @@ import org.tizen.webuibuilder.animator.ui.views.timeline.header.TimelineKeyframe
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrame;
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrameComponent;
 import org.tizen.webuibuilder.animator.ui.views.timeline.widget.KeyFrameUnit;
+import org.tizen.webuibuilder.utility.Platform;
 
 
 /**
@@ -485,9 +486,11 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
         } else {
             int type = keyframe.getKeyFrameType();
             if (type == KeyFrame.START_FRAME) {
-                int afterPointTime = keyframe.getAfterPoint() * TimelineConstants.DEFAULT_TIME_INTERVAL;
+                int afterPointTime =
+                        keyframe.getAfterPoint() * TimelineConstants.DEFAULT_TIME_INTERVAL;
                 int visibleTime = (int) (getVisibleStartTime() * scale);
-                int currentSecondTime = (afterPointTime + visibleTime) / TimelineConstants.DEFAULT_TIME_INTERVAL;
+                int currentSecondTime =
+                        (afterPointTime + visibleTime) / TimelineConstants.DEFAULT_TIME_INTERVAL;
                 currentSecond = (double) (currentSecondTime / timelineScalePoint);
             } else {
                 currentSecond =
@@ -780,16 +783,20 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                 setBackground(ColorResource.CHILD_TREEITEM);
             }
 
-/*            e.gc.drawRectangle(timeElementClientArea.x, timeElementClientArea.y,
-                               timeElementClientArea.width -1, timeElementClientArea.height );*/
-            
-            e.gc.drawLine(timeElementClientArea.x, timeElementClientArea.height-1,
-                          timeElementClientArea.width*2, timeElementClientArea.height );
-            e.gc.drawLine(timeElementClientArea.x , timeElementClientArea.y , timeElementClientArea.x,
-                          timeElementClientArea.height -1);
-            e.gc.drawLine(timeElementClientArea.width -1 , timeElementClientArea.y , timeElementClientArea.width ,
-                          timeElementClientArea.height *2);
-            
+            if (Platform.getOS().equals(Platform.OS_WIN32)) {
+                e.gc.drawLine(timeElementClientArea.x, timeElementClientArea.height - 1,
+                              timeElementClientArea.width * 2, timeElementClientArea.height);
+                e.gc.drawLine(timeElementClientArea.x, timeElementClientArea.y,
+                              timeElementClientArea.x, timeElementClientArea.height - 1);
+                e.gc.drawLine(timeElementClientArea.width - 1, timeElementClientArea.y,
+                              timeElementClientArea.width, timeElementClientArea.height * 2);
+            } else if (Platform.getOS().equals(Platform.OS_LINUX)
+                    || Platform.getOS().equals(Platform.OS_MACOSX)) {
+                e.gc.drawRectangle(timeElementClientArea.x, timeElementClientArea.y,
+                                   timeElementClientArea.width - 1,
+                                   timeElementClientArea.height - 1);
+            }
+
             e.gc.setForeground(ColorResource.LATTICE);
 
             refreshVisibleTime();
@@ -925,7 +932,7 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                 switch (KeyFrameType) {
                     case KeyFrame.START_FRAME: {
                         setMouseMoveReleasePoint(currentArea.x, xPoint);
-                        
+
                         int beforekeyframeEndPoint =
                                 parentUnit.getKeyFrameUnitModelXpoint()
                                         + parentUnit.getKeyFrameUnitModelWidth()
@@ -938,7 +945,8 @@ public class TimeTreeElement extends Canvas implements ISelectionProvider {
                             return;
                         }
 
-                        selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint+ TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
+                        selectedKeyFrame.setAfterPoint(mouseMoveReleasePoint
+                                + TimelineConstants.DEFAULT_TIMELINE_LEFT_MARGIN);
                         int afterkeyframeWidth = beforekeyframeEndPoint - mouseMoveReleasePoint;
 
                         if (isSelectedControl == true) {
index 1611186..f3f9e9f 100644 (file)
@@ -545,15 +545,17 @@ public class TimelineOutlineElement extends Canvas {
 
             drawOutlineElement(e.gc, clientArea);
 
-            /*
-             * e.gc.drawRectangle(clientArea.x , clientArea.y, clientArea.width -1,
-             * clientArea.height );
-             */
-            e.gc.drawLine(clientArea.x, clientArea.height - 1, clientArea.width * 2,
-                          clientArea.height);
-            e.gc.drawLine(clientArea.x, clientArea.y, clientArea.x, clientArea.height - 1);
-            e.gc.drawLine(clientArea.width - 1, clientArea.y, clientArea.width,
-                          clientArea.height * 2);
+            if (Platform.getOS().equals(Platform.OS_WIN32)) {
+                e.gc.drawLine(clientArea.x, clientArea.height - 1, clientArea.width * 2,
+                              clientArea.height);
+                e.gc.drawLine(clientArea.x, clientArea.y, clientArea.x, clientArea.height - 1);
+                e.gc.drawLine(clientArea.width - 1, clientArea.y, clientArea.width,
+                              clientArea.height * 2);
+            } else if (Platform.getOS().equals(Platform.OS_LINUX)
+                    || Platform.getOS().equals(Platform.OS_MACOSX)) {
+                e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width - 1,
+                                   clientArea.height - 1);
+            }
         }
 
         private void drawOutlineElement(GC gc, Rectangle clientArea) {
index acf36c0..b23afe7 100644 (file)
@@ -201,16 +201,19 @@ public class TimelineWidgetElement extends Canvas {
 
             }
             drawImageAndText(e.gc);
-            /*e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width -1,
-                               clientArea.height -1);*/
-            
-            e.gc.drawLine(clientArea.x , clientArea.height - 1 , clientArea.width*2,
-                        clientArea.height);
-            e.gc.drawLine(clientArea.x , clientArea.y , clientArea.x,
-                   clientArea.height -1);
-            e.gc.drawLine(clientArea.width -1 , clientArea.y , clientArea.width ,
-                   clientArea.height *2);
+
+            if (Platform.getOS().equals(Platform.OS_WIN32)) {
+                e.gc.drawLine(clientArea.x, clientArea.height - 1, clientArea.width * 2,
+                              clientArea.height);
+                e.gc.drawLine(clientArea.x, clientArea.y, clientArea.x, clientArea.height - 1);
+                e.gc.drawLine(clientArea.width - 1, clientArea.y, clientArea.width,
+                              clientArea.height * 2);
+            } else if (Platform.getOS().equals(Platform.OS_LINUX)
+                    || Platform.getOS().equals(Platform.OS_MACOSX)) {
+                e.gc.drawRectangle(clientArea.x, clientArea.y, clientArea.width - 1,
+                                   clientArea.height - 1);
             }
+        }
 
         private void drawImageAndText(GC gc) {
             int animationsMargine = 10;