|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swpchat.client.gui.GbcControl
Class to handle GridBagLayout more comfortable. Example: this.setLayout(new GridBagLayout()); JButton button = new JButton(); GbcControl con = new GbcControl(); con.constrain( this, button, 0, // gridx 0, // gridy 1, // gridwidth 1, // gridheight GbcControl.CENTER );
Field Summary | |
static int |
BOTH
Components are scaled in both directions to the cell size (fill). |
static int |
CENTER
Put component in the center of the selected cell (anchor). |
private static int |
defaultAnchor
|
private static int |
defaultFill
|
private static int |
defaultGridheight
|
private static int |
defaultGridwidth
|
private static java.awt.Insets |
defaultInsets
|
private static double |
defaultWeightx
|
private static double |
defaultWeighty
|
static int |
EAST
Put component in the east of the selected cell (anchor). |
private java.awt.GridBagConstraints |
gbc
|
static int |
HORIZONTAL
Components are scaled horizontally to the cell size (fill). |
static int |
NONE
Components are not scaled to the cell size (fill). |
static int |
NORTH
Put component in the north of the selected cell (anchor). |
static int |
NORTHEAST
Put component in the northeast of the selected cell (anchor). |
static int |
NORTHWEST
Put component in the northwest of the selected cell (anchor). |
static int |
SOUTH
Put component in the south of the selected cell (anchor). |
static int |
SOUTHEAST
Put component in the southeast of the selected cell (anchor). |
static int |
SOUTHWEST
Put component in the southwest of the selected cell (anchor). |
static int |
VERTICAL
Components not scaled vertically to the cell size (fill). |
static int |
WEST
Put component in the west of the selected cell (anchor). |
Constructor Summary | |
GbcControl()
creates instance of GbcControl and sets default values. |
Method Summary | |
void |
constrain(java.awt.Container container,
java.awt.Component component,
int gridx,
int gridy)
Adds the component to the container with the specified gbc settings. |
void |
constrain(java.awt.Container container,
java.awt.Component component,
int gridx,
int gridy,
int gridwidth,
int gridheight)
Adds the component to the container with the specified gbc settings. |
void |
constrain(java.awt.Container container,
java.awt.Component component,
int gridx,
int gridy,
int gridwidth,
int gridheight,
int anchor)
Adds the component to the container with the specified gbc settings. |
void |
constrain(java.awt.Container container,
java.awt.Component component,
int gridx,
int gridy,
int gridwidth,
int gridheight,
int anchor,
java.awt.Insets insets)
Adds the component to the container with the specified gbc settings. |
void |
setAnchor(int anchor)
Sets anchor to the specified value. |
void |
setBottomInset(int inset)
Sets the bottom inset to the specified value. |
void |
setFill(int fill)
Sets fill to the specified value. |
void |
setInsets(java.awt.Insets insets)
Sets the insets to the specified value. |
void |
setLeftInset(int inset)
Sets the left inset to the specified value. |
void |
setRightInset(int inset)
Sets the right inset to the specified value. |
void |
setTopInset(int inset)
Sets the top inset to the specified value. |
void |
setWeightx(double weightx)
Sets weightx to the specified value. |
void |
setWeighty(double weighty)
Sets weighty to the specified value. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int CENTER
public static final int NORTH
public static final int NORTHEAST
public static final int EAST
public static final int SOUTHEAST
public static final int SOUTH
public static final int SOUTHWEST
public static final int WEST
public static final int NORTHWEST
public static final int NONE
public static final int BOTH
public static final int HORIZONTAL
public static final int VERTICAL
private static final java.awt.Insets defaultInsets
private static final int defaultGridwidth
private static final int defaultGridheight
private static final int defaultFill
private static final int defaultAnchor
private static final double defaultWeightx
private static final double defaultWeighty
private java.awt.GridBagConstraints gbc
Constructor Detail |
public GbcControl()
Method Detail |
public void constrain(java.awt.Container container, java.awt.Component component, int gridx, int gridy)
public void constrain(java.awt.Container container, java.awt.Component component, int gridx, int gridy, int gridwidth, int gridheight)
public void constrain(java.awt.Container container, java.awt.Component component, int gridx, int gridy, int gridwidth, int gridheight, int anchor)
public void constrain(java.awt.Container container, java.awt.Component component, int gridx, int gridy, int gridwidth, int gridheight, int anchor, java.awt.Insets insets)
public void setInsets(java.awt.Insets insets)
public void setLeftInset(int inset)
public void setRightInset(int inset)
public void setTopInset(int inset)
public void setBottomInset(int inset)
public void setWeightx(double weightx)
public void setWeighty(double weighty)
public void setAnchor(int anchor)
public void setFill(int fill)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |