boolean hasGapAfter() { return gapAfter != null && gapAfter.isUnset() == false; }
boolean hasGapBefore() { return gapBefore != null && gapBefore.isUnset() == false; }
/** Returns the gaps as pixel values. * @param parent The parent. Used to get the pixel values. * @param defGap The default gap to use if there is no gap set on this object (i.e. it is null). * @param refSize The reference size used to get the pixel sizes. * @param before IF it is the gap before rather than the gap after to return. * @return The [min,preferred,max] sizes for the specified gap. Uses {@link net.miginfocom.layout.LayoutUtil#NOT_SET} * for gap sizes that are <code>null</code>. Returns <code>null</code> if there was no gap specified. A new and free to use array. */ int[] getRowGaps(ContainerWrapper parent, BoundSize defGap, int refSize, boolean before) { BoundSize gap = before ? gapBefore : gapAfter; if (gap == null || gap.isUnset()) gap = defGap; if (gap == null || gap.isUnset()) return null; int[] ret = new int[3]; for (int i = LayoutUtil.MIN; i <= LayoutUtil.MAX; i++) { UnitValue uv = gap.getSize(i); ret[i] = uv != null ? uv.getPixels(refSize, parent, null) : LayoutUtil.NOT_SET; } return ret; }
/** Returns the gaps as pixel values. * @param parent The parent. Used to get the pixel values. * @param comp The component that the gap is for. If not for a component it is <code>null</code>. * @param adjGap The gap that the adjacent component, if any, has towards <code>comp</code>. * @param adjacentComp The adjacent component if any. May be <code>null</code>. * @param refSize The reference size used to get the pixel sizes. * @param adjacentSide What side the <code>adjacentComp</code> is on. 0 = top, 1 = left, 2 = bottom, 3 = right. * @param tag The tag string that the component might be tagged with in the component constraints. May be <code>null</code>. * @param isLTR If it is left-to-right. * @return The [min,preferred,max] sizes for the specified gap. Uses {@link net.miginfocom.layout.LayoutUtil#NOT_SET} * for gap sizes that are <code>null</code>. Returns <code>null</code> if there was no gap specified. A new and free to use array. */ int[] getComponentGaps(ContainerWrapper parent, ComponentWrapper comp, BoundSize adjGap, ComponentWrapper adjacentComp, String tag, int refSize, int adjacentSide, boolean isLTR) { BoundSize gap = adjacentSide < 2 ? gapBefore : gapAfter; boolean hasGap = gap != null && gap.getGapPush(); if ((gap == null || gap.isUnset()) && (adjGap == null || adjGap.isUnset()) && comp != null) gap = PlatformDefaults.getDefaultComponentGap(comp, adjacentComp, adjacentSide + 1, tag, isLTR); if (gap == null) return hasGap ? new int[] {0, 0, LayoutUtil.NOT_SET} : null; int[] ret = new int[3]; for (int i = LayoutUtil.MIN; i <= LayoutUtil.MAX; i++) { UnitValue uv = gap.getSize(i); ret[i] = uv != null ? uv.getPixels(refSize, parent, null) : LayoutUtil.NOT_SET; } return ret; }
if (size.isUnset() == false) { if (asAPI) { sb.append(".size(\"").append(getBS(size)).append("\")");
private static void appendBoundSize(BoundSize size, StringBuffer sb, boolean isHor, boolean asAPI) if (size.isUnset() == false) { if (size.getPreferred() == null) { if (size.getMin() == null) {
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); }
if (!cSz.isUnset()) containerSize = cSz.constrain(containerSize, getParentSize(container, isHor), container);
} else { if (wrapGapSize.isUnset()) { retValues[i] = new int[] {defGapArr[0], defGapArr[1], defGapArr[2]}; } else {