45 int minWidth[]; /* largest minWidth in each column */
46 int minHeight[]; /* largest minHeight in each row */
47 double weightX[]; /* largest weight in each column */
48 double weightY[]; /* largest weight in each row */
49 boolean hasBaseline; /* Whether or not baseline layout has been
50 * requested and one of the components
51 * has a valid baseline. */
52 // These are only valid if hasBaseline is true and are indexed by
53 // row.
54 short baselineType[]; /* The type of baseline for a particular
55 * row. A mix of the BaselineResizeBehavior
56 * constants (1 << ordinal()) */
57 int maxAscent[]; /* Max ascent (baseline). */
58 int maxDescent[]; /* Max descent (height - baseline) */
59
60 /**
61 * Creates an instance of GridBagLayoutInfo representing {@code GridBagLayout}
62 * grid cells with it's own parameters.
63 * @param width the columns
64 * @param height the rows
65 * @since 6.0
66 */
67 GridBagLayoutInfo(int width, int height) {
68 this.width = width;
69 this.height = height;
70 }
71
72 /**
73 * Returns true if the specified row has any component aligned on the
74 * baseline with a baseline resize behavior of CONSTANT_DESCENT.
75 */
76 boolean hasConstantDescent(int row) {
77 return ((baselineType[row] & (1 << Component.BaselineResizeBehavior.
78 CONSTANT_DESCENT.ordinal())) != 0);
79 }
80
81 /**
82 * Returns true if there is a baseline for the specified row.
83 */
84 boolean hasBaseline(int row) {
85 return (hasBaseline && baselineType[row] != 0);
|
45 int minWidth[]; /* largest minWidth in each column */
46 int minHeight[]; /* largest minHeight in each row */
47 double weightX[]; /* largest weight in each column */
48 double weightY[]; /* largest weight in each row */
49 boolean hasBaseline; /* Whether or not baseline layout has been
50 * requested and one of the components
51 * has a valid baseline. */
52 // These are only valid if hasBaseline is true and are indexed by
53 // row.
54 short baselineType[]; /* The type of baseline for a particular
55 * row. A mix of the BaselineResizeBehavior
56 * constants (1 << ordinal()) */
57 int maxAscent[]; /* Max ascent (baseline). */
58 int maxDescent[]; /* Max descent (height - baseline) */
59
60 /**
61 * Creates an instance of GridBagLayoutInfo representing {@code GridBagLayout}
62 * grid cells with it's own parameters.
63 * @param width the columns
64 * @param height the rows
65 * @since 1.6
66 */
67 GridBagLayoutInfo(int width, int height) {
68 this.width = width;
69 this.height = height;
70 }
71
72 /**
73 * Returns true if the specified row has any component aligned on the
74 * baseline with a baseline resize behavior of CONSTANT_DESCENT.
75 */
76 boolean hasConstantDescent(int row) {
77 return ((baselineType[row] & (1 << Component.BaselineResizeBehavior.
78 CONSTANT_DESCENT.ordinal())) != 0);
79 }
80
81 /**
82 * Returns true if there is a baseline for the specified row.
83 */
84 boolean hasBaseline(int row) {
85 return (hasBaseline && baselineType[row] != 0);
|