/** * Returns the left inset, unless the Insets are null in which case 0 is returned. * * @param insets the insets * @return the initial location. */ protected int getInitialLocation(Insets insets) { if (insets != null) return getSizeForPrimaryAxis(insets, true); return 0; }
/** * Returns the available width based on the container size and Insets. * * @param containerSize the size of the container * @param insets the insets * @return the available size. */ protected int getAvailableSize(Dimension containerSize, Insets insets) { if (insets == null) return getSizeForPrimaryAxis(containerSize); return (getSizeForPrimaryAxis(containerSize) - (getSizeForPrimaryAxis(insets, true) + getSizeForPrimaryAxis(insets, false))); }
/** * Returns the width of the passed in Components preferred size. * * @param c the component * @return the preferred size of the component. */ protected int getPreferredSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getPreferredSize()); }
/** * Returns the width of the passed in component. * * @param c the component * @return the size of the component. */ protected int getSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getSize()); }
/** * Returns the width of the passed in Components minimum size. * * @param c the component * @return the minimum size of the component. */ int getMinimumSizeOfComponent(Component c) { return getSizeForPrimaryAxis(c.getMinimumSize()); }
private void setComponentSizeByGap(int index, int gap) { if (SystemInfo.isJdk15Above() && _target.getComponent(index).isMinimumSizeSet()) { setComponentSize(index, Math.max(_componentSizes[index] + gap, getSizeForPrimaryAxis(_target.getComponent(index).getMinimumSize()))); } else { setComponentSize(index, _componentSizes[index] + gap); } }
prePrimary += getSizeForPrimaryAxis(preferredSize); int secSize = getSizeForSecondaryAxis(preferredSize); if (secSize > preSecondary) prePrimary += getSizeForPrimaryAxis(insets, true) + getSizeForPrimaryAxis(insets, false); preSecondary += getSizeForSecondaryAxis(insets, true) + getSizeForSecondaryAxis(insets, false);
minPrimary += getSizeForPrimaryAxis(minimumSize); minPrimary += getSizeForPrimaryAxis(insets, true) + getSizeForPrimaryAxis(insets, false); minSecondary += getSizeForSecondaryAxis(insets, true) + getSizeForSecondaryAxis(insets, false);
int minimumSize = getSizeForPrimaryAxis(comp.getMinimumSize()); int preferredSize = getSizeForPrimaryAxis(getPreferredSizeOf(comp, i)); if (FIX.equals(constraint)) { availableSizeExcludeFixed -= Math.max(preferredSize, minimumSize); int minimumSize = getSizeForPrimaryAxis(comp.getMinimumSize()); int preferredSize = getSizeForPrimaryAxis(getPreferredSizeOf(comp, i)); if (FIX.equals(constraint)) { setComponentSize(i, Math.max(preferredSize, minimumSize)); int minimumSize = getSizeForPrimaryAxis(comp.getMinimumSize()); int preferredSize = getSizeForPrimaryAxis(getPreferredSizeOf(comp, i)); if (FIX.equals(constraint)) { setComponentSize(i, Math.max(preferredSize, minimumSize));
totalSize += componentSize; boolean containerResized = totalSize + getGapSize() != getSizeForPrimaryAxis(containerSize); if (containerResized) { int availableSize = getAvailableSize(containerSize, insets); int location = getSizeForPrimaryAxis(insets, true); boolean needRedoLayout = false; if (!ltr && resolveAxis(_axis, o) == X_AXIS) {