Package com.moneydance.awt
Class GridC
java.lang.Object
java.awt.GridBagConstraints
com.moneydance.awt.GridC
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class GridC
extends java.awt.GridBagConstraints
A class that makes building GridBagConstraints objects easy, efficient and
readable for layout out GUI elements using the GridBagLayout layout manager
To use this, call GridC.getc() and then call any of the methods below on the
result in order to set different attributes for the component that is being
laid out. For example:
JPanel p = new JPanel(new GridBagLayout()); p.add(myLabel, GridC.getc(0,0).east()); p.add(myField, GridC.getc(1,0).wx(1).fillx().colspan(2)); p.add(myLabel2, GridC.getc(0,1).east()); p.add(myField2, GridC.getc(1,1).wx(1).fillx()); p.add(myButton2, GridC.getc(1,2));
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static int
BOTTOM_FIELD_INSET
static int
BOTTOM_LABEL_INSET
static int
LEFT_FIELD_INSET
static int
LEFT_LABEL_INSET
static int
RIGHT_FIELD_INSET
static int
RIGHT_LABEL_INSET
static int
TOP_FIELD_INSET
static int
TOP_LABEL_INSET
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
Constructors Constructor Description GridC()
-
Method Summary
Modifier and Type Method Description GridC
bottomInset(int newBottomInset)
Set the bottom edge insetGridC
center()
Anchor the component to the center (the default)GridC
colspan(int numColumns)
Set the gridwidth: number of columns to span.GridC
copy()
Return a clone of this object that can be stored for later useGridC
east()
Anchor the component to the eastGridC
field()
Shortcut for the constraints associated with a field in a standard dialogGridC
fillboth()
Set the fill type to both horizontal and verticalGridC
fillnone()
Set the fill type to no filling (the default)GridC
fillx()
Set the fill type to horizontalGridC
filly()
Set the fill type to verticalstatic GridC
getc()
Reset and return the singleton GridC instancestatic GridC
getc(int x, int y)
Reset and return the singleton GridC instance, with x and y initialized to the given values.GridC
insets(int top, int left, int bottom, int right)
Set the insetsGridC
label()
Shortcut for the settings associated with a label in a standard dialogGridC
leftInset(int newLeftInset)
Set the left edge insetGridC
north()
Anchor the component to the northGridC
northEast()
Anchor the component to the northeastGridC
northWest()
Anchor the component to the northwestGridC
padx(int xPadding)
Set the internal padding along the X axisGridC
pady(int yPadding)
Set the internal padding along the Y axisGridC
reset()
Reset all of the constraints to the default value and return ourself.GridC
rightInset(int newRightInset)
Set the right edge insetGridC
rowspan(int numRows)
Set the gridheight: number of rows to span.GridC
south()
Anchor the component to the southGridC
southEast()
Anchor the component to the southeastGridC
southWest()
Anchor the component to the southwestGridC
topInset(int newTopInset)
Set the top edge insetGridC
west()
Anchor the component to the westGridC
wx(float xWeight)
Set our weightx value and return selfGridC
wxy(float xWeight, float yWeight)
Set our weightx and weighty value and return selfGridC
wy(float yWeight)
Set our weighty value and return selfGridC
x(int x)
Set our gridx value and return selfGridC
xy(int x, int y)
Set both the gridx and gridy values and return selfGridC
y(int y)
Set our gridx value and return self
-
Field Details
-
TOP_LABEL_INSET
public static int TOP_LABEL_INSET -
LEFT_LABEL_INSET
public static int LEFT_LABEL_INSET -
BOTTOM_LABEL_INSET
public static int BOTTOM_LABEL_INSET -
RIGHT_LABEL_INSET
public static int RIGHT_LABEL_INSET -
TOP_FIELD_INSET
public static int TOP_FIELD_INSET -
LEFT_FIELD_INSET
public static int LEFT_FIELD_INSET -
BOTTOM_FIELD_INSET
public static int BOTTOM_FIELD_INSET -
RIGHT_FIELD_INSET
public static int RIGHT_FIELD_INSET
-
-
Constructor Details
-
GridC
public GridC()
-
-
Method Details
-
getc
Reset and return the singleton GridC instance -
getc
Reset and return the singleton GridC instance, with x and y initialized to the given values. This is a shortcut to GridC.getc().xy(x,y) -
reset
Reset all of the constraints to the default value and return ourself. -
x
Set our gridx value and return self -
y
Set our gridx value and return self -
xy
Set both the gridx and gridy values and return self -
wx
Set our weightx value and return self -
wy
Set our weighty value and return self -
wxy
Set our weightx and weighty value and return self -
colspan
Set the gridwidth: number of columns to span. -
rowspan
Set the gridheight: number of rows to span. -
fillx
Set the fill type to horizontal -
filly
Set the fill type to vertical -
fillboth
Set the fill type to both horizontal and vertical -
fillnone
Set the fill type to no filling (the default) -
insets
Set the insets -
east
Anchor the component to the east -
west
Anchor the component to the west -
north
Anchor the component to the north -
south
Anchor the component to the south -
northEast
Anchor the component to the northeast -
northWest
Anchor the component to the northwest -
southEast
Anchor the component to the southeast -
southWest
Anchor the component to the southwest -
center
Anchor the component to the center (the default) -
padx
Set the internal padding along the X axis -
pady
Set the internal padding along the Y axis -
label
Shortcut for the settings associated with a label in a standard dialog -
field
Shortcut for the constraints associated with a field in a standard dialog -
copy
Return a clone of this object that can be stored for later use -
topInset
Set the top edge inset- Since:
- Moneydance build 1515
-
leftInset
Set the left edge inset- Since:
- Moneydance build 1515
-
bottomInset
Set the bottom edge inset- Since:
- Moneydance build 1515
-
rightInset
Set the right edge inset- Since:
- Moneydance build 1515
-