|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcontrol.ui.wombat.Component
jcontrol.ui.wombat.Label
public class Label
A label is a very simple component which displays a one or more lines of
read-only text or an image. The text can be changed by the
application, but a user cannot edit it directly.
Labels are passive components, they can neither be selected nor fire
any events.
(c) Copyright 2005-2007 DOMOLOGIC GmbH
| Field Summary | |
|---|---|
static int |
STYLE_ALIGN_CENTER
Align text to the middle |
static int |
STYLE_ALIGN_LEFT
Align text to the left |
static int |
STYLE_ALIGN_RIGHT
Align text to the right |
static int |
STYLE_DRAW_INVERSE
Inverse mode |
static int |
STYLE_DRAW_NORMAL
Normal (non-inverse) mode |
static int |
STYLE_SHOW_BORDER
Paint a border around the label |
| Constructor Summary | |
|---|---|
Label(Resource image,
int x,
int y)
Construct a new label. |
|
Label(Resource image,
int x,
int y,
int width,
int height,
int style)
Constructs a new label with specified bounds and alignment. |
|
Label(String text,
int x,
int y)
Construct a new label. |
|
Label(String text,
int x,
int y,
int width,
int height,
int style)
Constructs a new label with specified bounds and alignment. |
|
| Method Summary | |
|---|---|
Object |
getLabel()
Returns the caption of this label which is either a string or a resource representing an image. |
void |
paint(XGraphics g)
Paint the label. |
void |
setBounds(int x,
int y,
int width,
int height)
Set the dimensions of this component. |
void |
setFont(Resource font)
Sets the font for this component. |
void |
setImage(Resource image)
Replaces the current text or image on this label by the specified image. |
void |
setStyle(int style)
Sets the style of the label. |
void |
setText(String text)
Replaces the current text or image on this label by the specified text. |
protected int |
validateBreakPoints(XGraphics g)
|
| Methods inherited from class jcontrol.ui.wombat.Component |
|---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setDirty, setEnabled, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, setVisible, unsafeExec, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, notifyAll, toString, wait |
| Field Detail |
|---|
public static final int STYLE_ALIGN_LEFT
public static final int STYLE_ALIGN_CENTER
public static final int STYLE_ALIGN_RIGHT
public static final int STYLE_DRAW_INVERSE
public static final int STYLE_SHOW_BORDER
public static final int STYLE_DRAW_NORMAL
| Constructor Detail |
|---|
public Label(String text,
int x,
int y)
text - a text 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(Resource image,
int x,
int y)
image - an image 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(String text,
int x,
int y,
int width,
int height,
int style)
text - the text 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 labelstyle - the alignment and style of the label. Possible values are one of the styles
STYLE_ALIGN_LEFT, STYLE_ALIGN_CENTER or STYLE_ALIGN_RIGHT and optional STYLE_DRAW_INVERSE and STYLE_SHOW_BORDER
public Label(Resource image,
int x,
int y,
int width,
int height,
int style)
image - the image 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 labelstyle - the alignment and style of the label. Possible values are one of the styles
STYLE_ALIGN_LEFT, STYLE_ALIGN_CENTER or STYLE_ALIGN_RIGHT and optional STYLE_DRAW_INVERSE and STYLE_SHOW_BORDER| Method Detail |
|---|
public void setText(String text)
setBounds()-method or
in the constructor.
text - the new textpublic void setImage(Resource image)
setBounds()-method or
in the constructor.
image - the new image to set.public Object getLabel()
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class Componentx - The x-coordinate of the upper left cornery - The y-coordinate of the upper left cornerwidth - The width of this componentheight - The height of this componentpublic void setFont(Resource font)
setFont in class Componentfont - the new font.public void setStyle(int style)
style - the alignment and style of the label. Possible values are one of the styles
STYLE_ALIGN_LEFT, STYLE_ALIGN_CENTER or STYLE_ALIGN_RIGHT and optional STYLE_DRAW_INVERSE and STYLE_SHOW_BORDERprotected int validateBreakPoints(XGraphics g)
public void paint(XGraphics g)
paint in class Componentg - the application's graphics object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||