/** * Creates a CellConstraints object that can be used by the FormLayout. * * @returns a CellConstraints object based on this definition */ public CellConstraints createCellConstraints() { return (CellConstraints) getConstraints().clone(); }
/** * Looks up and returns the constraints for the specified component. * A copy of the actual <code>CellConstraints</code> object is returned. * * @param component the component to be queried * @return the <code>CellConstraints</code> for the specified component * @throws NullPointerException if component is <code>null</code> or * has not been added to the container */ public CellConstraints getConstraints(Component component) { return (CellConstraints) getConstraints0(component).clone(); }
/** * Looks up and returns the constraints for the specified component. A copy * of the actual <code>CellConstraints</code> object is returned. * * @param component * the component to be queried * @return the <code>CellConstraints</code> for the specified component * @throws NullPointerException * if component is <code>null</code> or has not been added to * the container */ public CellConstraints getConstraints(Component component) { if (component == null) throw new NullPointerException("The component must not be null."); CellConstraints constraints = (CellConstraints) constraintMap.get(component); if (constraints == null) throw new NullPointerException("The component has not been added to the container."); return (CellConstraints) constraints.clone(); }
/** * Looks up and returns the constraints for the specified component. * A copy of the actualCellConstraints object is returned. * * @param component the component to be queried * @return the CellConstraints for the specified component * @throws NullPointerException if {@code component} is {@code null} * @throws IllegalStateException if {@code component} has not been * added to the container */ public CellConstraints getConstraints(Component component) { return (CellConstraints) getConstraints0(component).clone(); }
/** * Sets the constraints for the specified component in this layout. * * @param component the component to be modified * @param constraints the constraints to be applied * @throws NullPointerException if the component or constraints object * is <code>null</code> */ public void setConstraints(Component component, CellConstraints constraints) { if (component == null) throw new NullPointerException("The component must not be null."); if (constraints == null) throw new NullPointerException("The constraints must not be null."); constraints.ensureValidGridBounds(getColumnCount(), getRowCount()); constraintMap.put(component, constraints.clone()); }
/** * Sets the constraints for the specified component in this layout. * * @param component * the component to be modified * @param constraints * the constraints to be applied * @throws NullPointerException * if the component or constraints object is <code>null</code> */ public void setConstraints(Component component, CellConstraints constraints) { if (component == null) throw new NullPointerException("The component must not be null."); if (constraints == null) throw new NullPointerException("The constraints must not be null."); constraints.ensureValidGridBounds(getColumnCount(), getRowCount()); constraintMap.put(component, constraints.clone()); }
private CellConstraints deriveCellConstraints(int component, int logicalColumn, int logicalRow) { CellConstraints constraints = format.getConstraints(component); constraints = (CellConstraints)constraints.clone(); constraints.gridX += logicalToLayoutColumn(logicalColumn) + (logicalColumn > 0 && gapColumn != null ? 1 : 0); constraints.gridY += logicalToLayoutRow(logicalRow) + (logicalRow > 0 && gapRow != null ? 1 : 0); return constraints; }
private CellConstraints deriveCellConstraints(int component, int logicalColumn, int logicalRow) { CellConstraints constraints = format.getConstraints(component); constraints = (CellConstraints)constraints.clone(); constraints.gridX += logicalToLayoutColumn(logicalColumn) + (logicalColumn > 0 && gapColumn != null ? 1 : 0); constraints.gridY += logicalToLayoutRow(logicalRow) + (logicalRow > 0 && gapRow != null ? 1 : 0); return constraints; }
private CellConstraints deriveCellConstraints(int component, int logicalColumn, int logicalRow) { CellConstraints constraints = format.getConstraints(component); constraints = (CellConstraints)constraints.clone(); constraints.gridX += logicalToLayoutColumn(logicalColumn) + (logicalColumn > 0 && gapColumn != null ? 1 : 0); constraints.gridY += logicalToLayoutRow(logicalRow) + (logicalRow > 0 && gapRow != null ? 1 : 0); return constraints; }
/** * Sets the constraints for the specified component in this layout. * * @param component the component to be modified * @param constraints the constraints to be applied * @throws NullPointerException if {@code component} or {@code constraints} * is {@code null} */ public void setConstraints(Component component, CellConstraints constraints) { checkNotNull(component, "The component must not be null."); checkNotNull(constraints, "The constraints must not be null."); constraints.ensureValidGridBounds(getColumnCount(), getRowCount()); constraintMap.put(component, (CellConstraints) constraints.clone()); }