view
Class MyGridBagConstraints

java.lang.Object
  extended by java.awt.GridBagConstraints
      extended by view.MyGridBagConstraints
All Implemented Interfaces:
Serializable, Cloneable

public class MyGridBagConstraints
extends GridBagConstraints

Make handling of GridBagConstraints easier. Provides factory methods that can deliver gridbags out of various sources.

See Also:
Serialized Form

Field Summary
static String ANCHOR
           
static String FILL
           
static String GRIDHEIGHT
           
static String GRIDWIDTH
           
static String GRIDX
           
static String GRIDY
           
static String INSETS
           
static String IPADX
           
static String IPADY
           
static String WEIGHTX
           
static String WEIGHTY
           
 
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
 
Constructor Summary
MyGridBagConstraints()
           
 
Method Summary
static GridBagConstraints get()
           
static GridBagConstraints get(int gridx, int gridy)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight, double wx, double wy)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight, int anchor)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight, int anchor, int fill)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight, int anchor, int fill, double wx, double wy)
           
static GridBagConstraints get(int gridx, int gridy, int gwidth, int gheight, int anchor, int fill, double wx, double wy, Insets inset)
          Constructs a new GridBagConstraints with the specified variables.
static GridBagConstraints get(Map<String,String> map)
          Constructs a new grid bag constraint using a mapping of keywords to values, either strings or Numbers (if possible).
 String toString()
           
static String toString(GridBagConstraints g)
          Does a better representation.
static GridBagConstraints update(JComponent putin, GridBagConstraints gb)
          Scans the jcomponent in the argument for any of the alignment keys.
 
Methods inherited from class java.awt.GridBagConstraints
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANCHOR

public static final String ANCHOR
See Also:
Constant Field Values

FILL

public static final String FILL
See Also:
Constant Field Values

GRIDX

public static final String GRIDX
See Also:
Constant Field Values

GRIDY

public static final String GRIDY
See Also:
Constant Field Values

GRIDWIDTH

public static final String GRIDWIDTH
See Also:
Constant Field Values

GRIDHEIGHT

public static final String GRIDHEIGHT
See Also:
Constant Field Values

INSETS

public static final String INSETS
See Also:
Constant Field Values

IPADX

public static final String IPADX
See Also:
Constant Field Values

IPADY

public static final String IPADY
See Also:
Constant Field Values

WEIGHTX

public static final String WEIGHTX
See Also:
Constant Field Values

WEIGHTY

public static final String WEIGHTY
See Also:
Constant Field Values
Constructor Detail

MyGridBagConstraints

public MyGridBagConstraints()
Method Detail

get

public static GridBagConstraints get()

get

public static GridBagConstraints get(int gridx,
                                     int gridy)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight,
                                     double wx,
                                     double wy)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight,
                                     int anchor)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight,
                                     int anchor,
                                     int fill)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight,
                                     int anchor,
                                     int fill,
                                     double wx,
                                     double wy)

get

public static GridBagConstraints get(int gridx,
                                     int gridy,
                                     int gwidth,
                                     int gheight,
                                     int anchor,
                                     int fill,
                                     double wx,
                                     double wy,
                                     Insets inset)
Constructs a new GridBagConstraints with the specified variables.


get

public static GridBagConstraints get(Map<String,String> map)
Constructs a new grid bag constraint using a mapping of keywords to values, either strings or Numbers (if possible). The keywords are named as the variables in the parental class.

This method is useful if parsing gridbag constraints out of a propertizable string (e.g. 'gridx=0:gridy=0:insets=0,0,0,0').


update

public static GridBagConstraints update(JComponent putin,
                                        GridBagConstraints gb)
Scans the jcomponent in the argument for any of the alignment keys. If any of these is present, the gridbagconstraints are updated accordingly.


toString

public String toString()
Overrides:
toString in class Object

toString

public static String toString(GridBagConstraints g)
Does a better representation.