private static UnitValue correctAlign(CC cc, UnitValue rowAlign, boolean isHor, boolean fromEnd) { UnitValue align = (isHor ? cc.getHorizontal() : cc.getVertical()).getAlign(); if (align == null) align = rowAlign; if (align == UnitValue.BASELINE_IDENTITY) align = UnitValue.CENTER; if (fromEnd) { if (align == UnitValue.LEFT) align = UnitValue.RIGHT; else if (align == UnitValue.RIGHT) align = UnitValue.LEFT; } return align; }
private static void layoutBaseline(ContainerWrapper parent, ArrayList<CompWrap> compWraps, DimConstraint dc, int start, int size, int sizeType, int spanCount) { AboveBelow aboveBelow = getBaselineAboveBelow(compWraps, sizeType, true); int blRowSize = aboveBelow.sum(); CC cc = compWraps.get(0).cc; // Align for the whole baseline component array UnitValue align = cc.getVertical().getAlign(); if (spanCount == 1 && align == null) align = dc.getAlignOrDefault(false); if (align == UnitValue.BASELINE_IDENTITY) align = UnitValue.CENTER; int offset = start + aboveBelow.maxAbove + (align != null ? Math.max(0, align.getPixels(size - blRowSize, parent, null)) : 0); for (CompWrap cw : compWraps) { cw.y += offset; if (cw.y + cw.h > start + size) cw.h = start + size - cw.y; } }
cc.getVertical().getGrow() != null && cc.getVertical().getGrow().intValue() == 100; addComponentDimConstraintString(cc.getVertical(), sb, asAPI, false, noGrowAdd); if (noGrowAdd) sb.append(asAPI ? ".grow()" : ",grow"); // Combine ".growX().growY()" into ".grow()".
endGrpXMap = addToEndGroup(endGrpXMap, cw.cc.getHorizontal().getEndGroup(), cw.x + cw.w); if (cw.cc.getVertical().getEndGroup() != null) endGrpYMap = addToEndGroup(endGrpYMap, cw.cc.getVertical().getEndGroup(), cw.y + cw.h); cw.w = endGrpXMap.get(cw.cc.getHorizontal().getEndGroup()) - cw.x; if (cw.cc.getVertical().getEndGroup() != null) cw.h = endGrpYMap.get(cw.cc.getVertical().getEndGroup()) - cw.y;
cc.getVertical().setShrink(parseFloat(part.substring(ix).trim(), ResizeConstraint.WEIGHT_100)); continue; cc.getHorizontal().setShrink(parseFloat(shrinks[0], ResizeConstraint.WEIGHT_100)); if (shrinks.length > 1) cc.getVertical().setShrink(parseFloat(shrinks[1], ResizeConstraint.WEIGHT_100)); continue; String sp = part.substring(ix).trim(); if (sp.startsWith("x") || sp.startsWith("y")) { // To handle "gpx", "gpy", "shrinkpriorityx", shrinkpriorityy" (sp.startsWith("x") ? cc.getHorizontal() : cc.getVertical()).setShrinkPriority(Integer.parseInt(sp.substring(2))); } else { String[] shrinks = toTrimmedTokens(sp, ' '); cc.getHorizontal().setShrinkPriority(Integer.parseInt(shrinks[0])); if (shrinks.length > 1) cc.getVertical().setShrinkPriority(Integer.parseInt(shrinks[1])); cc.getHorizontal().setSizeGroup(sg); if (lc != 'x') cc.getVertical().setSizeGroup(sg); continue; cc.getVertical().setGrow(parseFloat(part.substring(ix).trim(), ResizeConstraint.WEIGHT_100)); continue; String[] grows = toTrimmedTokens(part.substring(ix).trim(), ' '); cc.getHorizontal().setGrow(parseFloat(grows[0], ResizeConstraint.WEIGHT_100)); cc.getVertical().setGrow(parseFloat(grows.length > 1 ? grows[1] : "", ResizeConstraint.WEIGHT_100)); continue;
if (rootCc.getVertical().getSizeGroup() != null) sizeGroupsY++; if (cc.getHorizontal().getSizeGroup() != null) sizeGroupsX++; if (cc.getVertical().getSizeGroup() != null) sizeGroupsY++; CompWrap cw = cell.compWraps.get(i); String sgx = cw.cc.getHorizontal().getSizeGroup(); String sgy = cw.cc.getVertical().getSizeGroup(); cw.setForcedSizes(sizeGroupMapX.get(cw.cc.getHorizontal().getSizeGroup()), true); // Target method handles null sizes if (sizeGroupMapY != null) cw.setForcedSizes(sizeGroupMapY.get(cw.cc.getVertical().getSizeGroup()), false); // Target method handles null sizes