public static final int BOTTOM = 4;
public int getMarginBorderPadding(
CssContext cssCtx, int cbWidth, int which) {
BorderPropertySet border = getBorder(cssCtx);
RectPropertySet margin = getMarginRect(cbWidth, cssCtx);
RectPropertySet padding = getPaddingRect(cbWidth, cssCtx);
switch (which) {
case LEFT:
return (int) (margin.left() + border.left() + padding.left());
case RIGHT:
return (int) (margin.right() + border.right() + padding.right());
case TOP:
return (int) (margin.top() + border.top() + padding.top());
case BOTTOM:
return (int) (margin.bottom() + border.bottom() + padding.bottom());
default:
throw new IllegalArgumentException();
}
}