superwaba.ext.xplat.ui
Class JustifiedContainer
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Container
|
+--superwaba.ext.xplat.ui.JustifiedContainer
- public class JustifiedContainer
- extends Container
used to make a bit easy to place controls in a container. The controls must be inserted in horizontal order.
isnt necessary to fill all the specified number of cols.
example:
JustifiedContainer jc = new JustifiedContainer();
jc.setColumnCount(2);
jc.setGaps(0,6,0); // 6 pixels of horizontal gap
jc.setJustify(0,RIGHT,TOP); // justify column 0 at right
jc.add(0,new Label("Please fill the fields",Label.CENTER),0,0); // container width and preferred height
jc.add(0,new Label("Name:"),70,0);
jc.add(1,new Edit(),0,0); // fill column 1 to the end
jc.add(0,new Label("Address:"),70,0);
jc.add(1,new Edit(),0,0);
Note: You can use the PREFERRED+delta as width/height, but you can't use delta in the justified parameters.
Fields inherited from class waba.ui.Container |
BORDER_LOWERED,
BORDER_NONE,
BORDER_RAISED,
BORDER_SIMPLE,
children,
lastH,
lastW,
lastX,
lastY,
parentWindow,
tail |
Fields inherited from class waba.ui.Control |
AFTER,
appId,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
font,
foreColor,
foreDis,
height,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
visible,
width,
x,
x2,
y,
y2 |
Method Summary |
void |
add(int col,
Control control,
int controlW,
int controlH)
adds the control. |
void |
setColumnCount(int numcols)
initialize the columns |
void |
setGaps(int col,
int gapX,
int gapY)
set the gaps for the column |
void |
setJustify(int col,
int justX,
int justY)
set the justifies of the column ; can be LEFT, RIGHT, TOP, BOTTOM, CENTER |
Methods inherited from class waba.ui.Container |
add,
add,
add,
broadcastEvent,
findChild,
getChildren,
getClientRect,
onColorsChanged,
onPaint,
onStart,
paintChildren,
remove,
setBorderStyle,
setEnabled |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
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 |
JustifiedContainer
public JustifiedContainer()
setColumnCount
public void setColumnCount(int numcols)
- initialize the columns
setJustify
public void setJustify(int col,
int justX,
int justY)
- set the justifies of the column ; can be LEFT, RIGHT, TOP, BOTTOM, CENTER
setGaps
public void setGaps(int col,
int gapX,
int gapY)
- set the gaps for the column
add
public void add(int col,
Control control,
int controlW,
int controlH)
- adds the control.
- Parameters:
control
- the specified control.col
- which column to addcontrolW
- if greater than 0: width of the control; if 0: fill to the end of the container width; if PREFERRED: preferred control widthcontrolH
- if greater than 0: height of the control; if 0: default line height; if PREFERRED: preferred control height