waba.ui
Class JustifiedContainer
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Container
|
+--waba.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);
Field Summary |
protected int |
columnCount
numero de colunas do container |
protected waba.ui.JustifiedContainer.Column[] |
columns
colunas |
Fields inherited from class waba.ui.Control |
BOTTOM,
CENTER,
controlCount,
enabled,
FILL,
fm,
font,
height,
LEFT,
name,
next,
parent,
PREFERRED,
prev,
RIGHT,
TOP,
width,
x,
y |
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.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getFontMetrics,
getNext,
getParent,
getPreferredHeight,
getPreferredWidth,
getRect,
isEnabled,
isVisible,
onBoundsChanged,
onEvent,
onPaint,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
setEnabled,
setFont,
setRect,
setRect,
setVisible |
Methods inherited from class java.lang.Object |
hashCode,
toString |
columnCount
protected int columnCount
- numero de colunas do container
columns
protected waba.ui.JustifiedContainer.Column[] columns
- colunas
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