ConstraintBuilder { public final ConstraintBuilder makeDefault() { defaultConstraints = (GridBagConstraints) constraints.clone(); return this; } 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 testMakeDefault() { GridBagConstraints defaults = builder.getConstraints(); assertEquals(defaults.fill, GridBagConstraints.NONE); builder.vfill().makeDefault(); builder.reset(); GridBagConstraints newConstraints = builder.getConstraints(); assertEquals(newConstraints.fill, GridBagConstraints.VERTICAL); }