]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8026 Removed deprecated ExpandLayout and OrderedLayout.
authorArtur Signell <artur@vaadin.com>
Fri, 16 Dec 2011 14:31:22 +0000 (16:31 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 19 Dec 2011 11:06:59 +0000 (13:06 +0200)
src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java
src/com/vaadin/ui/ExpandLayout.java [deleted file]
src/com/vaadin/ui/FormLayout.java
src/com/vaadin/ui/OrderedLayout.java [deleted file]

index 7889968e634df7caa02dcae0485f9d421c55be29..97ae19a8dd96da3914e97e218feae572b9cba90c 100644 (file)
@@ -25,7 +25,6 @@ import com.vaadin.ui.Form;
 import com.vaadin.ui.GridLayout;
 import com.vaadin.ui.GridLayout.Area;
 import com.vaadin.ui.Layout;
-import com.vaadin.ui.OrderedLayout;
 import com.vaadin.ui.Panel;
 import com.vaadin.ui.SplitPanel;
 import com.vaadin.ui.TabSheet;
@@ -198,11 +197,7 @@ public class ComponentSizeValidator implements Serializable {
                     AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
                     boolean vertical = false;
 
-                    if (ol instanceof OrderedLayout) {
-                        if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
-                            vertical = true;
-                        }
-                    } else if (ol instanceof VerticalLayout) {
+                    if (ol instanceof VerticalLayout) {
                         vertical = true;
                     }
 
@@ -231,11 +226,7 @@ public class ComponentSizeValidator implements Serializable {
                     AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
                     boolean horizontal = true;
 
-                    if (ol instanceof OrderedLayout) {
-                        if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
-                            horizontal = false;
-                        }
-                    } else if (ol instanceof VerticalLayout) {
+                    if (ol instanceof VerticalLayout) {
                         horizontal = false;
                     }
 
@@ -426,9 +417,7 @@ public class ComponentSizeValidator implements Serializable {
 
             if (parent instanceof AbstractOrderedLayout) {
                 boolean horizontal = true;
-                if (parent instanceof OrderedLayout) {
-                    horizontal = ((OrderedLayout) parent).getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL;
-                } else if (parent instanceof VerticalLayout) {
+                if (parent instanceof VerticalLayout) {
                     horizontal = false;
                 }
                 if (horizontal
@@ -528,11 +517,7 @@ public class ComponentSizeValidator implements Serializable {
             if (parent instanceof AbstractOrderedLayout) {
                 AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
                 boolean horizontal = true;
-                if (ol instanceof OrderedLayout) {
-                    if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) {
-                        horizontal = false;
-                    }
-                } else if (ol instanceof VerticalLayout) {
+                if (ol instanceof VerticalLayout) {
                     horizontal = false;
                 }
 
diff --git a/src/com/vaadin/ui/ExpandLayout.java b/src/com/vaadin/ui/ExpandLayout.java
deleted file mode 100644 (file)
index 55ee2ff..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* 
-@VaadinApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.ui;
-
-/**
- * A layout that will give one of it's components as much space as possible,
- * while still showing the other components in the layout. The other components
- * will in effect be given a fixed sized space, while the space given to the
- * expanded component will grow/shrink to fill the rest of the space available -
- * for instance when re-sizing the window.
- * 
- * Note that this layout is 100% in both directions by default ({link
- * {@link #setSizeFull()}). Remember to set the units if you want to specify a
- * fixed size. If the layout fails to show up, check that the parent layout is
- * actually giving some space.
- * 
- * @deprecated Deprecated in favor of the new OrderedLayout
- */
-@SuppressWarnings("serial")
-@Deprecated
-public class ExpandLayout extends OrderedLayout {
-
-    private Component expanded = null;
-
-    public ExpandLayout() {
-        this(ORIENTATION_VERTICAL);
-    }
-
-    public ExpandLayout(int orientation) {
-        super(orientation);
-
-        setSizeFull();
-    }
-
-    /**
-     * @param c
-     *            Component which container will be maximized
-     */
-    public void expand(Component c) {
-        if (expanded != null) {
-            try {
-                setExpandRatio(expanded, 0.0f);
-            } catch (IllegalArgumentException e) {
-                // Ignore error if component has been removed
-            }
-        }
-
-        expanded = c;
-        if (expanded != null) {
-            setExpandRatio(expanded, 1.0f);
-        }
-
-        requestRepaint();
-    }
-
-    @Override
-    public void addComponent(Component c, int index) {
-        super.addComponent(c, index);
-        if (expanded == null) {
-            expand(c);
-        }
-    }
-
-    @Override
-    public void addComponent(Component c) {
-        super.addComponent(c);
-        if (expanded == null) {
-            expand(c);
-        }
-    }
-
-    @Override
-    public void addComponentAsFirst(Component c) {
-        super.addComponentAsFirst(c);
-        if (expanded == null) {
-            expand(c);
-        }
-    }
-
-    @Override
-    public void removeComponent(Component c) {
-        super.removeComponent(c);
-        if (c == expanded) {
-            if (getComponentIterator().hasNext()) {
-                expand(getComponentIterator().next());
-            } else {
-                expand(null);
-            }
-        }
-    }
-
-    @Override
-    public void replaceComponent(Component oldComponent, Component newComponent) {
-        super.replaceComponent(oldComponent, newComponent);
-        if (oldComponent == expanded) {
-            expand(newComponent);
-        }
-    }
-}
index f61f5d544e77a599ccc359080661b14f39dd4bb6..d33d3e94da0d66e5c76216566f2000863513b5ff 100644 (file)
@@ -21,9 +21,8 @@ import com.vaadin.terminal.gwt.client.ui.VFormLayout;
  * bottom are by default on.
  * 
  */
-@SuppressWarnings({ "deprecation", "serial" })
 @ClientWidget(VFormLayout.class)
-public class FormLayout extends OrderedLayout {
+public class FormLayout extends AbstractOrderedLayout {
 
     public FormLayout() {
         super();
diff --git a/src/com/vaadin/ui/OrderedLayout.java b/src/com/vaadin/ui/OrderedLayout.java
deleted file mode 100644 (file)
index 474fc89..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.ui;
-
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.VOrderedLayout;
-import com.vaadin.ui.ClientWidget.LoadStyle;
-
-/**
- * Ordered layout.
- * 
- * <code>OrderedLayout</code> is a component container, which shows the
- * subcomponents in the order of their addition in specified orientation.
- * 
- * @author Vaadin Ltd.
- * @version
- * @VERSION@
- * @since 3.0
- * @deprecated Replaced by VerticalLayout/HorizontalLayout. For type checking
- *             please not that VerticalLayout/HorizontalLayout do not extend
- *             OrderedLayout but AbstractOrderedLayout (which also OrderedLayout
- *             extends).
- */
-@SuppressWarnings("serial")
-@Deprecated
-@ClientWidget(value = VOrderedLayout.class, loadStyle = LoadStyle.EAGER)
-public class OrderedLayout extends AbstractOrderedLayout {
-    /* Predefined orientations */
-
-    /**
-     * Components are to be laid out vertically.
-     */
-    public static final int ORIENTATION_VERTICAL = 0;
-
-    /**
-     * Components are to be laid out horizontally.
-     */
-    public static final int ORIENTATION_HORIZONTAL = 1;
-
-    /**
-     * Orientation of the layout.
-     */
-    private int orientation;
-
-    /**
-     * Creates a new ordered layout. The order of the layout is
-     * <code>ORIENTATION_VERTICAL</code>.
-     * 
-     * @deprecated Use VerticalLayout instead.
-     */
-    @Deprecated
-    public OrderedLayout() {
-        this(ORIENTATION_VERTICAL);
-    }
-
-    /**
-     * Create a new ordered layout. The orientation of the layout is given as
-     * parameters.
-     * 
-     * @param orientation
-     *            the Orientation of the layout.
-     * 
-     * @deprecated Use VerticalLayout/HorizontalLayout instead.
-     */
-    @Deprecated
-    public OrderedLayout(int orientation) {
-        this.orientation = orientation;
-        if (orientation == ORIENTATION_VERTICAL) {
-            setWidth(100, UNITS_PERCENTAGE);
-        }
-    }
-
-    /**
-     * Gets the orientation of the container.
-     * 
-     * @return the Value of property orientation.
-     */
-    public int getOrientation() {
-        return orientation;
-    }
-
-    /**
-     * Sets the orientation of this OrderedLayout. This method should only be
-     * used before initial paint.
-     * 
-     * @param orientation
-     *            the New value of property orientation.
-     * @deprecated Use VerticalLayout/HorizontalLayout or define orientation in
-     *             constructor instead
-     */
-    @Deprecated
-    public void setOrientation(int orientation) {
-        setOrientation(orientation, true);
-    }
-
-    /**
-     * Internal method to change orientation of layout. This method should only
-     * be used before initial paint.
-     * 
-     * @param orientation
-     */
-    protected void setOrientation(int orientation, boolean needsRepaint) {
-        // Checks the validity of the argument
-        if (orientation < ORIENTATION_VERTICAL
-                || orientation > ORIENTATION_HORIZONTAL) {
-            throw new IllegalArgumentException();
-        }
-
-        this.orientation = orientation;
-        if (needsRepaint) {
-            requestRepaint();
-        }
-    }
-
-    @Override
-    public void paintContent(PaintTarget target) throws PaintException {
-        super.paintContent(target);
-
-        // Adds the orientation attributes (the default is vertical)
-        if (orientation == ORIENTATION_HORIZONTAL) {
-            target.addAttribute("orientation", "horizontal");
-        }
-
-    }
-
-}