/[classpath]/classpath/javax/swing/BoxLayout.java
ViewVC logotype

Diff of /classpath/javax/swing/BoxLayout.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by rabbit78, Tue Apr 12 19:48:43 2005 UTC revision 1.9 by rabbit78, Fri Apr 22 19:53:44 2005 UTC
# Line 148  public class BoxLayout implements Layout Line 148  public class BoxLayout implements Layout
148        throw new AWTError("invalid parent");        throw new AWTError("invalid parent");
149    
150      Insets insets = parent.getInsets();      Insets insets = parent.getInsets();
151      int x = insets.left + insets.right;      int x = 0;
152      int y = insets.bottom + insets.top;      int y = 0;
153    
154      Component[] children = parent.getComponents();      Component[] children = parent.getComponents();
155    
156      if (isHorizontalIn(parent))      if (isHorizontalIn(parent))
157        {                {        
158            x = insets.left + insets.right;
159          // sum up preferred widths of components, find maximum of preferred          // sum up preferred widths of components, find maximum of preferred
160          // heights          // heights
161          for (int index = 0; index < children.length; index++)          for (int index = 0; index < children.length; index++)
# Line 164  public class BoxLayout implements Layout Line 165  public class BoxLayout implements Layout
165              x += sz.width;              x += sz.width;
166              y = Math.max(y, sz.height);              y = Math.max(y, sz.height);
167            }            }
168            y += insets.bottom + insets.top;
169        }        }
170      else      else
171        {                {        
172            y = insets.top + insets.bottom;
173          // sum up preferred heights of components, find maximum of          // sum up preferred heights of components, find maximum of
174          //  preferred widths          //  preferred widths
175          for (int index = 0; index < children.length; index++)          for (int index = 0; index < children.length; index++)
# Line 176  public class BoxLayout implements Layout Line 179  public class BoxLayout implements Layout
179              y += sz.height;              y += sz.height;
180              x = Math.max(x, sz.width);              x = Math.max(x, sz.width);
181            }            }
182            x += insets.left + insets.right;
183        }        }
184        
185      return new Dimension(x, y);      return new Dimension(x, y);
186    }    }
187    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26