|
|||||||||
| 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.RelativeContainer
A Container extension that supports relative placement. ie you can specify you want to place a Control to the RIGHT of the last one, or in the center of the Container. The ExtraMainWindow has a RelativeContainer built in so you can use all the methods here directly on your app if you extend it instead of MainWindow. See the RelativeTest program for an example of it's use.
| Field Summary | |
static int |
ABOVE
above the last component added |
static int |
AUTO
use the preferred size of the control |
static int |
BELOW
below the last component added |
static int |
BOTTOM
on the bottom of the screen |
static int |
CENTER
in the center of the screen |
static int |
FILL
fill the whole width or height |
static int |
LEFT
the far left of the screen |
static int |
LEFTOF
to the left of the last component added |
static int |
REST
use the rest of the space from the current position to the right of the container (or bottom) |
static int |
RIGHT
on the far right of the screen |
static int |
RIGHTOF
to the right of the last component added |
static int |
SAME
the same as the relative Control (centered if different widths) |
static int |
SAME_BOTTOM
the same as the relative Control (bottom aligned if different widths) |
static int |
SAME_LEFT
the same as the relative Control (left aligned if different widths) |
static int |
SAME_RIGHT
the same as the relative Control (right aligned if different widths) |
static int |
SAME_TOP
the same as the relative Control (top aligned if different widths) |
static int |
TOP
at the top of the screen |
| Constructor Summary | |
RelativeContainer()
Construct a new component that will fill to space provided |
|
| Method Summary | |
void |
add(Control control,
int x,
int y)
Adds a control to this container at the specified position using the last added Control for relative placement, if required. |
void |
add(Control control,
int x,
int y,
Control relative)
Adds a control to this container at the specified position relative to the given Control. |
void |
add(Control control,
int x,
int y,
int width,
int height)
Adds a control to this container at the specified position using the last added Control for relative placement, if required. |
void |
add(Control control,
int x,
int y,
int width,
int height,
Control relative)
Adds a component to this container at the specified position relative to the given Control. |
Control |
findChild(int x,
int y)
Returns the child located at the given x and y coordinates. |
void |
layout()
Layout all the Controls in this container |
void |
removePermanently(Control control)
Remove this control permanently from this container. |
void |
setGaps(int x,
int y)
Sets the standard gap between components when added with the LEFTOF, RIGHTOF, ABOVE and BELOW settings. |
void |
setRect(int x,
int y,
int width,
int height)
Sets the bounds of this container and redoes the layout. |
| Methods inherited from class waba.ui.Container |
add, paintChildren, remove |
| 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 |
| Field Detail |
public static final int LEFT
public static final int LEFTOF
public static final int CENTER
public static final int RIGHTOF
public static final int RIGHT
public static final int SAME
public static final int SAME_LEFT
public static final int SAME_RIGHT
public static final int TOP
public static final int ABOVE
public static final int BELOW
public static final int BOTTOM
public static final int SAME_TOP
public static final int SAME_BOTTOM
public static final int AUTO
public static final int FILL
public static final int REST
| Constructor Detail |
public RelativeContainer()
| Method Detail |
public void setGaps(int x,
int y)
x - the x gap in pixelsy - the y gap in pixels
public void setRect(int x,
int y,
int width,
int height)
setRect in class Controlx - the x coord of the bounding boxy - the y coord of the bounding boxwidth - the width of the bounding boxheight - the height of the bounding box
public void add(Control control,
int x,
int y)
control - the control to addx - the x coordinate to add the control, or a placement constant.x - the y coordinate to add the control, or a placement consrant.add(Control,int,int,int,int,Control)
public void add(Control control,
int x,
int y,
Control relative)
control - the control to addx - the x coordinate to add the control, or a placement constant.x - the y coordinate to add the control, or a placement consrant.relative - the control this one is to be placed relative toadd(Control,int,int,int,int,Control)
public void add(Control control,
int x,
int y,
int width,
int height)
control - the control to addx - the x coordinate to add the control, or a placement constant.x - the y coordinate to add the control, or a placement consrant.width - the width of the control, or a size constantheight - the height of the control, or a size constantadd(Control,int,int,int,int,Control)
public void add(Control control,
int x,
int y,
int width,
int height,
Control relative)
control - the control to addx - the x coordinate to place it, or one of the constants for relative placement.y - the y coordinate to place it, or one of the constants for relative placement.width - the width of the control, or a size constantheight - the height of the control, or a size constantrelative - the control this one is to be placed relative topublic void removePermanently(Control control)
control - the control to removepublic void layout()
public Control findChild(int x,
int y)
findChild in class Container
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||