HItemEvent

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.havi.ui.event
Class HItemEvent

    java.lang.Object
      java.util.EventObject
          java.awt.AWTEvent
              org.havi.ui.event.HItemEvent

All Implemented Interfaces:
  Serializable

    public class HItemEvent

extends AWTEvent

An `HItemEvent` event is used to interact with a component implementing the `HSelectionInputPreferred` interface as follows:

- An `HItemEvent` event may be sent from the HAVi system to the component to change the state of the component, and the selection set held by the component.
- An `HItemEvent` event is sent from the component to all registered `HItemListener`s when a change to the component state or selection set occurs.

The `HItemEvent` event class therefore provides support for selecting and clearing individual elements, selecting or clearing all elements and managing the currently focused element, i.e. the item whose selection state is toggled by some user interaction.

All interoperable HAVi components which expect to receive `HItemEvent` events should implement the `HSelectionInputPreferred` interface.

See Also:
  `HListGroup`, Serialized Form

Field Summary
`static int` | `ITEM_CLEARED` An item event with this id is sent from the component whenever an item is removed from the selection set of an `HItemValue` component.
`static int` | `ITEM_END_CHANGE` An item event with this id indicates that the selection of an HItemValue component has been finally set.
`static int` | `ITEM_FIRST` The first integer id in the range of event ids supported by the `HItemEvent` class.
`static int` | `ITEM_LAST` The last integer id in the range of event ids supported by the `HItemEvent` class.
`static int` | `ITEM_SELECTED` An item event with this id is sent from the component whenever an item is added to the selection set of an `HItemValue` component.
`static int` | `ITEM_SELECTION_CLEARED` An item event with this id is sent to or from the component whenever the entire selection set of an `HItemValue` component is removed.
`static int` | `ITEM_SET_CURRENT` An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes.
`static int` | `ITEM_SET_NEXT` An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes to the next item in the group.
`static int` | `ITEM_SET_PREVIOUS` An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes to the previous item in the group.
`static int` | `ITEM_START_CHANGE` An item event with this id indicates that the selection of an `HItemValue` component may be about to change.
`static int` | `ITEM_TOGGLE_SELECTED` An item event with this id may be sent to an `HItemValue` component to toggle the selection state of the currently focused item.
`static int` | `SCROLL_LESS` An HItemEvent with this id is sent to the widget to request a decrease of the scrolling position of an HItemValue by one unit in response to mouse actions.
`static int` | `SCROLL_MORE` An HItemEvent with this id is sent to the widget to request an increase of the scrolling position of an HItemValue by one unit in response to mouse actions.
`static int` | `SCROLL_PAGE_LESS` An HItemEvent with this id is sent to the widget to request a decrease of the scrolling position of an HItemValue by one block in response to mouse actions.
`static int` | `SCROLL_PAGE_MORE` An HItemEvent with this id is sent to the widget to request an increase of the scrolling position of an HItemValue by one block in response to mouse actions.

Fields inherited from class java.awt.AWTEvent
`ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, CONTAINER_EVENT_MASK, FOCUS_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`

Constructor Summary
`HItemEvent(HSelectionInputPreferred source, int id, Object item)` Constructs an HItemEvent

Method Summary
`Object` | `getItem()` Retrieve the item which caused this `HItemEvent`.

