summaryrefslogtreecommitdiff
path: root/src/unitConverter/converterGUI/GridBagBuilder.java
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-02-01 09:13:39 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2019-02-01 09:13:39 -0500
commita3dfff2c1a3a906fa2c3cb3f4cec1a150c5bf795 (patch)
treeb45241f4c56a055148f4a15a47d2d6ff04fd382a /src/unitConverter/converterGUI/GridBagBuilder.java
parent8ff06e8e5661645c00656c40d15c8d13db665b57 (diff)
parenta6a66e6fb11675e0ea738ad8d0b5a9ba7d2fac2b (diff)
Merge v0.1.0 into develop
Diffstat (limited to 'src/unitConverter/converterGUI/GridBagBuilder.java')
-rwxr-xr-xsrc/unitConverter/converterGUI/GridBagBuilder.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/unitConverter/converterGUI/GridBagBuilder.java b/src/unitConverter/converterGUI/GridBagBuilder.java
index 7a0615a..e036677 100755
--- a/src/unitConverter/converterGUI/GridBagBuilder.java
+++ b/src/unitConverter/converterGUI/GridBagBuilder.java
@@ -20,11 +20,16 @@ import java.awt.GridBagConstraints;
import java.awt.Insets;
/**
+ * A builder for Java's {@link java.awt.GridBagConstraints} class.
+ *
* @author Adrien Hopkins
* @since 2018-11-30
+ * @since v0.1.0
*/
final class GridBagBuilder {
/**
+ * The built {@code GridBagConstraints}'s {@code gridx} property.
+ * <p>
* Specifies the cell containing the leading edge of the component's display area, where the first cell in a row has
* <code>gridx=0</code>. The leading edge of a component's display area is its left edge for a horizontal,
* left-to-right container and its right edge for a horizontal, right-to-left container. The value
@@ -41,6 +46,8 @@ final class GridBagBuilder {
private final int gridx;
/**
+ * The built {@code GridBagConstraints}'s {@code gridy} property.
+ * <p>
* Specifies the cell at the top of the component's display area, where the topmost cell has <code>gridy=0</code>.
* The value <code>RELATIVE</code> specifies that the component be placed just below the component that was added to
* the container just before this component was added.
@@ -54,6 +61,8 @@ final class GridBagBuilder {
private final int gridy;
/**
+ * The built {@code GridBagConstraints}'s {@code gridwidth} property.
+ * <p>
* Specifies the number of cells in a row for the component's display area.
* <p>
* Use <code>REMAINDER</code> to specify that the component's display area will be from <code>gridx</code> to the
@@ -69,6 +78,8 @@ final class GridBagBuilder {
private final int gridwidth;
/**
+ * The built {@code GridBagConstraints}'s {@code gridheight} property.
+ * <p>
* Specifies the number of cells in a column for the component's display area.
* <p>
* Use <code>REMAINDER</code> to specify that the component's display area will be from <code>gridy</code> to the
@@ -84,6 +95,8 @@ final class GridBagBuilder {
private final int gridheight;
/**
+ * The built {@code GridBagConstraints}'s {@code weightx} property.
+ * <p>
* Specifies how to distribute extra horizontal space.
* <p>
* The grid bag layout manager calculates the weight of a column to be the maximum <code>weightx</code> of all the
@@ -103,6 +116,8 @@ final class GridBagBuilder {
private double weightx;
/**
+ * The built {@code GridBagConstraints}'s {@code weighty} property.
+ * <p>
* Specifies how to distribute extra vertical space.
* <p>
* The grid bag layout manager calculates the weight of a row to be the maximum <code>weighty</code> of all the
@@ -122,6 +137,8 @@ final class GridBagBuilder {
private double weighty;
/**
+ * The built {@code GridBagConstraints}'s {@code anchor} property.
+ * <p>
* This field is used when the component is smaller than its display area. It determines where, within the display
* area, to place the component.
* <p>
@@ -145,6 +162,8 @@ final class GridBagBuilder {
private int anchor;
/**
+ * The built {@code GridBagConstraints}'s {@code fill} property.
+ * <p>
* This field is used when the component's display area is larger than the component's requested size. It determines
* whether to resize the component, and if so, how.
* <p>
@@ -167,6 +186,8 @@ final class GridBagBuilder {
private int fill;
/**
+ * The built {@code GridBagConstraints}'s {@code insets} property.
+ * <p>
* This field specifies the external padding of the component, the minimum amount of space between the component and
* the edges of its display area.
* <p>
@@ -178,6 +199,8 @@ final class GridBagBuilder {
private Insets insets;
/**
+ * The built {@code GridBagConstraints}'s {@code ipadx} property.
+ * <p>
* This field specifies the internal padding of the component, how much space to add to the minimum width of the
* component. The width of the component is at least its minimum width plus <code>ipadx</code> pixels.
* <p>
@@ -190,6 +213,8 @@ final class GridBagBuilder {
private int ipadx;
/**
+ * The built {@code GridBagConstraints}'s {@code ipady} property.
+ * <p>
* This field specifies the internal padding, that is, how much space to add to the minimum height of the component.
* The height of the component is at least its minimum height plus <code>ipady</code> pixels.
* <p>
@@ -207,6 +232,7 @@ final class GridBagBuilder {
* @param gridy
* y position
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder(final int gridx, final int gridy) {
this(gridx, gridy, 1, 1);
@@ -222,6 +248,7 @@ final class GridBagBuilder {
* @param gridheight
* number of cells occupied vertically
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder(final int gridx, final int gridy, final int gridwidth, final int gridheight) {
this(gridx, gridy, gridwidth, gridheight, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE,
@@ -245,6 +272,7 @@ final class GridBagBuilder {
* @param ipadx
* @param ipady
* @since 2018-11-30
+ * @since v0.1.0
*/
private GridBagBuilder(final int gridx, final int gridy, final int gridwidth, final int gridheight,
final double weightx, final double weighty, final int anchor, final int fill, final Insets insets,
@@ -266,6 +294,7 @@ final class GridBagBuilder {
/**
* @return {@code GridBagConstraints} created by this builder
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagConstraints build() {
return new GridBagConstraints(this.gridx, this.gridy, this.gridwidth, this.gridheight, this.weightx,
@@ -275,6 +304,7 @@ final class GridBagBuilder {
/**
* @return anchor
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getAnchor() {
return this.anchor;
@@ -283,6 +313,7 @@ final class GridBagBuilder {
/**
* @return fill
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getFill() {
return this.fill;
@@ -291,6 +322,7 @@ final class GridBagBuilder {
/**
* @return gridheight
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getGridheight() {
return this.gridheight;
@@ -299,6 +331,7 @@ final class GridBagBuilder {
/**
* @return gridwidth
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getGridwidth() {
return this.gridwidth;
@@ -307,6 +340,7 @@ final class GridBagBuilder {
/**
* @return gridx
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getGridx() {
return this.gridx;
@@ -315,6 +349,7 @@ final class GridBagBuilder {
/**
* @return gridy
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getGridy() {
return this.gridy;
@@ -323,6 +358,7 @@ final class GridBagBuilder {
/**
* @return insets
* @since 2018-11-30
+ * @since v0.1.0
*/
public Insets getInsets() {
return this.insets;
@@ -331,6 +367,7 @@ final class GridBagBuilder {
/**
* @return ipadx
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getIpadx() {
return this.ipadx;
@@ -339,6 +376,7 @@ final class GridBagBuilder {
/**
* @return ipady
* @since 2018-11-30
+ * @since v0.1.0
*/
public int getIpady() {
return this.ipady;
@@ -347,6 +385,7 @@ final class GridBagBuilder {
/**
* @return weightx
* @since 2018-11-30
+ * @since v0.1.0
*/
public double getWeightx() {
return this.weightx;
@@ -355,6 +394,7 @@ final class GridBagBuilder {
/**
* @return weighty
* @since 2018-11-30
+ * @since v0.1.0
*/
public double getWeighty() {
return this.weighty;
@@ -364,6 +404,7 @@ final class GridBagBuilder {
* @param anchor
* anchor to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setAnchor(final int anchor) {
this.anchor = anchor;
@@ -374,6 +415,7 @@ final class GridBagBuilder {
* @param fill
* fill to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setFill(final int fill) {
this.fill = fill;
@@ -384,6 +426,7 @@ final class GridBagBuilder {
* @param insets
* insets to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setInsets(final Insets insets) {
this.insets = insets;
@@ -394,6 +437,7 @@ final class GridBagBuilder {
* @param ipadx
* ipadx to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setIpadx(final int ipadx) {
this.ipadx = ipadx;
@@ -404,6 +448,7 @@ final class GridBagBuilder {
* @param ipady
* ipady to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setIpady(final int ipady) {
this.ipady = ipady;
@@ -414,6 +459,7 @@ final class GridBagBuilder {
* @param weightx
* weightx to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setWeightx(final double weightx) {
this.weightx = weightx;
@@ -424,6 +470,7 @@ final class GridBagBuilder {
* @param weighty
* weighty to set
* @since 2018-11-30
+ * @since v0.1.0
*/
public GridBagBuilder setWeighty(final double weighty) {
this.weighty = weighty;