@Test public void testReset() { GridBagConstraints defaults = builder.getConstraints(); builder.span(2,3); builder.reset(); assertConstraintsEqual(builder.getConstraints(), defaults); JPanel dummy = new JPanel(); builder.at(0,0).add(dummy); defaults.gridx = 1; defaults.gridy = 0; assertConstraintsEqual(builder.getConstraints(), defaults); defaults.gridx = 0; ++defaults.gridy; assertConstraintsEqual(builder.nextRow().getConstraints(), defaults); }
public final ConstraintBuilder reset() { defaultConstraints.gridx = constraints.gridx; defaultConstraints.gridy = constraints.gridy; defaultConstraints.gridheight = 1; defaultConstraints.gridwidth = 1; defaultConstraints.weightx = 0.0; defaultConstraints.weighty = 0.0; constraints = (GridBagConstraints) defaultConstraints.clone(); return this; }
ConstraintBuilder { public final ConstraintBuilder reset() { defaultConstraints.gridx = constraints.gridx; defaultConstraints.gridy = constraints.gridy; defaultConstraints.gridheight = 1; defaultConstraints.gridwidth = 1; defaultConstraints.weightx = 0.0; defaultConstraints.weighty = 0.0; constraints = (GridBagConstraints) defaultConstraints.clone(); return this; } }
ConstraintBuilder { public final ConstraintBuilder reset() { defaultConstraints.gridx = constraints.gridx; defaultConstraints.gridy = constraints.gridy; defaultConstraints.gridheight = 1; defaultConstraints.gridwidth = 1; defaultConstraints.weightx = 0.0; defaultConstraints.weighty = 0.0; constraints = (GridBagConstraints) defaultConstraints.clone(); return this; } ConstraintBuilder(Container container); }
ConstraintBuilder { public final ConstraintBuilder reset() { defaultConstraints.gridx = constraints.gridx; defaultConstraints.gridy = constraints.gridy; defaultConstraints.gridheight = 1; defaultConstraints.gridwidth = 1; defaultConstraints.weightx = 0.0; defaultConstraints.weighty = 0.0; constraints = (GridBagConstraints) defaultConstraints.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); }
ConstraintBuilder { public final ConstraintBuilder reset() { defaultConstraints.gridx = constraints.gridx; defaultConstraints.gridy = constraints.gridy; defaultConstraints.gridheight = 1; defaultConstraints.gridwidth = 1; defaultConstraints.weightx = 0.0; defaultConstraints.weighty = 0.0; constraints = (GridBagConstraints) defaultConstraints.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; }