/** Height units: {@link #UNITS_PIXELS}, {@link #UNITS_PERCENTAGE} */ @Deprecated default int getHeightUnits() { return ComponentsHelper.convertFromSizeUnit(getHeightSizeUnit()); }
public static boolean hasFullHeight(Component c) { return (int) c.getHeight() == 100 && c.getHeightSizeUnit() == SizeUnit.PERCENTAGE; }
public static String getComponentHeight(Component c) { float height = c.getHeight(); SizeUnit heightUnit = c.getHeightSizeUnit(); return height + heightUnit.getSymbol(); }
@Nonnull @Override public List<LayoutTip> analyze(Component c, String path) { if (c instanceof Window && c.getHeight() < 0) { List<LayoutTip> tips = null; ComponentContainer container = (ComponentContainer) c; for (Component component : container.getOwnComponents()) { if (tips == null) { tips = new ArrayList<>(); } if (component.getHeightSizeUnit() == SizeUnit.PERCENTAGE && component.getHeight() > 0) { String id = component.getId() != null ? component.getId() : component.getClass().getSimpleName(); tips.add(warn("Nested component '" + id + "'", "Nested component has relative height %s%% inside window with undefined height", component.getHeight())); } } return tips != null ? tips : Collections.<LayoutTip>emptyList(); } return Collections.emptyList(); } }
private boolean isSizeIgnored(ExpandingLayout container, Component component) { return container.getExpandDirection() == ExpandDirection.HORIZONTAL && component.getWidthSizeUnit() == SizeUnit.PERCENTAGE && component.getWidth() > 0 || container.getExpandDirection() == ExpandDirection.VERTICAL && component.getHeightSizeUnit() == SizeUnit.PERCENTAGE && component.getHeight() > 0; } }
if (component.getHeight() > 0 && component.getHeightSizeUnit() == SizeUnit.PERCENTAGE) { if (tips == null) { tips = new ArrayList<>();
if (component.getHeightSizeUnit() == SizeUnit.PERCENTAGE && component.getHeight() > 0) { if (tips == null) { tips = new ArrayList<>();