megamek.client.ui
Class GBC

java.lang.Object
  extended by java.awt.GridBagConstraints
      extended by megamek.client.ui.GBC
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GBC
extends java.awt.GridBagConstraints

A helper class for setting line-wise GridBagLayouts Do not use this if you need a Component to span two rows

Author:
beerockxs
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.GridBagConstraints
ABOVE_BASELINE, ABOVE_BASELINE_LEADING, ABOVE_BASELINE_TRAILING, anchor, BASELINE, BASELINE_LEADING, BASELINE_TRAILING, BELOW_BASELINE, BELOW_BASELINE_LEADING, BELOW_BASELINE_TRAILING, BOTH, CENTER, EAST, fill, FIRST_LINE_END, FIRST_LINE_START, gridheight, gridwidth, gridx, gridy, HORIZONTAL, insets, ipadx, ipady, LAST_LINE_END, LAST_LINE_START, LINE_END, LINE_START, NONE, NORTH, NORTHEAST, NORTHWEST, PAGE_END, PAGE_START, RELATIVE, REMAINDER, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, weightx, weighty, WEST
 
Method Summary
 GBC anchor(int a)
          change the anchor of this GridBagConstraints
static GBC eol()
           
static GBC eop()
           
 GBC fill()
          set this GridBagConstraints so that the corresponding Component will fill horizontally and vertically.
 GBC fill(int value)
          set this GridBagConstraints so that the corresponding will fill according to the
 GBC gridheight(int height)
          Set the gridheight of this GridBagConstraints
 GBC gridwidth(int width)
          Set the gridwidth of this GridBagConstraints
 GBC gridx(int gridx)
          Set the gridx of this GridBagConstraints
 GBC gridy(int gridy)
          Set the gridy of this GridBagConstraints
 GBC insets(int left, int top, int right, int bottom)
          change the insets of this GridBagConstraints
 GBC pad(int padx, int pady)
          Set the padding of this GridBagConstraints
static GBC std()
           
 GBC weightx(double weight)
          Set the weightx of this GridBagConstraints
 GBC weighty(double weight)
          Set the weighty of this GridBagConstraints
 
Methods inherited from class java.awt.GridBagConstraints
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

std

public static GBC std()
Returns:
a standard GridBagConstraints, anchored to GridBagConstraints.WEST

eol

public static GBC eol()
Returns:
a GridBagConstraints that will have a component fill a line
See Also:
GridBagConstraints.REMAINDER

eop

public static GBC eop()
Returns:
a GridBagConstraints that will have a component fill a line, and have a 10 pixel inset to the south (ie. a paragraph)

anchor

public GBC anchor(int a)
change the anchor of this GridBagConstraints

Parameters:
a - the int anchor to set
Returns:
this
See Also:
GridBagConstraints.anchor

insets

public GBC insets(int left,
                  int top,
                  int right,
                  int bottom)
change the insets of this GridBagConstraints

Parameters:
left -
top -
right -
bottom -
Returns:
this
See Also:
GridBagConstraints.insets

fill

public GBC fill()
set this GridBagConstraints so that the corresponding Component will fill horizontally and vertically.

Returns:
this

fill

public GBC fill(int value)
set this GridBagConstraints so that the corresponding will fill according to the

Parameters:
value - either GridBagConstraints.HORIZONTAL, GridBagConstraints.VERTICAL or GridBagConstraints.BOTH and
Returns:
this

pad

public GBC pad(int padx,
               int pady)
Set the padding of this GridBagConstraints

Parameters:
padx - the int ipadx to set
pady - the int ipady to set
Returns:
this
See Also:
GridBagConstraints.ipadx, GridBagConstraints.ipady

gridx

public GBC gridx(int gridx)
Set the gridx of this GridBagConstraints

Parameters:
gridx - the int gridx to set
Returns:
this
See Also:
GridBagConstraints.gridx

gridy

public GBC gridy(int gridy)
Set the gridy of this GridBagConstraints

Parameters:
gridy - the int gridy to set
Returns:
this
See Also:
GridBagConstraints.gridy

gridheight

public GBC gridheight(int height)
Set the gridheight of this GridBagConstraints

Parameters:
gridheight - the int gridheight to set
Returns:
this
See Also:
GridBagConstraints.gridheight

gridwidth

public GBC gridwidth(int width)
Set the gridwidth of this GridBagConstraints

Parameters:
gridwidth - the int gridheight to set
Returns:
this
See Also:
GridBagConstraints.gridwidth

weightx

public GBC weightx(double weight)
Set the weightx of this GridBagConstraints

Parameters:
weight - the double weightx to set
Returns:
this
See Also:
GridBagConstraints.weightx

weighty

public GBC weighty(double weight)
Set the weighty of this GridBagConstraints

Parameters:
weight - the double weighty to set
Returns:
this
See Also:
GridBagConstraints.weighty