public interface InCellGapProvider
E.g.:
if (adjacentComp == null || adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.TOP)
return null;
boolean isHor = (adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.RIGHT);
if (adjacentComp.getComponentType(false) == ComponentWrapper.TYPE_LABEL && comp.getComponentType(false) == ComponentWrapper.TYPE_TEXT_FIELD)
return isHor ? UNRELATED_Y : UNRELATED_Y;
return (adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.RIGHT) ? RELATED_X : RELATED_Y;
| Modifier and Type | Method and Description |
|---|---|
BoundSize |
getDefaultGap(ComponentWrapper comp,
ComponentWrapper adjacentComp,
int adjacentSide,
String tag,
boolean isLTR)
Returns the default gap between two components that are in the same cell.
|
BoundSize getDefaultGap(ComponentWrapper comp, ComponentWrapper adjacentComp, int adjacentSide, String tag, boolean isLTR)
comp - The component that the gap is for. Never null.adjacentComp - The adjacent component if any. May be null.adjacentSide - What side the adjacentComp is on. SwingUtilities or
SwingUtilities or SwingUtilities or SwingUtilities.tag - The tag string that the component might be tagged with in the component constraints. May be null.isLTR - If it is left-to-right.null if there should be no gap.Copyright © 2007–2021. All rights reserved.