|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.wombat.Component jcontrol.ui.wombat.FastLabel
public class FastLabel
A label is a very simple component which displays a single line of
read-only text or an image resource. 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_NORMAL
Inverse mode |
Constructor Summary | |
---|---|
FastLabel(String text,
int x,
int y,
int width,
int height,
int style)
Constructs a new label with specified bounds and alignment. |
Method Summary | |
---|---|
String |
getLabel()
Returns the caption of this label. |
void |
paint(XGraphics g)
Paint the label. |
void |
setBackgroundColor(Color background)
Sets the background color for this component. |
protected void |
setBackgroundColorInternal(Color background)
|
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 |
setForegroundColor(Color foreground)
Sets the foreground color for this component. |
protected void |
setForegroundColorInternal(Color foreground)
|
protected void |
setParametersInternal(Resource font,
Color foregroundColor,
Color backgroundColor,
Color transparentColor)
|
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. |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, redrawInternalAndParent, repaint, repaintAll, safeExec, setDirty, setEnabled, 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_NORMAL
Constructor Detail |
---|
public FastLabel(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
Method Detail |
---|
public void setText(String text)
setBounds()
-method or
in the constructor.
text
- the new textpublic void setBackgroundColor(Color background)
Component
setBackgroundColor
in class Component
background
- the background color to setprotected void setBackgroundColorInternal(Color background)
setBackgroundColorInternal
in class Component
public void setFont(Resource font)
Component
setFont
in class Component
font
- the new font.public void setForegroundColor(Color foreground)
Component
setForegroundColor
in class Component
foreground
- the foreground color to setprotected void setForegroundColorInternal(Color foreground)
setForegroundColorInternal
in class Component
protected void setParametersInternal(Resource font, Color foregroundColor, Color backgroundColor, Color transparentColor)
setParametersInternal
in class Component
public String getLabel()
public void setBounds(int x, int y, int width, int height)
setBounds
in class Component
x
- 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 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_BORDER
public void paint(XGraphics g)
paint
in class Component
g
- the application's graphics object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |