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 intBOTTOM_FIELD_INSETstatic intBOTTOM_LABEL_INSETstatic intLEFT_FIELD_INSETstatic intLEFT_LABEL_INSETstatic intRIGHT_FIELD_INSETstatic intRIGHT_LABEL_INSETstatic intTOP_FIELD_INSETstatic intTOP_LABEL_INSETFields 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 GridCbottomInset(int newBottomInset)Set the bottom edge insetGridCcenter()Anchor the component to the center (the default)GridCcolspan(int numColumns)Set the gridwidth: number of columns to span.GridCcopy()Return a clone of this object that can be stored for later useGridCeast()Anchor the component to the eastGridCfield()Shortcut for the constraints associated with a field in a standard dialogGridCfillboth()Set the fill type to both horizontal and verticalGridCfillnone()Set the fill type to no filling (the default)GridCfillx()Set the fill type to horizontalGridCfilly()Set the fill type to verticalstatic GridCgetc()Reset and return the singleton GridC instancestatic GridCgetc(int x, int y)Reset and return the singleton GridC instance, with x and y initialized to the given values.GridCinsets(int top, int left, int bottom, int right)Set the insetsGridClabel()Shortcut for the settings associated with a label in a standard dialogGridCleftInset(int newLeftInset)Set the left edge insetGridCnorth()Anchor the component to the northGridCnorthEast()Anchor the component to the northeastGridCnorthWest()Anchor the component to the northwestGridCpadx(int xPadding)Set the internal padding along the X axisGridCpady(int yPadding)Set the internal padding along the Y axisGridCreset()Reset all of the constraints to the default value and return ourself.GridCrightInset(int newRightInset)Set the right edge insetGridCrowspan(int numRows)Set the gridheight: number of rows to span.GridCsouth()Anchor the component to the southGridCsouthEast()Anchor the component to the southeastGridCsouthWest()Anchor the component to the southwestGridCtopInset(int newTopInset)Set the top edge insetGridCwest()Anchor the component to the westGridCwx(float xWeight)Set our weightx value and return selfGridCwxy(float xWeight, float yWeight)Set our weightx and weighty value and return selfGridCwy(float yWeight)Set our weighty value and return selfGridCx(int x)Set our gridx value and return selfGridCxy(int x, int y)Set both the gridx and gridy values and return selfGridCy(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
-