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

Variable Index

 o debug
 o gbc
 o gbl
 o numColumns
How many columns we are supposed to have.

Constructor Index

 o TRGridBagPanel()
Create a new panel that uses GridBag as its layout manager and provides a number of convenience methods for setting constraints.
 o 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.
 o 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.

Method Index

 o add(Component, int, int)
convience function to make it easier to work with the gridbaglayout -- sets width and height to 1
 o add(Component, int, int, int, int)
convience function to make it easier to work with the gridbaglayout
 o add(String, int, int)
Convenience to add a label.
 o add(String, int, int, int, int)
Convenience for adding a label.
 o addLabeledLine(String)
Add a labeled horizontal line that takes up the rest of the current row.
 o addLine()
Add a horizontal line.
 o addLine2()
Add a horizontal line w/ extra space before and after.
 o addNext(Component)
Add to the "next" position.
 o addNext(Component, int)
Add to the "next" position with the spacing between this and the previous component added on this line.
 o addNext(String)
 o addNext(String, Component)
Convenience to add a label and a component.
 o addNext2(String, Component)
Convenience to add a label and a component.
 o addNext2(String, Component, int)
Convenience to add a label and a component w/ a left margin.
 o addNextWest(Component)
Very special case, esp used in 2 col layout.
 o addNextWest(String)
 o addRemainder(Component, int, int)
 o addSpace()
Add some "spacing".
 o align(int)
align components
 o anchor(int)
align components
 o anchorCenter()
 o anchorEast()
 o anchorNorth()
 o anchorSouth()
 o anchorWest()
 o fill(int)
fill components - i.e.
 o fill(int, int)
fill components - i.e.
 o fillBoth()
Let the next component grow both horizontally and vertically.
 o fillBoth(int, int)
Let the next component grow both horizontally and vertically at a specified percentage of the total.
 o fillBothDirections()
Let the next component grow both horizontally and vertically.
 o fillBothDirections(Component)
Let the passed component grow horizontally and take up the remainder of the row.
 o fillHorizontal()
Let the next component grow horizontally.
 o fillHorizontal(Component)
Let the passed component grow horizontally and take up the remainder of the row.
 o fillHorizontal(Component, boolean)
 o fillNone()
Let the next component never grow
 o fillRest(Component)
Fill the rest (or entire) row with this component using the current fill setting.
 o fillVertical()
Let the next component grow vertically.
 o fillVertical(Component)
Let the passed component grow horizontally and take up the remainder of the row.
 o 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.
 o 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.
 o 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.
 o nextLine()
Go to the start of the next line if we're not at the left column.
 o pad(int, int)
Pads the next component added to take up more space (makes component bigger).
 o setAutoLabelEast(boolean)
 o setNumColumns(int)
Set the number of columns we'll use for auto-positioning.

Variables

 o debug
 public static boolean debug
 o gbl
 protected GridBagLayout gbl
 o gbc
 protected GridBagConstraints gbc
 o numColumns
 protected int numColumns
How many columns we are supposed to have.

Constructors

 o TRGridBagPanel
 public TRGridBagPanel()
Create a new panel that uses GridBag as its layout manager and provides a number of convenience methods for setting constraints.

 o 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
 o 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

Methods

 o 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
 o addNext
 public void addNext(String label,
                     Component c)
Convenience to add a label and a component.

 o addNext2
 public void addNext2(String label,
                      Component c)
Convenience to add a label and a component.

 o 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
 o 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
 o 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
 o setAutoLabelEast
 public void setAutoLabelEast(boolean val)
 o addNext
 public void addNext(String label)
 o addNextWest
 public void addNextWest(Component c)
Very special case, esp used in 2 col layout.

 o addNextWest
 public void addNextWest(String s)
 o fillHorizontal
 public void fillHorizontal()
Let the next component grow horizontally.

 o fillNone
 public void fillNone()
Let the next component never grow

 o anchorNorth
 public void anchorNorth()
 o anchorEast
 public void anchorEast()
 o anchorSouth
 public void anchorSouth()
 o anchorWest
 public void anchorWest()
 o anchorCenter
 public void anchorCenter()
 o 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.

 o addLine
 public void addLine()
Add a horizontal line.

 o addLine2
 public void addLine2()
Add a horizontal line w/ extra space before and after.

 o addLabeledLine
 public void addLabeledLine(String label)
Add a labeled horizontal line that takes up the rest of the current row.

See Also:
TRSeparator
 o nextLine
 public void nextLine()
Go to the start of the next line if we're not at the left column. Not normally called.

 o fillHorizontal
 public void fillHorizontal(Component c)
Let the passed component grow horizontally and take up the remainder of the row.

 o fillHorizontal
 public void fillHorizontal(Component c,
                            boolean reallyFill)
 o fillBothDirections
 public void fillBothDirections(Component c)
Let the passed component grow horizontally and take up the remainder of the row.

 o 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
 o fillVertical
 public void fillVertical()
Let the next component grow vertically.

 o fillVertical
 public void fillVertical(Component c)
Let the passed component grow horizontally and take up the remainder of the row.

 o fillBothDirections
 public void fillBothDirections()
Let the next component grow both horizontally and vertically.

 o fillBoth
 public void fillBoth()
Let the next component grow both horizontally and vertically.

 o 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
 o 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
 o addRemainder
 public void addRemainder(Component c,
                          int x,
                          int y)
 o add
 public void add(String s,
                 int x,
                 int y,
                 int w,
                 int h)
Convenience for adding a label.

 o 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
 o add
 public void add(String s,
                 int x,
                 int y)
Convenience to add a label.

 o 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
 o 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
 o 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
 o 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.

 o 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)
 o 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)
 o 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)
 o 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