|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 92-99
Link Here
|
| 92 |
int height = 0, width = 0; |
92 |
int height = 0, width = 0; |
| 93 |
for (int i = 0; i < children.size(); i++) { |
93 |
for (int i = 0; i < children.size(); i++) { |
| 94 |
child = (IFigure)children.get(i); |
94 |
child = (IFigure)children.get(i); |
| 95 |
childSize = transposer.t(preferred ? child.getPreferredSize(wHint, hHint) |
95 |
childSize = transposer.t(preferred ? getChildPreferredSize(child, wHint, hHint) |
| 96 |
: child.getMinimumSize(wHint, hHint)); |
96 |
: getChildMinimumSize(child, wHint, hHint)); |
| 97 |
height += childSize.height; |
97 |
height += childSize.height; |
| 98 |
width = Math.max(width, childSize.width); |
98 |
width = Math.max(width, childSize.width); |
| 99 |
} |
99 |
} |
|
Lines 185-190
Link Here
|
| 185 |
} |
185 |
} |
| 186 |
|
186 |
|
| 187 |
/** |
187 |
/** |
|
|
188 |
* @param child the figure whose minimum size is to be determined |
| 189 |
* @param wHint the width hint |
| 190 |
* @param hHint the height hint |
| 191 |
* @return the given figure's minimum size |
| 192 |
* @since 3.3 |
| 193 |
*/ |
| 194 |
protected Dimension getChildMinimumSize(IFigure child, int wHint, int hHint) { |
| 195 |
return child.getMinimumSize(wHint, hHint); |
| 196 |
} |
| 197 |
|
| 198 |
/** |
| 199 |
* @param child the figure whose preferred size is to be determined |
| 200 |
* @param wHint the width hint |
| 201 |
* @param hHint the height hint |
| 202 |
* @return given figure's preferred size |
| 203 |
* @since 3.3 |
| 204 |
*/ |
| 205 |
protected Dimension getChildPreferredSize(IFigure child, int wHint, int hHint) { |
| 206 |
return child.getPreferredSize(wHint, hHint); |
| 207 |
} |
| 208 |
|
| 209 |
/** |
| 188 |
* Returns the minor aligment of the layout. Minor minor axis is the axis perpindicular |
210 |
* Returns the minor aligment of the layout. Minor minor axis is the axis perpindicular |
| 189 |
* to the overall orientation set in the contructor. |
211 |
* to the overall orientation set in the contructor. |
| 190 |
* @return the minor aligment |
212 |
* @return the minor aligment |
|
Lines 276-283
Link Here
|
| 276 |
for (int i = 0; i < numChildren; i++) { |
298 |
for (int i = 0; i < numChildren; i++) { |
| 277 |
child = (IFigure)children.get(i); |
299 |
child = (IFigure)children.get(i); |
| 278 |
|
300 |
|
| 279 |
prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); |
301 |
prefSizes[i] = transposer.t(getChildPreferredSize(child, wHint, hHint)); |
| 280 |
minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); |
302 |
minSizes[i] = transposer.t(getChildMinimumSize(child, wHint, hHint)); |
| 281 |
|
303 |
|
| 282 |
totalHeight += prefSizes[i].height; |
304 |
totalHeight += prefSizes[i].height; |
| 283 |
totalMinHeight += minSizes[i].height; |
305 |
totalMinHeight += minSizes[i].height; |