@Override protected HorizontalLayoutState getState() { return (HorizontalLayoutState) super.getState(); }
@Override protected FormLayoutState getState(boolean markAsDirty) { return (FormLayoutState) super.getState(markAsDirty); } }
@Override public boolean isSpacing() { return getState(false).spacing; }
@Override protected FormLayoutState getState() { return (FormLayoutState) super.getState(); }
@Override protected VerticalLayoutState getState() { return (VerticalLayoutState) super.getState(); }
@Override public void setSpacing(boolean spacing) { getState().spacing = spacing; }
@Override protected HorizontalLayoutState getState(boolean markAsDirty) { return (HorizontalLayoutState) super.getState(markAsDirty); }
@Override protected VerticalLayoutState getState(boolean markAsDirty) { return (VerticalLayoutState) super.getState(markAsDirty); }
private void componentRemoved(Component c) { getState().childData.remove(c); }
/** * Returns the expand ratio of given component. * * @param component * which expand ratios is requested * @return expand ratio of given component, 0.0f by default. */ public float getExpandRatio(Component component) { ChildComponentData childData = getState(false).childData.get(component); if (childData == null) { throw new IllegalArgumentException( "The given component is not a child of this layout"); } return childData.expandRatio; }
@Override public void setComponentAlignment(Component childComponent, Alignment alignment) { ChildComponentData childData = getState().childData.get(childComponent); if (childData != null) { // Alignments are bit masks childData.alignmentBitmask = alignment.getBitMask(); } else { throw new IllegalArgumentException( "Component must be added to layout before using setComponentAlignment()"); } }
@Override public Alignment getComponentAlignment(Component childComponent) { ChildComponentData childData = getState().childData.get(childComponent); if (childData == null) { throw new IllegalArgumentException( "The given component is not a child of this layout"); } return new Alignment(childData.alignmentBitmask); }
@Override public MarginInfo getMargin() { return new MarginInfo(getState(false).marginsBitmask); }
@Override public void setMargin(MarginInfo marginInfo) { getState().marginsBitmask = marginInfo.getBitMask(); }
ChildComponentData childData = getState().childData.get(component); if (childData == null) { throw new IllegalArgumentException(
private void componentAdded(Component c) { ChildComponentData ccd = new ChildComponentData(); ccd.alignmentBitmask = getDefaultComponentAlignment().getBitMask(); getState().childData.put(c, ccd); }