equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
979 |
979 |
980 /** |
980 /** |
981 * This method is obsolete and supplied for backwards |
981 * This method is obsolete and supplied for backwards |
982 * compatibility only; new code should call {@link |
982 * compatibility only; new code should call {@link |
983 * #getLayoutInfo(java.awt.Container, int) getLayoutInfo} instead. |
983 * #getLayoutInfo(java.awt.Container, int) getLayoutInfo} instead. |
984 * This method is the same as <code>getLayoutInfo</code>; |
984 * |
985 * refer to <code>getLayoutInfo</code> for details on parameters |
985 * Fills in an instance of {@code GridBagLayoutInfo} for the |
986 * and return value. |
986 * current set of managed children. This method is the same |
|
987 * as {@code getLayoutInfo}; refer to {@code getLayoutInfo} |
|
988 * description for details. |
|
989 * |
|
990 * @param parent the layout container |
|
991 * @param sizeflag either {@code PREFERREDSIZE} or {@code MINSIZE} |
|
992 * @return the {@code GridBagLayoutInfo} for the set of children |
987 */ |
993 */ |
988 protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag) { |
994 protected GridBagLayoutInfo GetLayoutInfo(Container parent, int sizeflag) { |
989 synchronized (parent.getTreeLock()) { |
995 synchronized (parent.getTreeLock()) { |
990 GridBagLayoutInfo r; |
996 GridBagLayoutInfo r; |
991 Component comp; |
997 Component comp; |
1609 Rectangle r) { |
1615 Rectangle r) { |
1610 AdjustForGravity(constraints, r); |
1616 AdjustForGravity(constraints, r); |
1611 } |
1617 } |
1612 |
1618 |
1613 /** |
1619 /** |
|
1620 * Adjusts the x, y, width, and height fields to the correct |
|
1621 * values depending on the constraint geometry and pads. |
|
1622 * <p> |
1614 * This method is obsolete and supplied for backwards |
1623 * This method is obsolete and supplied for backwards |
1615 * compatibility only; new code should call {@link |
1624 * compatibility only; new code should call {@link |
1616 * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) |
1625 * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) |
1617 * adjustForGravity} instead. |
1626 * adjustForGravity} instead. |
1618 * This method is the same as <code>adjustForGravity</code>; |
1627 * This method is the same as <code>adjustForGravity</code> |
1619 * refer to <code>adjustForGravity</code> for details |
1628 * |
1620 * on parameters. |
1629 * @param constraints the constraints to be applied |
|
1630 * @param r the {@code Rectangle} to be adjusted |
1621 */ |
1631 */ |
1622 protected void AdjustForGravity(GridBagConstraints constraints, |
1632 protected void AdjustForGravity(GridBagConstraints constraints, |
1623 Rectangle r) { |
1633 Rectangle r) { |
1624 int diffx, diffy; |
1634 int diffx, diffy; |
1625 int cellY = r.y; |
1635 int cellY = r.y; |
1993 |
2003 |
1994 /** |
2004 /** |
1995 * This method is obsolete and supplied for backwards |
2005 * This method is obsolete and supplied for backwards |
1996 * compatibility only; new code should call {@link |
2006 * compatibility only; new code should call {@link |
1997 * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. |
2007 * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. |
1998 * This method is the same as <code>getMinSize</code>; |
2008 * This method is the same as <code>getMinSize</code> |
1999 * refer to <code>getMinSize</code> for details on parameters |
2009 * |
2000 * and return value. |
2010 * @param parent the layout container |
|
2011 * @param info the layout info for this parent |
|
2012 * @return a <code>Dimension</code> object containing the |
|
2013 * minimum size |
2001 */ |
2014 */ |
2002 protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info) { |
2015 protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info) { |
2003 Dimension d = new Dimension(); |
2016 Dimension d = new Dimension(); |
2004 int i, t; |
2017 int i, t; |
2005 Insets insets = parent.getInsets(); |
2018 Insets insets = parent.getInsets(); |
2033 |
2046 |
2034 /** |
2047 /** |
2035 * This method is obsolete and supplied for backwards |
2048 * This method is obsolete and supplied for backwards |
2036 * compatibility only; new code should call {@link |
2049 * compatibility only; new code should call {@link |
2037 * #arrangeGrid(Container) arrangeGrid} instead. |
2050 * #arrangeGrid(Container) arrangeGrid} instead. |
2038 * This method is the same as <code>arrangeGrid</code>; |
2051 * This method is the same as <code>arrangeGrid</code> |
2039 * refer to <code>arrangeGrid</code> for details on the |
2052 * |
2040 * parameter. |
2053 * @param parent the layout container |
2041 */ |
2054 */ |
2042 protected void ArrangeGrid(Container parent) { |
2055 protected void ArrangeGrid(Container parent) { |
2043 Component comp; |
2056 Component comp; |
2044 int compindex; |
2057 int compindex; |
2045 GridBagConstraints constraints; |
2058 GridBagConstraints constraints; |