|
|||||||||
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.AbstractFocusComponent
public abstract class AbstractFocusComponent
Abstract superclass for components that can be controlled by the keyboard.
(C) DOMOLOGIC Home Automation GmbH 2005 - 2007
Field Summary | |
---|---|
protected static int |
BORDER_WIDTH
|
protected ActionListener |
listener
|
Fields inherited from interface jcontrol.ui.wombat.IFocusable |
---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
Constructor Summary | |
---|---|
AbstractFocusComponent()
|
Method Summary | |
---|---|
protected void |
clearCorners(Graphics g,
int x,
int y,
int width,
int height,
Color background)
|
protected void |
drawBevelRect(XGraphics g,
int x,
int y,
int width,
int height,
boolean shadowIn,
boolean withFocus,
Color background)
|
protected void |
drawButton(XGraphics g,
int x,
int y,
int width,
int height,
boolean pressed,
boolean fill,
Color background)
|
protected void |
drawDottedRect(Graphics g,
int x,
int y,
int width,
int height)
Draw a dotted rectangle. |
protected void |
drawFocusRect(Graphics g,
int x,
int y,
int width,
int height)
|
ActionListener |
getActionListener()
Returns the ActionListener of this Component. |
protected void |
onActionEvent(ActionEvent e)
Pushes the ActionEvent to the global event queue. |
abstract KeyEvent |
onKeyEvent(KeyEvent event)
This method is called when a keyboard action has been performed. |
abstract int |
onTouchEvent(TouchEvent event)
Every time a touch event is fired, this method will be called. |
boolean |
requestFocus()
Sets the focus to this Component. |
void |
setActionListener(ActionListener listener)
Add an ActionListener to the component. |
void |
setEnabled(boolean enabled)
Sets the enabled state of this component. |
void |
setVisible(boolean visible)
Turns the component visible or invisible. |
Methods inherited from class jcontrol.ui.wombat.Component |
---|
drawDisabledImage, getFrame, isEnabled, isVisible, isVisibleInternal, paint, redrawInternalAndParent, repaint, repaintAll, safeExec, setBackgroundColor, setBackgroundColorInternal, setBounds, setDirty, setFont, setForegroundColor, setForegroundColorInternal, setParametersInternal, setRedraw, setTransparentColor, unsafeExec, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
protected static final int BORDER_WIDTH
protected ActionListener listener
Constructor Detail |
---|
public AbstractFocusComponent()
Method Detail |
---|
protected void drawButton(XGraphics g, int x, int y, int width, int height, boolean pressed, boolean fill, Color background)
protected void clearCorners(Graphics g, int x, int y, int width, int height, Color background)
protected void drawBevelRect(XGraphics g, int x, int y, int width, int height, boolean shadowIn, boolean withFocus, Color background)
protected void drawFocusRect(Graphics g, int x, int y, int width, int height)
protected void drawDottedRect(Graphics g, int x, int y, int width, int height)
public abstract int onTouchEvent(TouchEvent event)
TouchListener
onTouchEvent
in interface TouchListener
event
- The touch event.
RESULT_ACCEPTED
if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED
if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE
if the TouchEvent should be passed on to the next TouchListener.public void setActionListener(ActionListener listener)
setActionListener
in interface ActionProducer
listener
- an ActionListenerpublic ActionListener getActionListener()
getActionListener
in interface ActionProducer
public abstract KeyEvent onKeyEvent(KeyEvent event)
onKeyEvent
in interface KeyListener
event
- the event that contains information about the key.
null
if the KeyEvent has been consumed by the KeyListener,protected void onActionEvent(ActionEvent e)
e
- the ActionEventpublic boolean requestFocus()
requestFocus
in interface IFocusable
public void setVisible(boolean visible)
setVisible
in class Component
visible
- the visible state to set.public void setEnabled(boolean enabled)
setEnabled
in class Component
enabled
- the enabled state.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |