private double constrain(ContainerWrapper parent, double winSize, double prefSize, BoundSize constrain) { if (constrain == null) return winSize; double retSize = winSize; UnitValue wUV = constrain.getPreferred(); if (wUV != null) retSize = wUV.getPixels((float) prefSize, parent, parent); retSize = constrain.constrain((int) Math.ceil(retSize), (float) prefSize, parent); return constrain.getGapPush() ? Math.max(winSize, retSize) : retSize; }
private int constrain(ContainerWrapper parent, int winSize, int prefSize, BoundSize constrain) { if (constrain == null) return winSize; int retSize = winSize; UnitValue wUV = constrain.getPreferred(); if (wUV != null) retSize = wUV.getPixels(prefSize, parent, parent); retSize = constrain.constrain(retSize, prefSize, parent); return constrain.getGapPush() ? Math.max(winSize, retSize) : retSize; }
private static void appendBoundSize(BoundSize size, StringBuffer sb, boolean isHor, boolean asAPI) if (size.getPreferred() == null) { if (size.getMin() == null) { if (asAPI) {
static BoundSize derive(BoundSize bs, UnitValue min, UnitValue pref, UnitValue max) { if (bs == null || bs.isUnset()) return new BoundSize(min, pref, max, null); return new BoundSize( min != null ? min : bs.getMin(), pref != null ? pref : bs.getPreferred(), max != null ? max : bs.getMax(), bs.getGapPush(), null); }
dc.setSize(new BoundSize( isMin ? uv : dc.getSize().getMin(), dc.getSize().getPreferred(), isMin ? (dc.getSize().getMax()) : uv, uvStr