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; }
if (cw.cc.getHorizontal().getGapAfter() == null) cw.setGaps(flGap, 3); if (cw.cc.getHorizontal().getGapBefore() == null) cw.setGaps(flGap, 1);
boolean noGrowAdd = cc.getHorizontal().getGrow() != null && cc.getHorizontal().getGrow().intValue() == 100 && cc.getVertical().getGrow() != null && cc.getVertical().getGrow().intValue() == 100; addComponentDimConstraintString(cc.getHorizontal(), sb, asAPI, true, noGrowAdd); addComponentDimConstraintString(cc.getVertical(), sb, asAPI, false, noGrowAdd); if (noGrowAdd)
doAgain |= doAbsoluteCorrections(cw, bounds); if (!doAgain) { // If we are going to do this again, do not bother this time around if (cw.cc.getHorizontal().getEndGroup() != null) endGrpXMap = addToEndGroup(endGrpXMap, cw.cc.getHorizontal().getEndGroup(), cw.x + cw.w); if (cw.cc.getHorizontal().getEndGroup() != null) cw.w = endGrpXMap.get(cw.cc.getHorizontal().getEndGroup()) - cw.x;
cc.getHorizontal().setShrink(parseFloat(part.substring(ix).trim(), ResizeConstraint.WEIGHT_100)); continue; if (ix > -1) { String[] shrinks = toTrimmedTokens(part.substring(ix).trim(), ' '); cc.getHorizontal().setShrink(parseFloat(shrinks[0], ResizeConstraint.WEIGHT_100)); if (shrinks.length > 1) cc.getVertical().setShrink(parseFloat(shrinks[1], ResizeConstraint.WEIGHT_100)); 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])); char lc = part.charAt(ix - 1); if (lc != 'y') cc.getHorizontal().setSizeGroup(sg); if (lc != 'x') cc.getVertical().setSizeGroup(sg); ix = startsWithLenient(part, "growx", 5, true); if (ix > -1) { cc.getHorizontal().setGrow(parseFloat(part.substring(ix).trim(), ResizeConstraint.WEIGHT_100)); continue;
if (rootCc.getHorizontal().getSizeGroup() != null) sizeGroupsX++; if (rootCc.getVertical().getSizeGroup() != null) if (cc.getHorizontal().getSizeGroup() != null) sizeGroupsX++; if (cc.getVertical().getSizeGroup() != null) for (int i = 0; i < cell.compWraps.size(); i++) { 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