|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objexcel.gui.ArrayLayout
This class adapts the gridbaglayout to create a grid based layout. You pass in a 2-d array of components. The ArrayLayout will typically be used to create grids of label, field, label, field, etc. It does not do nestings so a group box of components would need to be added as a panel. With a combination of ArrayLayout, BorderLayout and Box Layout you should be able to accomplish pretty well any layout you can find. ArrayLayout creates rows with the height of the largest thing in them and ditto for columns.
Constructor Summary | |
ArrayLayout(javax.swing.JComponent container)
set the layout for the given container |
Method Summary | |
void |
add(java.awt.Component[][] components)
|
void |
add(java.awt.Component[][] controls,
java.awt.Component[] rights,
java.awt.Component[] fills)
similar to the createLayout method but this one will allow you to have access to the ArrayLayout so you can further customise the layout after it is initially created. |
void |
add(java.awt.Component[][] controls,
java.awt.Component[] rights,
java.awt.Component[] fills,
java.lang.String title)
|
static void |
applyContainerStyles(javax.swing.JComponent container)
Set some defaults for a Panel. |
static void |
centerComponent(java.awt.Component child,
java.awt.Component parent)
pop the child in the middle of the parent. |
static void |
centerComponentOnScreen(java.awt.Component f)
pop the component in the middle of the screen. |
static javax.swing.JComponent |
createLayout(java.awt.Component[][] controls,
java.awt.Component[] rights,
java.awt.Component[] fills,
java.lang.String title)
create a laid out component in one step. |
static java.awt.Frame |
getFrame(java.awt.Component c)
traverse the components parents to find the frame. |
com.objexcel.gui.ArrayLayout.JGridBagLayout |
getLayout()
get the underlying GridBagLayout to really customise the layout. |
void |
setAnchorValues(java.awt.Component[] components,
int value)
sets where the components are anchored. |
void |
setFillValues(java.awt.Component[] components,
int value)
if a field is in a column/row is wider/taller than the components' preferred sizes, gobble up the rest of the space. |
static void |
setMnemonic(javax.swing.JComponent c,
javax.swing.JLabel l,
char mnemonic)
set the label and displayed mnemonic for the components |
static void |
setTitle(java.awt.Component c,
java.lang.String s)
traverse the components owners until we find the frame (including a JInternal frame) and set the title. |
void |
setWeightXValues(java.awt.Component[] components,
int value)
set the underlying GridBagLayout weight Y value. |
void |
setWeightYValues(java.awt.Component[] components,
int value)
set the underlying GridBagLayout weight Y value. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ArrayLayout(javax.swing.JComponent container)
Method Detail |
public static javax.swing.JComponent createLayout(java.awt.Component[][] controls, java.awt.Component[] rights, java.awt.Component[] fills, java.lang.String title)
controls
- the controls you want laid outrights
- component you want aligned to the right. null if n/afills
- components you want to take up any space as the container get
biggerpublic com.objexcel.gui.ArrayLayout.JGridBagLayout getLayout()
public void add(java.awt.Component[][] controls, java.awt.Component[] rights, java.awt.Component[] fills)
public void add(java.awt.Component[][] controls, java.awt.Component[] rights, java.awt.Component[] fills, java.lang.String title)
public void add(java.awt.Component[][] components)
public void setWeightXValues(java.awt.Component[] components, int value)
public void setWeightYValues(java.awt.Component[] components, int value)
public void setFillValues(java.awt.Component[] components, int value)
public void setAnchorValues(java.awt.Component[] components, int value)
public static void applyContainerStyles(javax.swing.JComponent container)
public static void setMnemonic(javax.swing.JComponent c, javax.swing.JLabel l, char mnemonic)
public static java.awt.Frame getFrame(java.awt.Component c)
public static void setTitle(java.awt.Component c, java.lang.String s)
public static void centerComponentOnScreen(java.awt.Component f)
public static void centerComponent(java.awt.Component child, java.awt.Component parent)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |