public class HFocusEvent extends FocusEvent
HFocusEvent event is used to
interact with a component implementing the HNavigationInputPreferred
interface as follows:
HFocusEvent event may be sent
from the HAVi system to the component to inform the component that
it has gained or lost the input focus, or that it should transfer
focus to another component.
HFocusEvent event is sent
from the component to all registered HFocusListener listeners whenever
the component focus status changes.
Note that because the underlying focus mechanism is based on AWT, focus transfer events do not guarantee that another component will actually get focus, or that the current component will lose focus.
All interoperable HAVi components which expect to receive HFocusEvent events must implement the
HNavigationInputPreferred interface.
| Modifier and Type | Field and Description |
|---|---|
static int |
FOCUS_TRANSFER
An event id which indicates that the component should transfer
focus to the component identified by the data returned from the
getTransferId method. |
static int |
HFOCUS_FIRST
The first integer id in the range of event ids supported by the
HFocusEvent class. |
static int |
HFOCUS_LAST
The last integer id in the range of event ids supported by the
HFocusEvent class. |
static int |
NO_TRANSFER_ID
A constant returned from the
getTransferId
method if the event id is not FOCUS_TRANSFER. |
FOCUS_FIRST, FOCUS_GAINED, FOCUS_LAST, FOCUS_LOSTCOMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWNACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASKsource| Constructor and Description |
|---|
HFocusEvent(Component source,
int id)
Constructs an
HFocusEvent. |
HFocusEvent(Component source,
int id,
int transfer)
Constructs an
HFocusEvent. |
| Modifier and Type | Method and Description |
|---|---|
int |
getTransferId()
Returns a key which maps to the component to transfer
focus to.
|
boolean |
isTemporary()
Returns whether or not this focus change event is a temporary
change.
|
getOppositeComponent, paramStringgetComponentgetSourcepublic static final int HFOCUS_FIRST
HFocusEvent class.public static final int FOCUS_TRANSFER
getTransferId method.
If a component matching the data cannot be found the component receiving this event should do nothing.
public static final int HFOCUS_LAST
HFocusEvent class.public static final int NO_TRANSFER_ID
getTransferId
method if the event id is not FOCUS_TRANSFER.public HFocusEvent(Component source, int id)
HFocusEvent.source - The java.awt.Component component
which originated this event.id - The event id of the HFocusEvent generated
by the HNavigable
component. This is the value that will be returned by the
event object's getID method.public HFocusEvent(Component source, int id, int transfer)
HFocusEvent.source - The java.awt.Component component
which originated this event.id - The event id of the HFocusEvent generated
by the HNavigable
component. This is the value that will be returned by the
event object's getID method.transfer - a key which maps to the component to transfer
focus to, if the id parameter has the value FOCUS_TRANSFER. If the id parameter does not have
this value NO_TRANSFER_ID is substituted for its value.public boolean isTemporary()
isTemporary in class FocusEventpublic int getTransferId()
NO_TRANSFER_ID if the id of this event is not FOCUS_TRANSFER.
The return value of this function is used to pass key codes to
an HNavigable to implement focus
transfer for HAVi UI components.
Copyright © 2012 code4tv.com. All Rights Reserved.