Author: [email protected]
Date: Wed Jan 14 09:14:45 2009
New Revision: 4448

Modified:
    releases/1.6/user/src/com/google/gwt/user/client/ui/PopupPanel.java

Log:
Adding package protected roll down animation from gwt-incubator, initial  
work done by  Jason Essington
Review by:jlabanca

Modified:  
releases/1.6/user/src/com/google/gwt/user/client/ui/PopupPanel.java
==============================================================================
--- releases/1.6/user/src/com/google/gwt/user/client/ui/PopupPanel.java  
(original)
+++ releases/1.6/user/src/com/google/gwt/user/client/ui/PopupPanel.java Wed  
Jan 14 09:14:45 2009
@@ -100,7 +100,7 @@
     * </ul>
     */
    static enum AnimationType {
-    CENTER, ONE_WAY_CORNER
+    CENTER, ONE_WAY_CORNER, ROLL_DOWN
    }

    /**
@@ -144,7 +144,7 @@

        // Determine if we need to animate
        boolean animate = curPanel.isAnimationEnabled;
-      if (curPanel.animType == AnimationType.ONE_WAY_CORNER && !showing) {
+      if (curPanel.animType != AnimationType.CENTER && !showing) {
          animate = false;
        }

@@ -210,17 +210,25 @@
        int bottom = 0;
        int height = (int) (progress * offsetHeight);
        int width = (int) (progress * offsetWidth);
-      if (curPanel.animType == AnimationType.CENTER) {
-        top = (offsetHeight - height) >> 1;
-        left = (offsetWidth - width) >> 1;
-      } else if (curPanel.animType == AnimationType.ONE_WAY_CORNER) {
-        if (LocaleInfo.getCurrentLocale().isRTL()) {
-          left = offsetWidth - width;
-        }
+      switch (curPanel.animType) {
+        case ROLL_DOWN:
+          right = offsetWidth;
+          bottom = height;
+          break;
+        case CENTER:
+          top = (offsetHeight - height) >> 1;
+          left = (offsetWidth - width) >> 1;
+          right = left + width;
+          bottom = top + height;
+          break;
+        case ONE_WAY_CORNER:
+          if (LocaleInfo.getCurrentLocale().isRTL()) {
+            left = offsetWidth - width;
+          }
+          right = left + width;
+          bottom = top + height;
+          break;
        }
-      right = left + width;
-      bottom = top + height;
-
        // Set the rect clipping
        impl.setClip(curPanel.getElement(), getRectString(top, right, bottom,
            left));

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to