|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.ui.vole.Component
public abstract class Component
Component is the base class for VOLE user interface objects.
(c) Copyright 2003-2007 DOMOLOGIC GmbH
Field Summary | |
---|---|
protected static java.util.Vector |
eventQueue
Event queue for this component |
protected static Component |
focusOwner
Current focus owner (global flag) |
protected Resource |
font
A font resource for drawing text. |
protected Graphics |
g
The graphic context |
protected int |
height
The control's height |
protected ActionListener |
listener
ActionListener, called on ActionEvents |
protected Container |
parent
The parent of the control. |
protected boolean |
visible
Our visibility |
protected int |
width
The control's width |
protected int |
x
The control's x location |
protected int |
y
The control's y location |
Constructor Summary | |
---|---|
Component()
|
Method Summary | |
---|---|
int[] |
getBounds()
Returns the current bounds of this component as array of int. |
Container |
getParent()
Return the parent container if available. |
boolean |
isVisible()
Get visible state. |
void |
onActionEvent(ActionEvent e)
ActionEvent event handler. |
boolean |
onKeyEvent(KeyEvent e)
Keyboard event handler. |
void |
paint()
Paints this component. |
void |
remove()
Removes this component and draws a rectangle in the background color. |
void |
removeFocus()
Removes the focus from this Component. |
void |
requestFocus()
Sets the focus to this Component. |
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 |
setGraphics(Graphics g)
This method is called to set the main Display context for this component. |
void |
setParent(Container parent)
Sets the parent Container |
void |
setVisible(boolean visible)
Turns the component visible or invisible. |
boolean |
transferFocus()
Transfers the focus to the next component. |
void |
validate()
Calculate and set the preferred size of this Component . |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Graphics g
protected boolean visible
protected Resource font
protected ActionListener listener
protected static Component focusOwner
protected static java.util.Vector eventQueue
Constructor Detail |
---|
public Component()
Method Detail |
---|
public boolean onKeyEvent(KeyEvent e)
e
- the KeyEvent
Container
.public void onActionEvent(ActionEvent e)
e
- the ActionEventpublic Container getParent()
public void setParent(Container parent)
parent
- the Container to be the parent Objectpublic boolean transferFocus()
public void removeFocus()
public void requestFocus()
public void setGraphics(Graphics g)
g
- the Displaypublic void remove()
public void paint()
public void setVisible(boolean visible)
onoff
- true, if visible - false, otherwisepublic boolean isVisible()
public void setBounds(int x, int y, int width, int height)
x
- x coordinate of the upper left cornery
- y coordinate of the upper left cornerwidth
- The width of this componentheight
- The height of this componentpublic int[] getBounds()
public void setFont(Resource font)
font
- The new font.public void validate()
Component
.
The calculated values depend on various parameters like font size
and drawing styles. After calculation, the component's paint
-
method should be invoked.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |