All Packages Class Hierarchy This Package Previous Next Index
Class tropo.awt.TRGridBagPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----tropo.awt.TRPanel
|
+----tropo.awt.TRGridBagPanel
- public class TRGridBagPanel
- extends TRPanel
-
debug
-
-
gbc
-
-
gbl
-
-
numColumns
- How many columns we are supposed to have.
-
TRGridBagPanel()
- Create a new panel that uses GridBag as its layout manager and
provides a number of convenience methods for setting constraints.
-
TRGridBagPanel(int)
- This ctr is used for simplier layouts when you want to just call
the add(Component) and let us take care of incrementing
the placement.
-
TRGridBagPanel(int, boolean)
- This ctr is used for simplier layouts when you want to just call
the add(Component) and let us take care of incrementing
the placement.
-
add(Component, int, int)
- convience function to make it easier to work with the
gridbaglayout -- sets width and height to 1
-
add(Component, int, int, int, int)
- convience function to make it easier to work with the
gridbaglayout
-
add(String, int, int)
- Convenience to add a label.
-
add(String, int, int, int, int)
- Convenience for adding a label.
-
addLabeledLine(String)
- Add a labeled horizontal line that takes up the rest
of the current row.
-
addLine()
- Add a horizontal line.
-
addLine2()
- Add a horizontal line w/ extra space before and after.
-
addNext(Component)
- Add to the "next" position.
-
addNext(Component, int)
- Add to the "next" position with the spacing between this and the
previous component added on this line.
-
addNext(String)
-
-
addNext(String, Component)
- Convenience to add a label and a component.
-
addNext2(String, Component)
- Convenience to add a label and a component.
-
addNext2(String, Component, int)
- Convenience to add a label and a component w/ a left
margin.
-
addNextWest(Component)
- Very special case, esp used in 2 col layout.
-
addNextWest(String)
-
-
addRemainder(Component, int, int)
-
-
addSpace()
- Add some "spacing".
-
align(int)
- align components
-
anchor(int)
- align components
-
anchorCenter()
-
-
anchorEast()
-
-
anchorNorth()
-
-
anchorSouth()
-
-
anchorWest()
-
-
fill(int)
- fill components - i.e.
-
fill(int, int)
- fill components - i.e.
-
fillBoth()
- Let the next component grow both horizontally and vertically.
-
fillBoth(int, int)
- Let the next component grow both horizontally and vertically at
a specified percentage of the total.
-
fillBothDirections()
- Let the next component grow both horizontally and vertically.
-
fillBothDirections(Component)
- Let the passed component grow horizontally and take up the
remainder of the row.
-
fillHorizontal()
- Let the next component grow horizontally.
-
fillHorizontal(Component)
- Let the passed component grow horizontally and take up the
remainder of the row.
-
fillHorizontal(Component, boolean)
-
-
fillNone()
- Let the next component never grow
-
fillRest(Component)
- Fill the rest (or entire) row with this component using the current
fill setting.
-
fillVertical()
- Let the next component grow vertically.
-
fillVertical(Component)
- Let the passed component grow horizontally and take up the
remainder of the row.
-
inset()
- This method resets the external padding of the component,
the minimum amount of space between the component and the
edges of its display area back to 0.
-
inset(int, int)
- This method specifies the external padding of the component,
the minimum amount of space between the component and the
edges of its display area.
-
inset(int, int, int, int)
- This method specifies the external padding of the component,
the minimum amount of space between the component and the
edges of its display area.
-
nextLine()
- Go to the start of the next line if we're not at the left column.
-
pad(int, int)
- Pads the next component added to take up more space (makes
component bigger).
-
setAutoLabelEast(boolean)
-
-
setNumColumns(int)
- Set the number of columns we'll use for auto-positioning.
debug
public static boolean debug
gbl
protected GridBagLayout gbl
gbc
protected GridBagConstraints gbc
numColumns
protected int numColumns
- How many columns we are supposed to have.
TRGridBagPanel
public TRGridBagPanel()
- Create a new panel that uses GridBag as its layout manager and
provides a number of convenience methods for setting constraints.
TRGridBagPanel
public TRGridBagPanel(int numCols)
- This ctr is used for simplier layouts when you want to just call
the add(Component) and let us take care of incrementing
the placement. We take care of the row and col positioning and
lay out the components from left to right.
- Parameters:
- numCols - the number of columns we'll have
- See Also:
- addNext, fillHorizontal, addSpace
TRGridBagPanel
public TRGridBagPanel(int numCols,
boolean mp)
- This ctr is used for simplier layouts when you want to just call
the add(Component) and let us take care of incrementing
the placement. We take care of the row and col positioning and
lay out the components from left to right.
- Parameters:
- numCols - the number of columns we'll have
- mp - if true then we give out insets so we don't
hit the edges
- See Also:
- addNext, fillHorizontal, addSpace, setMainPanel
setNumColumns
public void setNumColumns(int val)
- Set the number of columns we'll use for auto-positioning.
If you called the ctr w/ the #cols then this value overrides it.
- Parameters:
- val - the number of columns to use for auto-positioning
addNext
public void addNext(String label,
Component c)
- Convenience to add a label and a component.
addNext2
public void addNext2(String label,
Component c)
- Convenience to add a label and a component.
addNext2
public void addNext2(String label,
Component c,
int leftMargin)
- Convenience to add a label and a component w/ a left
margin. Yes there are too many variations here.
- See Also:
- addNext
addNext
public void addNext(Component c)
- Add to the "next" position. Can't be called add() due
to problems conflicting with Container.add();
- Parameters:
- c - the component to add
addNext
public void addNext(Component c,
int leftMargin)
- Add to the "next" position with the spacing between this and the
previous component added on this line.
Can't be called add() due to problems conflicting with Container.add().
- Parameters:
- c - the component to add
- leftMargin - the spacing between the previous component on the line
and this one
setAutoLabelEast
public void setAutoLabelEast(boolean val)
addNext
public void addNext(String label)
addNextWest
public void addNextWest(Component c)
- Very special case, esp used in 2 col layout.
addNextWest
public void addNextWest(String s)
fillHorizontal
public void fillHorizontal()
- Let the next component grow horizontally.
fillNone
public void fillNone()
- Let the next component never grow
anchorNorth
public void anchorNorth()
anchorEast
public void anchorEast()
anchorSouth
public void anchorSouth()
anchorWest
public void anchorWest()
anchorCenter
public void anchorCenter()
addSpace
public void addSpace()
- Add some "spacing". Sort of a kludge - we add an empty
label that takes up the whole row and we advance to the
next row.
addLine
public void addLine()
- Add a horizontal line.
addLine2
public void addLine2()
- Add a horizontal line w/ extra space before and after.
addLabeledLine
public void addLabeledLine(String label)
- Add a labeled horizontal line that takes up the rest
of the current row.
- See Also:
- TRSeparator
nextLine
public void nextLine()
- Go to the start of the next line if we're not at the left column.
Not normally called.
fillHorizontal
public void fillHorizontal(Component c)
- Let the passed component grow horizontally and take up the
remainder of the row.
fillHorizontal
public void fillHorizontal(Component c,
boolean reallyFill)
fillBothDirections
public void fillBothDirections(Component c)
- Let the passed component grow horizontally and take up the
remainder of the row.
fillRest
public void fillRest(Component c)
- Fill the rest (or entire) row with this component using the current
fill setting.
- Parameters:
- c - the component to add
fillVertical
public void fillVertical()
- Let the next component grow vertically.
fillVertical
public void fillVertical(Component c)
- Let the passed component grow horizontally and take up the
remainder of the row.
fillBothDirections
public void fillBothDirections()
- Let the next component grow both horizontally and vertically.
fillBoth
public void fillBoth()
- Let the next component grow both horizontally and vertically.
fillBoth
public void fillBoth(int percentX,
int percentY)
- Let the next component grow both horizontally and vertically at
a specified percentage of the total.
- Parameters:
- percentX - the percentage to grow in the X direction
- percentY - the percentage to grow in the Y direction
add
public void add(Component c,
int x,
int y,
int w,
int h)
- convience function to make it easier to work with the
gridbaglayout
- Parameters:
- c - the component to add
- x - the X position in the grid
- y - the Y position in the grid
- w - the width of the component
- h - the height of the component
addRemainder
public void addRemainder(Component c,
int x,
int y)
add
public void add(String s,
int x,
int y,
int w,
int h)
- Convenience for adding a label.
add
public void add(Component c,
int x,
int y)
- convience function to make it easier to work with the
gridbaglayout -- sets width and height to 1
- Parameters:
- c - the component to add
- x - the X position in the grid
- y - the Y position in the grid
add
public void add(String s,
int x,
int y)
- Convenience to add a label.
pad
public void pad(int x,
int y)
- Pads the next component added to take up more space (makes
component bigger). The pad gets reset to (0,0) after each
component is added.
- Parameters:
- x - the left/right amount padded to component
- y - the top/bottom amount padded to component
inset
public void inset(int w,
int h)
- This method specifies the external padding of the component,
the minimum amount of space between the component and the
edges of its display area.
- Parameters:
- w - the width of the left and right inset
- h - the height of the top and bottom inset
inset
public void inset(int top,
int left,
int bottom,
int right)
- This method specifies the external padding of the component,
the minimum amount of space between the component and the
edges of its display area.
- Parameters:
- top - the top inset
- left - the left inset
- bottom - the bottom inset
- right - the right inset
inset
public void inset()
- This method resets the external padding of the component,
the minimum amount of space between the component and the
edges of its display area back to 0.
align
public void align(int alignment)
- align components
- Parameters:
- alignment - one of the following GridBagConstraints.* where
'*' is (CENTER | EAST | NORTH | NORTHEAST | NORTHWEST | WEST |
SOUTH | SOUTHEAST | SOUTHWEST | WEST)
anchor
public void anchor(int alignment)
- align components
- Parameters:
- alignment - one of the following GridBagConstraints.* where
'*' is (CENTER | EAST | NORTH | NORTHEAST | NORTHWEST | WEST |
SOUTH | SOUTHEAST | SOUTHWEST | WEST)
fill
public void fill(int filler)
- fill components - i.e. specify how the component absorbs any
extra space in the layout
- Parameters:
- filler - one of the following GridBagConstraints.* where
'*' is (HORIZONTAL | VERTICAL | BOTH | NONE)
fill
public void fill(int filler,
int percent)
- fill components - i.e. specify how the component absorbs any
extra space in the layout
- Parameters:
- filler -
- one of the following GridBagConstraints.* where
'*' is (HORIZONTAL | VERTICAL | BOTH | NONE)
- percent - the percentage of available space to fill
All Packages Class Hierarchy This Package Previous Next Index