Methods inherited from class java.awt.AWTEvent
`getID, paramString, 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

### ITEM_FIRST

    public static final int ITEM_FIRST

  The first integer id in the range of event ids supported by the `HItemEvent` class.

  See Also:
    Constant Field Values

### ITEM_START_CHANGE

    public static final int ITEM_START_CHANGE

  An item event with this id indicates that the selection of an `HItemValue` component may be about to change. This event is sent to or from the component when the user causes the component to enter selection mode. Note that it is a platform specific implementation option for such components to enter selection mode automatically e.g. when they receive input focus. In such a case the order in which the `HFocusEvent` and `HItemEvent` are sent is platform specific.

  See Also:
    `HSelectionInputPreferred.getSelectionMode()`, Constant Field Values

### ITEM_TOGGLE_SELECTED

    public static final int ITEM_TOGGLE_SELECTED

  An item event with this id may be sent to an `HItemValue` component to toggle the selection state of the currently focused item. Note that events of this type are never sent to listeners from the component; instead an event of type `ITEM_SELECTED` or `ITEM_CLEARED` is sent in response to an event with this id, depending on the new state of the currently focused item.

  See Also:
    Constant Field Values

### ITEM_SELECTED

    public static final int ITEM_SELECTED

  An item event with this id is sent from the component whenever an item is added to the selection set of an `HItemValue` component. Note that events of this type are silently ignored if they are sent to the component.

  See Also:
    Constant Field Values

### ITEM_CLEARED

    public static final int ITEM_CLEARED

  An item event with this id is sent from the component whenever an item is removed from the selection set of an `HItemValue` component. Note that events of this type are silently ignored if they are sent to the component.

  See Also:
    Constant Field Values

### ITEM_SELECTION_CLEARED

    public static final int ITEM_SELECTION_CLEARED

  An item event with this id is sent to or from the component whenever the entire selection set of an `HItemValue` component is removed.

  See Also:
    Constant Field Values

### ITEM_SET_CURRENT

    public static final int ITEM_SET_CURRENT

  An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes.

  See Also:
    Constant Field Values

### ITEM_SET_PREVIOUS

    public static final int ITEM_SET_PREVIOUS

  An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes to the previous item in the group.

  See Also:
    Constant Field Values

### ITEM_SET_NEXT

    public static final int ITEM_SET_NEXT

  An item event with this id is sent to or from the component whenever the current item of an `HItemValue` component changes to the next item in the group.

  See Also:
    Constant Field Values

### SCROLL_MORE

    public static final int SCROLL_MORE

  An HItemEvent with this id is sent to the widget to request an increase of the scrolling position of an HItemValue by one unit in response to mouse actions. Use of this constant is implementation-specific.

  See Also:
    Constant Field Values

### SCROLL_LESS

    public static final int SCROLL_LESS

  An HItemEvent with this id is sent to the widget to request a decrease of the scrolling position of an HItemValue by one unit in response to mouse actions. Use of this constant is implementation-specific.

  See Also:
    Constant Field Values

### SCROLL_PAGE_MORE

    public static final int SCROLL_PAGE_MORE

  An HItemEvent with this id is sent to the widget to request an increase of the scrolling position of an HItemValue by one block in response to mouse actions. The value of a block is implementation-dependent. Use of this constant is implementation-specific.

  See Also:
    Constant Field Values

### SCROLL_PAGE_LESS

    public static final int SCROLL_PAGE_LESS

  An HItemEvent with this id is sent to the widget to request a decrease of the scrolling position of an HItemValue by one block in response to mouse actions. The value of a block is implementation-dependent. Use of this constant is implementation-specific.

  See Also:
    Constant Field Values

### ITEM_END_CHANGE

    public static final int ITEM_END_CHANGE

  An item event with this id indicates that the selection of an HItemValue component has been finally set. This event is sent to or from the component when the user causes the component to leave selection mode. Note that it is a platform specific implementation option for such components to leave selection mode automatically e.g. when they lose input focus. In such a case the order in which the `HFocusEvent` and `HItemEvent` are sent is platform specific.

  See Also:
    `HSelectionInputPreferred.getSelectionMode()`, Constant Field Values

### ITEM_LAST

    public static final int ITEM_LAST

  The last integer id in the range of event ids supported by the `HItemEvent` class.

  See Also:
    Constant Field Values

Constructor Detail

### HItemEvent

    public HItemEvent(HSelectionInputPreferred source,
                      int id,
                      Object item)

  Constructs an HItemEvent

  Parameters:
    `source` - The `HSelectionInputPreferred` component whose value or current item has been modified.
    `id` - The event id of the HItemEvent generated by the `HSelectionInputPreferred` component. This is the value that will be returned by the event object's `getID` method.
    `item` - The item which caused the change, or `null` if this information is not available. If the event is sent to listeners, this information shall be provided if the event id is one of `ITEM_SELECTED`, `ITEM_CLEARED`, `ITEM_SET_NEXT` or `ITEM_SET_PREVIOUS`.

Method Detail

### getItem

    public Object getItem()

  Retrieve the item which caused this `HItemEvent`. This information is not available for the `ITEM_SELECTION_CLEARED` event id.

  Returns:
    the item which was selected or cleared, or became the current item, or `null` if this information is not available for this event.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD