currentDependencyTree.setNeedsVerticalMeasure(component, false);
}
+ public void reportHeightAssignedToRelative(ComponentConnector component,
+ int assignedHeight) {
+ assert component.isRelativeHeight();
+
+ float percentSize = parsePercent(component.getState().getHeight());
+ int effectiveHeight = Math.round(assignedHeight * (percentSize / 100));
+
+ reportOuterHeight(component, effectiveHeight);
+ }
+
+ public void reportWidthAssignedToRelative(ComponentConnector component,
+ int assignedWidth) {
+ assert component.isRelativeWidth();
+
+ float percentSize = parsePercent(component.getState().getWidth());
+ int effectiveWidth = Math.round(assignedWidth * (percentSize / 100));
+
+ reportOuterWidth(component, effectiveWidth);
+ }
+
+ private static float parsePercent(String size) {
+ return Float.parseFloat(size.substring(0, size.length() - 1));
+ }
+
public void reportOuterWidth(ComponentConnector component, int outerWidth) {
if (!isLayoutRunning()) {
throw new IllegalStateException(
- wrapper.getElement().getOffsetTop();
}
wrapperStyle.setHeight(h, Unit.PX);
- float percentSize = parsePercent(paintable.getState()
- .getHeight());
- int effectiveHeight = Math.round(h * (percentSize / 100));
- getLayoutManager()
- .reportOuterHeight(paintable, effectiveHeight);
+ getLayoutManager().reportHeightAssignedToRelative(paintable, h);
} else {
wrapperStyle.clearHeight();
}
}
}
- private static float parsePercent(String size) {
- return Float.parseFloat(size.substring(0, size.length() - 1));
- }
-
public void layoutHorizontally() {
VAbsoluteLayout layout = getWidget();
for (ComponentConnector paintable : getChildren()) {
- wrapper.getElement().getOffsetLeft();
}
wrapperStyle.setWidth(w, Unit.PX);
- float percentSize = parsePercent(paintable.getState()
- .getWidth());
- int effectiveWidth = Math.round(w * (percentSize / 100));
- getLayoutManager().reportOuterWidth(paintable, effectiveWidth);
+ getLayoutManager().reportWidthAssignedToRelative(paintable, w);
} else {
wrapperStyle.clearWidth();
}