@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 void setComponentAlignment(Component childComponent, Alignment alignment) { ChildComponentData childComponentData = getState().childData .get(childComponent); if (childComponentData == null) { throw new IllegalArgumentException( "Component must be added to layout before using setComponentAlignment()"); } else { if (alignment == null) { childComponentData.alignment = GridLayoutState.ALIGNMENT_DEFAULT .getBitMask(); } else { childComponentData.alignment = alignment.getBitMask(); } } }
private void componentAdded(Component c) { ChildComponentData ccd = new ChildComponentData(); ccd.alignmentBitmask = getDefaultComponentAlignment().getBitMask(); getState().childData.put(c, ccd); }
/** * <p> * Construct a new area on a grid. * </p> * * @param component * the component connected to the area. * @param column1 * The column of the upper left corner cell of the area. The * leftmost column has index 0. * @param row1 * The row of the upper left corner cell of the area. The * topmost row has index 0. * @param column2 * The column of the lower right corner cell of the area. The * leftmost column has index 0. * @param row2 * The row of the lower right corner cell of the area. The * topmost row has index 0. */ public Area(Component component, int column1, int row1, int column2, int row2) { this.component = component; childData = new ChildComponentData(); childData.alignment = getDefaultComponentAlignment().getBitMask(); childData.column1 = column1; childData.row1 = row1; childData.column2 = column2; childData.row2 = row2; }
/** * Sets opening direction for the popup. At the moment only support values are * {@link com.vaadin.ui.Alignment#BOTTOM_LEFT}, {@link com.vaadin.ui.Alignment#BOTTOM_CENTER} and * {@link com.vaadin.ui.Alignment#BOTTOM_RIGHT}. * * Default is {@link com.vaadin.ui.Alignment#BOTTOM_RIGHT}. */ public void setDirection(final Alignment direction) { if (direction == null) { throw new IllegalArgumentException("direction cannot be null"); } this.direction = direction; getState().direction = direction.getBitMask(); }
/** * Sets opening direction for the popup. At the moment only support values are * {@link com.vaadin.ui.Alignment#BOTTOM_LEFT}, {@link com.vaadin.ui.Alignment#BOTTOM_CENTER} and * {@link com.vaadin.ui.Alignment#BOTTOM_RIGHT}. * * Default is {@link com.vaadin.ui.Alignment#BOTTOM_RIGHT}. */ public void setDirection(final Alignment direction) { if (direction == null) { throw new IllegalArgumentException("direction cannot be null"); } this.direction = direction; getState().direction = direction.getBitMask(); }
/** * Sets opening direction for the popup. At the moment only support values are * {@link Alignment#BOTTOM_LEFT}, {@link Alignment#BOTTOM_CENTER} and * {@link Alignment#BOTTOM_RIGHT}. * * Default is {@link Alignment#BOTTOM_RIGHT}. */ public void setDirection(final Alignment direction) { if (direction == null) { throw new IllegalArgumentException("direction cannot be null"); } this.direction = direction; getState().direction = direction.getBitMask(); }