diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-08 22:39:59 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-08 22:39:59 -0300 |
| commit | c82e3b3b2de0633317ec8fc85925e91422820597 (patch) | |
| tree | 96567416ce23c5ce85601f9cedc3a94bb1c55cba /base/src/main/java/bjc/utils/gui/layout | |
| parent | b3ac1c8690c3e14c879913e5dcc03a5f5e14876e (diff) | |
Start splitting into maven modules
Diffstat (limited to 'base/src/main/java/bjc/utils/gui/layout')
3 files changed, 72 insertions, 0 deletions
diff --git a/base/src/main/java/bjc/utils/gui/layout/AutosizeLayout.java b/base/src/main/java/bjc/utils/gui/layout/AutosizeLayout.java new file mode 100644 index 0000000..6f384f2 --- /dev/null +++ b/base/src/main/java/bjc/utils/gui/layout/AutosizeLayout.java @@ -0,0 +1,22 @@ +package bjc.utils.gui.layout; + +import java.awt.GridLayout; + +/** + * A layout that simply holds one component that it auto-resizes whenever it is + * resized. + * + * @author ben + * + */ +public class AutosizeLayout extends GridLayout { + // Version id for serialization + private static final long serialVersionUID = -2495693595953396924L; + + /** + * Create a new auto-size layout. + */ + public AutosizeLayout() { + super(1, 1); + } +} diff --git a/base/src/main/java/bjc/utils/gui/layout/HLayout.java b/base/src/main/java/bjc/utils/gui/layout/HLayout.java new file mode 100644 index 0000000..4ed1661 --- /dev/null +++ b/base/src/main/java/bjc/utils/gui/layout/HLayout.java @@ -0,0 +1,25 @@ +package bjc.utils.gui.layout; + +import java.awt.GridLayout; + +/** + * A layout manager that lays out its components horizontally, evenly sizing + * them. + * + * @author ben + * + */ +public class HLayout extends GridLayout { + // Version ID for serialization + private static final long serialVersionUID = 1244964456966270026L; + + /** + * Create a new horizontal layout with the specified number of columns. + * + * @param columns + * The number of columns in this layout. + */ + public HLayout(final int columns) { + super(1, columns); + } +} diff --git a/base/src/main/java/bjc/utils/gui/layout/VLayout.java b/base/src/main/java/bjc/utils/gui/layout/VLayout.java new file mode 100644 index 0000000..6993365 --- /dev/null +++ b/base/src/main/java/bjc/utils/gui/layout/VLayout.java @@ -0,0 +1,25 @@ +package bjc.utils.gui.layout; + +import java.awt.GridLayout; + +/** + * A layout that lays out its components vertically, evenly sharing space among + * them. + * + * @author ben + * + */ +public class VLayout extends GridLayout { + // Version ID for serializations + private static final long serialVersionUID = -6417962941602322663L; + + /** + * Create a new vertical layout with the specified number of rows. + * + * @param rows + * The number of rows. + */ + public VLayout(final int rows) { + super(rows, 1); + } +} |
