|
|||||||||
| 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
Container is a control that contains child controls.
| Field Summary | |
static byte |
BORDER_LOWERED
used in the setBorderStyle method |
static byte |
BORDER_NONE
used in the setBorderStyle method |
static byte |
BORDER_RAISED
used in the setBorderStyle method |
static byte |
BORDER_SIMPLE
used in the setBorderStyle method |
protected Control |
children
The children of the container. |
protected int |
lastH
|
protected int |
lastW
|
protected int |
lastX
|
protected int |
lastY
|
protected Window |
parentWindow
|
protected boolean |
started
|
Vector |
tabOrder
Holds the controls that will be used to transfer focus when the tab key is pressed. |
protected Control |
tail
The tail of the children list. |
| Fields inherited from class waba.ui.Control |
AFTER,
appId,
appObj,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
clearValueInt,
clearValueStr,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
focusTraversable,
font,
foreColor,
foreDis,
height,
highlightRectsCount,
isHighlighting,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
uiCE,
uiFlat,
uiPalm,
uiVista,
visible,
width,
x,
x2,
y,
y2 |
| Constructor Summary | |
Container()
Creates a container with the default colors. |
|
| Method Summary | |
void |
add(Control control)
Adds a child control to this container. |
void |
add(Control control,
int x,
int y)
Add the control to this container and set its rect to be the given x,y and PREFERRED as width/height relative to the last control added |
void |
add(Control control,
int x,
int y,
Control relative)
Add the control to this container and set its rect to be the given x,y and PREFERRED as width/height relative to the given control |
void |
broadcastEvent(Event e)
posts a event to the children of this container and to all containers inside this containers; recursively. |
void |
clear()
Clears all controls focusTraversable inside this container, recursively. |
Control |
findChild(int x,
int y)
Returns the child located at the given x and y coordinates. |
Control[] |
getChildren()
Return an array of Controls that are added to this Container. |
Rect |
getClientRect()
Returns the client rect for this Container, in relative coords. |
void |
getClientRect(Rect r)
Returns the client rect for this Container, in relative coords. |
protected void |
onAdd()
Called when this container is added to the parent. |
protected void |
onColorsChanged(boolean colorsChanged)
Called after a setEnabled, setForeColor and setBackColor and when a control has been added to a Container. |
void |
onPaint(Graphics g)
Draws the border (if any). |
protected void |
onRemove()
Called when this container is removed from the parent. |
protected void |
onStart()
Called when this container can be initialized. |
void |
paintChildren(Graphics g,
int x,
int y,
int width,
int height)
Called by the system to draw the children of the container. |
void |
remove(Control control)
Removes a child control from the container. |
void |
setBorderStyle(byte border)
Sets the border for this container. |
void |
setEnabled(boolean enabled)
sets if this container and all childrens can or not accept events |
void |
setHighlighting()
Called by the event dispatcher to sets highlighting back to true. |
void |
swapToTopmostWindow()
Call this method to swap this Container to the topmost window. |
| Methods inherited from class waba.ui.Control |
addTimer,
changeHighlighted,
contains,
createGraphics,
drawHighlight,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getPreferredHeight,
getPreferredWidth,
getRect,
getSize,
isDisplayed,
isEnabled,
isVisible,
onBoundsChanged,
onEvent,
onFontChanged,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setRect,
setVisible,
translateFromOrigin,
uiStyleChanged |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Control children
protected Control tail
public static final byte BORDER_NONE
public static final byte BORDER_LOWERED
public static final byte BORDER_RAISED
public static final byte BORDER_SIMPLE
protected Window parentWindow
protected int lastX
protected int lastY
protected int lastW
protected int lastH
protected boolean started
public Vector tabOrder
| Constructor Detail |
public Container()
MainWindow.getMainWindow().getClientRect().
If you're extending the Container class and adding controls in its constructor, you may come into problems if you don't set the bounds as the first thing.
| Method Detail |
public void add(Control control,
int x,
int y)
public void add(Control control,
int x,
int y,
Control relative)
public void add(Control control)
public void remove(Control control)
public Control findChild(int x,
int y)
public Control[] getChildren()
public void setEnabled(boolean enabled)
public void broadcastEvent(Event e)
public void paintChildren(Graphics g,
int x,
int y,
int width,
int height)
public void setBorderStyle(byte border)
public Rect getClientRect()
public void getClientRect(Rect r)
protected void onColorsChanged(boolean colorsChanged)
public void onPaint(Graphics g)
super.onPaint(g);, or the border will not be drawn.g - the graphics object for drawingGraphicsprotected void onAdd()
protected void onRemove()
protected void onStart()
public void setHighlighting()
public void swapToTopmostWindow()
public class MainMenu extends Container // create a Singleton from MainMenu
{
private static instance;
public static getInstance()
{
return instance != null ? instance : (instance=new MainMenu());
}
private MainMenu()
{
}
}
// then at some other class, you can do:
MainMenu.getInstance().swapToTopmostWindow();
public void clear()
focusTraversable inside this container, recursively.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||