|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.Component
public abstract class Component
A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user. Examples of components are the buttons, checkboxes, and scrollbars of a typical graphical user interface.
The Component
class is the abstract superclass of
the User Interface components. Class Component
can also
be extended directly to create a custom component.
Field Summary | |
---|---|
int |
alignment
The label's alignment. |
int |
background
The background color for this component. |
static int |
CENTER
Indicates that the component should be centered. |
boolean |
focusable
|
int |
focusedBackground
The background color for this component when it focused. |
int |
focusedForeground
The foreground color for this component when it focused. |
protected javax.microedition.lcdui.Font |
font
The font used by this component. |
int |
foreground
The foreground color for this component. |
protected int |
height
The height of the component. |
protected boolean |
isCompletelyVisible
Indicated if component is completely visible on the screen |
protected boolean |
isFocused
Indicated if component is focusable |
protected boolean |
isVisible
Indicated if component is completely or partially visible on the screen |
static int |
LEFT
Indicates that the component should be left justified. |
protected ScreenCanvas |
parentScreen
The parent screen of the object. |
static int |
RIGHT
Indicates that the component should be right justified. |
protected int |
screenY
Vertical offset in pixels of current component from top of the window |
protected boolean |
valid
Indicated if component should be repainted |
int |
width
The width of the component. |
Constructor Summary | |
---|---|
Component()
|
Method Summary | |
---|---|
void |
destructor()
Default destructor. |
int |
getBackground()
Get background |
javax.microedition.lcdui.Font |
getFont()
Get the component's font |
int |
getForeground()
Get foreground |
int |
getHeight()
Returns the current height of this component. |
int |
getWidth()
Returns the current width of this component. |
void |
invalidate()
Invalidates this component. |
boolean |
isFocusOwner()
Returns true if this Component is the
focus owner. |
protected boolean |
keyPressed(int keyCode)
Processes a press of a key. |
protected boolean |
keyReleased(int keyCode)
Processes a release of a key. |
protected boolean |
keyRepeated(int keyCode)
Processes when a key is repeated (held down). |
void |
paint(javax.microedition.lcdui.Graphics g)
Paints this component. |
protected void |
paintBackground(javax.microedition.lcdui.Graphics g)
Paints background for the component |
protected boolean |
pointerDragged(int x,
int y)
Processes when a pointer is dragged (held down). |
protected boolean |
pointerPressed(int x,
int y)
Processes a press of a pointer. |
protected boolean |
pointerReleased(int x,
int y)
Processes a release of a pointer. |
protected void |
prepareForeground(javax.microedition.lcdui.Graphics g)
Prepares foreground for painting |
void |
releaseFocus()
|
void |
requestFocus()
Sets the focusable state of this Component to the specified value. |
void |
setFont(javax.microedition.lcdui.Font font)
Sets the font of this component. |
protected void |
setHeight()
Calculates the component height |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int alignment
public int background
public static final int CENTER
public boolean focusable
public int focusedBackground
public int focusedForeground
protected javax.microedition.lcdui.Font font
font
can be null
.
setFont(javax.microedition.lcdui.Font)
public int foreground
protected int height
protected boolean isCompletelyVisible
protected boolean isFocused
isFocusOwner()
,
requestFocus()
,
releaseFocus()
protected boolean isVisible
public static final int LEFT
protected ScreenCanvas parentScreen
public static final int RIGHT
protected int screenY
protected boolean valid
invalidate()
public int width
Constructor Detail |
---|
public Component()
Method Detail |
---|
public void destructor()
public int getBackground()
public javax.microedition.lcdui.Font getFont()
public int getForeground()
public int getHeight()
public int getWidth()
public void invalidate()
public boolean isFocusOwner()
true
if this Component
is the
focus owner.
true
if this Component
is the
focus owner; false
otherwiseprotected boolean keyPressed(int keyCode)
protected boolean keyReleased(int keyCode)
protected boolean keyRepeated(int keyCode)
public void paint(javax.microedition.lcdui.Graphics g)
g
- the graphics context to use for paintingprotected void paintBackground(javax.microedition.lcdui.Graphics g)
g
- the Graphics contextprotected boolean pointerDragged(int x, int y)
protected boolean pointerPressed(int x, int y)
protected boolean pointerReleased(int x, int y)
protected void prepareForeground(javax.microedition.lcdui.Graphics g)
g
- the Graphics contextpublic void releaseFocus()
public void requestFocus()
isFocusOwner()
,
releaseFocus()
public void setFont(javax.microedition.lcdui.Font font)
font
- the font to become this component's font;
if this parameter is null
then this
component font won't be changedprotected void setHeight()
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |