org.havi.ui
Interface HItemValue

All Superinterfaces:
HNavigable, HNavigationInputPreferred, HOrientable, HSelectionInputPreferred
All Known Implementing Classes:
HListGroup

public interface HItemValue
extends HNavigable, HSelectionInputPreferred

This interface is implemented by all HAVi UI components which have some form of selectable content (e.g. a list group).

Event Behavior

Subclasses of HComponent which implement HItemValue must respond to HFocusEvent and HItemEvent events.

Applications should assume that classes which implement HItemValue can generate events of the types HFocusEvent and HItemEvent in response to other types of input event.

An application may add one or more HItemListener listeners to the component. The selectionChanged method of the HItemListener is invoked whenever the selection managed by the HItemValue is changed.

HAVi item events are discussed in detail in the HSelectionInputPreferred interface description.

Interaction States

The following interaction states are valid for this HItemValue component:

The state machine diagram below shows the valid state transitions for an HItemValue component.

Platform Classes

The following HAVi platform classes implement or inherit the HItemValue interface. These classes shall all generate both HFocusEvent and HItemEvent events in addition to any other events specified in the respective class descriptions.

See Also:
HNavigable, HOrientable, HSelectionInputPreferred, HItemEvent, HItemListener

Field Summary
 
Fields inherited from interface org.havi.ui.HOrientable
ORIENT_BOTTOM_TO_TOP, ORIENT_LEFT_TO_RIGHT, ORIENT_RIGHT_TO_LEFT, ORIENT_TOP_TO_BOTTOM
 
Method Summary
 void addItemListener(HItemListener l)
          Adds the specified HItemListener to receive HItemEvents sent from this object.
 HSound getSelectionSound()
          Get the sound to be played when the selection changes.
 void removeItemListener(HItemListener l)
          Removes the specified HItemListener so that it no longer receives HItemEvents from this object.
 void setSelectionSound(HSound sound)
          Associate a sound to be played when the selection is modified.
 
Methods inherited from interface org.havi.ui.HNavigable
addHFocusListener, getGainFocusSound, getLoseFocusSound, getMove, isSelected, removeHFocusListener, setFocusTraversal, setGainFocusSound, setLoseFocusSound, setMove
 
Methods inherited from interface org.havi.ui.HNavigationInputPreferred
getNavigationKeys, processHFocusEvent
 
Methods inherited from interface org.havi.ui.HSelectionInputPreferred
getSelectionMode, processHItemEvent, setSelectionMode
 
Methods inherited from interface org.havi.ui.HOrientable
getOrientation, setOrientation
 

Method Detail

addItemListener

void addItemListener(HItemListener l)
Adds the specified HItemListener to receive HItemEvents sent from this object. If the listener has already been added further calls will add further references to the listener, which will then receive multiple copies of a single event.

Parameters:
l - the HItemListener to be notified.

removeItemListener

void removeItemListener(HItemListener l)
Removes the specified HItemListener so that it no longer receives HItemEvents from this object. If the specified listener is not registered, the method has no effect. If multiple references to a single listener have been registered it should be noted that this method will only remove one reference per call.

Parameters:
l - the HItemListener to be removed from notification.

setSelectionSound

void setSelectionSound(HSound sound)
Associate a sound to be played when the selection is modified. The sound is played irrespective of whether an HItemEvent is sent to one or more listeners.

Parameters:
sound - the sound to be played, when the selection is modified. If sound content is already set, the original content is replaced. To remove the sound specify a null HSound.

getSelectionSound

HSound getSelectionSound()
Get the sound to be played when the selection changes.

Returns:
The sound played when the selection changes