ConstraintBuilder { GridBagConstraints getConstraints() { return (GridBagConstraints) constraints.clone(); } ConstraintBuilder(Container container); final ConstraintBuilder reset(); final ConstraintBuilder makeDefault(); ConstraintBuilder at(int row, int column); ConstraintBuilder span(int nRows, int nColumns); ConstraintBuilder insets(int top, int left, int bottom, int right); ConstraintBuilder hpad(int padding); ConstraintBuilder vpad(int padding); ConstraintBuilder baseline_w(); ConstraintBuilder baseline_centered(); ConstraintBuilder baseline_e(); ConstraintBuilder nw(); ConstraintBuilder sw(); ConstraintBuilder w(); ConstraintBuilder hfill(); ConstraintBuilder vfill(); ConstraintBuilder hvfill(); ConstraintBuilder weight(float weightx, float weighty); void add(Component component); ConstraintBuilder nextRow(); ConstraintBuilder nextColumn(); void add(Component... components); static Component hbox(int width); static Component hbox(int minWidth, int preferredWidth, int maxWidth); static final int DEFAULT_HPAD; }
@Test public void testInitialization() { GridBagConstraints defaults = new GridBagConstraints(); defaults.gridx = 0; defaults.gridy = 0; GridBagConstraints newConstraints = builder.getConstraints(); assertConstraintsEqual(newConstraints, defaults); }
@Test public void testgetConstraints() { GridBagConstraints constraints = builder.getConstraints(); assertNotSame(builder.getConstraints(), constraints); }