|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Container
|
+--extra.ui.GridContainer
A container that lays it's component controls out in a grid. Here's an example.
GridContainer gc=new GridContainer(2,2);
gc.add(new Button("One"));
gc.add(new Button("Two"));
gc.add(new Button("Three"));
gc.add(new Button("Four"));
gc.setRect(0,0,160,100);
add(gc);
which should give you something like:
_____________________ | | | | One | Two | |__________|__________| | | | | Three | Four | |__________|__________|
| Constructor Summary | |
GridContainer(int gridx,
int gridy)
Construct a new container with the specified grid width and height. |
|
| Method Summary | |
void |
add(Control c)
Adds a control at the grid position to the left of the last one added or (0,0) if this is the first. |
void |
add(Control c,
int x,
int y)
Adds a control at the specified grid position |
Control |
get(int x,
int y)
Gets the control at the given grid position |
void |
layout()
Layout all the controls in this container. |
void |
remove(Control c)
Removes a control from this layout. |
void |
remove(int x,
int y)
Removes a control at the given grid position. |
void |
setGaps(int x,
int y)
Sets the gap between controls. |
void |
setRect(int x,
int y,
int width,
int height)
Sets the rect for this container. |
| Methods inherited from class waba.ui.Container |
findChild, paintChildren |
| Methods inherited from class waba.ui.Control |
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, onEvent, onPaint, postEvent, removeTimer, repaint |
| Methods inherited from class java.lang.Object |
equals, hashCode, toString |
| Constructor Detail |
public GridContainer(int gridx,
int gridy)
gridx - the number of columns in the grid.gridy - the number of rows in the grid.| Method Detail |
public void setGaps(int x,
int y)
x - the x gap in pixelsy - the y gap in pixels
public Control get(int x,
int y)
x - the x grid coordy - the y grid coordpublic void add(Control c)
add in class Containerc - the control to add
public void add(Control c,
int x,
int y)
x - the x grid coordy - the y grid coordpublic void remove(Control c)
remove in class Containerc - the control to remove
public void remove(int x,
int y)
x - the x grid coordy - the y grid coord
public void setRect(int x,
int y,
int width,
int height)
setRect in class Controlpublic void layout()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||