org.havi.ui.event
Class HFocusEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.awt.AWTEvent
          extended by java.awt.event.ComponentEvent
              extended by java.awt.event.FocusEvent
                  extended by org.havi.ui.event.HFocusEvent
All Implemented Interfaces:
java.io.Serializable

public class HFocusEvent
extends java.awt.event.FocusEvent

An HFocusEvent event is used to interact with a component implementing the HNavigationInputPreferred interface as follows:

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.

See Also:
Serialized Form

Field Summary
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.
 
Fields inherited from class java.awt.event.FocusEvent
FOCUS_FIRST, FOCUS_GAINED, FOCUS_LAST, FOCUS_LOST
 
Fields inherited from class java.awt.event.ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, 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_MASK
 
Constructor Summary
HFocusEvent(java.awt.Component source, int id)
          Constructs an HFocusEvent.
HFocusEvent(java.awt.Component source, int id, int transfer)
          Constructs an HFocusEvent.
 
Method Summary
 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.
 
Methods inherited from class java.awt.event.FocusEvent
getOppositeComponent, paramString
 
Methods inherited from class java.awt.event.ComponentEvent
getComponent
 
Methods inherited from class java.awt.AWTEvent
getID, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HFOCUS_FIRST

public static final int HFOCUS_FIRST
The first integer id in the range of event ids supported by the HFocusEvent class.

See Also:
Constant Field Values

FOCUS_TRANSFER

public static final 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.

If a component matching the data cannot be found the component receiving this event should do nothing.

See Also:
Constant Field Values

HFOCUS_LAST

public static final int HFOCUS_LAST
The last integer id in the range of event ids supported by the HFocusEvent class.

See Also:
Constant Field Values

NO_TRANSFER_ID

public static final int NO_TRANSFER_ID
A constant returned from the getTransferId method if the event id is not FOCUS_TRANSFER.

See Also:
Constant Field Values
Constructor Detail

HFocusEvent

public HFocusEvent(java.awt.Component source,
                   int id)
Constructs an HFocusEvent.

Parameters:
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.

HFocusEvent

public HFocusEvent(java.awt.Component source,
                   int id,
                   int transfer)
Constructs an HFocusEvent.

Parameters:
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.
Method Detail

isTemporary

public boolean isTemporary()
Returns whether or not this focus change event is a temporary change.

Overrides:
isTemporary in class java.awt.event.FocusEvent
Returns:
an implementation specific value. The HAVi UI does not use temporary focus events and interoperable applications shall not call this method.

getTransferId

public int getTransferId()
Returns a key which maps to the component to transfer focus to.

Returns:
a key which maps to the component to transfer focus to, or 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.