diff options
author | Simon Rettberg | 2015-08-13 15:45:10 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-13 15:45:10 +0200 |
commit | 9693e1a8484cc7ab05e6d62bad7bfa561d4aa3d7 (patch) | |
tree | fc32e08b30d5643cf1bbd1753ec6f1cc076a8217 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper | |
parent | [client] Fix positioning of Wizard (diff) | |
download | tutor-module-9693e1a8484cc7ab05e6d62bad7bfa561d4aa3d7.tar.gz tutor-module-9693e1a8484cc7ab05e6d62bad7bfa561d4aa3d7.tar.xz tutor-module-9693e1a8484cc7ab05e6d62bad7bfa561d4aa3d7.zip |
[client] Layout tweaks, Change owner feature
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/GridManager.java | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/GridManager.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/GridManager.java index 8b941f6a..ef0bedef 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/GridManager.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/GridManager.java @@ -2,13 +2,13 @@ package org.openslx.dozmod.gui.helper; import java.awt.Color; import java.awt.Component; +import java.awt.Container; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.util.ArrayList; import javax.swing.Box; -import javax.swing.JComponent; import javax.swing.JPanel; /** @@ -22,7 +22,7 @@ public class GridManager { */ public static boolean debugEmptyCells = false; - private final JComponent container; + private final Container container; private final Insets defaultInsets; private final int columnCount; private final boolean strict; @@ -47,7 +47,7 @@ public class GridManager { * @param container The component to apply the layout to * @param columnCount The number of columns per row */ - public GridManager(JComponent container, int columnCount) { + public GridManager(Container container, int columnCount) { this(container, columnCount, true); } @@ -64,7 +64,7 @@ public class GridManager { * row is full, and will ignore calls to {@link #nextRow()} if * the current row is empty */ - public GridManager(JComponent container, int columnCount, boolean strict) { + public GridManager(Container container, int columnCount, boolean strict) { this(container, columnCount, strict, new Insets(1, 1, 1, 1)); } @@ -83,7 +83,7 @@ public class GridManager { * @param defaultInsets an {@link Insets} instance to use for every cell by * default */ - public GridManager(JComponent container, int columnCount, boolean strict, Insets defaultInsets) { + public GridManager(Container container, int columnCount, boolean strict, Insets defaultInsets) { this.defaultInsets = defaultInsets; this.container = container; this.columnCount = columnCount; @@ -109,6 +109,23 @@ public class GridManager { /** * Add the given component to the next free grid cell, applying the given + * horizontal cell-span. + * + * @param component Component to add + * @param spanX horizontal span + * @return A {@link GBC} instance that can be used to further influence the + * behavior of this component + * @throws IllegalArgumentException If there aren't enough columns left in + * the current row to add the given component with the desired + * horizontal span, or if one of the span parameters is + * <code>< 1</code> + */ + public GBC add(Component component, int spanX) { + return add(component, spanX, 1); + } + + /** + * Add the given component to the next free grid cell, applying the given * horizontal and vertical cell-span. * * @param component Component to add |