/** Sets gap between two cells in the grid. Note that this is not a gap between component IN a cell, that has to be set * on the component constraints. The value will be the min and preferred size of the gap. * @param x The value that will be transformed to pixels. If <code>null</code> the current value will not change. * @param y The value that will be transformed to pixels. If <code>null</code> the current value will not change. */ public static void setGridCellGap(UnitValue x, UnitValue y) { if (x != null) DEF_HGAP = new BoundSize(x, x, null, null); if (y != null) DEF_VGAP = new BoundSize(y, y, null, null); MOD_COUNT++; }
/** Sets gap value for components that are "unrelated". * @param x The value that will be transformed to pixels. If <code>null</code> the current value will not change. * @param y The value that will be transformed to pixels. If <code>null</code> the current value will not change. */ public static void setUnrelatedGap(UnitValue x, UnitValue y) { setUnitValue(new String[] {"u", "unrel", "unrelated"}, x, y); UNRELATED_X = new BoundSize(x, x, null, "unrel:unrel"); UNRELATED_Y = new BoundSize(y, y, null, "unrel:unrel"); }
/** Sets gap value for components that are "related". * @param x The value that will be transformed to pixels. If <code>null</code> the current value will not change. * @param y The value that will be transformed to pixels. If <code>null</code> the current value will not change. */ public static void setRelatedGap(UnitValue x, UnitValue y) { setUnitValue(new String[] {"r", "rel", "related"}, x, y); RELATED_X = new BoundSize(x, x, null, "rel:rel"); RELATED_Y = new BoundSize(y, y, null, "rel:rel"); }
s = s.substring(0, l - (s.endsWith(":push") ? 5 : 4)); if (s.length() == 0) return new BoundSize(null, null, null, true, cs); s0 = s0.substring(0, s0.length() - 1); UnitValue uv = parseUnitValue(s0, null, isHor); return new BoundSize(((isGap || hasEM) ? uv : null), uv, (hasEM ? uv : null), push, cs); return new BoundSize(parseUnitValue(s0, null, isHor), parseUnitValue(sizes[1], null, isHor), null, push, cs); } else if (sizes.length == 3) { return new BoundSize(parseUnitValue(s0, null, isHor), parseUnitValue(sizes[1], null, isHor), parseUnitValue(sizes[2], null, isHor), push, cs); } else { throw new IllegalArgumentException("Min:Preferred:Max size section must contain 0, 1 or 2 colons. '" + cs + "'");
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); }
boolean isMin = part.charAt(3) == 'n'; DimConstraint dc = isHor ? cc.getHorizontal() : cc.getVertical(); dc.setSize(new BoundSize( isMin ? uv : dc.getSize().getMin(), dc.getSize().getPreferred(),