|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jcontrol.ui.vole.Component
|
+--jcontrol.ui.vole.Label
A label is a very simple component which displays non-editable text or an image resource. Labels cannot gain the input focus.
(C) DOMOLOGIC Home Automation GmbH 2003
| Field Summary | |
protected int |
align
Text alignment |
static int |
ALIGN_CENTER
Align text to the middle |
static int |
ALIGN_LEFT
Align text to the right |
static int |
ALIGN_RIGHT
Align text to the right |
protected java.lang.Object |
label
String or image ressource |
| Fields inherited from class jcontrol.ui.vole.Component |
focusOwner, font, g, height, listener, parent, visible, width, x, y |
| Constructor Summary | |
Label(java.lang.Object label,
int x,
int y)
Construct a new label with x- and y-coordinate. |
|
Label(java.lang.Object label,
int x,
int y,
int width,
int height,
int align)
Constructs a new label with specified bounds and alignment. |
|
Label(java.lang.String text,
int x,
int y,
int align)
Construct a new label with specified alignment. |
|
| Method Summary | |
void |
paint()
Paint the label. |
void |
setAlign(int align,
boolean revalidate)
Set the alignment of the label. |
void |
setLabel(java.lang.Object label,
boolean revalidate)
Set a new label to display. |
boolean |
transferFocus()
Label can't gain input focus. |
void |
validate()
Compute this component's preferred size and assign internal values width and height. |
| Methods inherited from class jcontrol.ui.vole.Component |
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setLocation, setParent, setVisible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, notifyAll, wait |
| Field Detail |
protected int align
public static final int ALIGN_CENTER
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
protected java.lang.Object label
| Constructor Detail |
public Label(java.lang.Object label,
int x,
int y)
label - A String or an image resource to print on the label.x - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left corner
public Label(java.lang.Object label,
int x,
int y,
int width,
int height,
int align)
label - the label to display on the labelx - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left cornerwidth - the width of the labelheight - the height of the labelalign - the horizontal alignment of the label. Possible values are
ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT
public Label(java.lang.String text,
int x,
int y,
int align)
text - A String or an image resource to print on the label.x - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left corneralign - the horizontal alignment of the text. Possible values are
ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT| Method Detail |
public void paint()
paint in class Component
public void setAlign(int align,
boolean revalidate)
align - The horizontal alignment of the label.revalidate - If true, the display area will be cleared before repainting.
public void setLabel(java.lang.Object label,
boolean revalidate)
label - The new label (string or image resource).revalidate - If true, the display area will be cleared before repainting.public boolean transferFocus()
transferFocus in class Componentpublic void validate()
validate in class Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||