public interface HActionable extends HNavigable, HActionInputPreferred
HComponent which
implement HActionable must respond to
HFocusEvent and HActionEvent events.
Applications should assume that classes which implement
HActionable can generate events of the
types HFocusEvent and HActionEvent in response to other
types of input event.
An application may add one or more
HActionListener listeners to the
component. The actionPerformed
method of the HActionListener is invoked whenever the
HActionable is actioned.
HAVi action events are discussed in detail in the HActionEvent class description.
HActionable component:
NORMAL_STATE
FOCUSED_STATE
ACTIONED_STATE
ACTIONED_FOCUSED_STATE
DISABLED_STATE
DISABLED_FOCUSED_STATE
The state machine diagram below shows the valid state
transitions for an HActionable component.
![]() |
Unlike HSwitchable components, the
transition back from an actioned state (i.e. one with the HState.ACTIONED_STATE_BIT bit set)
is automatically fired once all registered
HActionListener listeners have been called.
A direct consequence of this is that
HActionable components can only achieve the ACTIONED_STATE and
ACTIONED_FOCUSED_STATE states on a
temporary basis.
HActionable components may not be disabled while actioned.
HActionable interface. These classes shall all
generate both HFocusEvent and
HActionEvent events in
addition to any other events specified in the respective class
descriptions.
HNavigable,
HActionInputPreferred,
HActionEvent,
HActionListener| Modifier and Type | Method and Description |
|---|---|
void |
addHActionListener(HActionListener l)
Adds the specified
HActionListener to receive HActionEvent
events sent from this HActionable. |
HSound |
getActionSound()
Return the last action sound set by the
setActionSound() method
or null if no action sound has been set. |
void |
removeHActionListener(HActionListener l)
Removes the specified
HActionListener so that it no longer receives
HActionEvent events from this
HActionable. |
void |
setActionCommand(String command)
Sets the command name for the
HActionEvent event fired by this HActionable. |
void |
setActionSound(HSound sound)
Associate a sound to be played when the interaction state of
the
HActionable makes the following transitions: |
addHFocusListener, getGainFocusSound, getLoseFocusSound, getMove, isSelected, removeHFocusListener, setFocusTraversal, setGainFocusSound, setLoseFocusSound, setMovegetNavigationKeys, processHFocusEventgetActionCommand, processHActionEventvoid addHActionListener(HActionListener l)
HActionListener to receive HActionEvent
events sent from this HActionable. 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.l - the HActionListener.void removeHActionListener(HActionListener l)
HActionListener so that it no longer receives
HActionEvent events from this
HActionable. 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.l - the HActionListener.void setActionCommand(String command)
HActionEvent event fired by this HActionable.command - a String used to set the action
command. To remove the command specify a null command parameter.HActionEvent.getActionCommand()void setActionSound(HSound sound)
HActionable makes the following transitions:
sound - the sound to be played, when the component is
actioned. If sound content is already set, the original content
is replaced. To remove the sound specify a null
HSound.HSound getActionSound()
setActionSound() method
or null if no action sound has been set.Copyright © 2012 code4tv.com. All Rights Reserved.