|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
org.havi.ui.HComponent
org.havi.ui.HVisible
org.havi.ui.HListGroup
The HListGroup
is a user interface
component representing a list of selectable items (HListElements
) which contain
graphical and / or textual content.
This component can be navigated to, i.e. it can have the input
focus. It also responds to HItemEvent
events as follows:
ITEM_START_CHANGE
event to the component causes it to enter selection mode.
ITEM_END_CHANGE
event to the component causes it to leave selection mode.
ITEM_SET_CURRENT
,
ITEM_SET_PREVIOUS
and ITEM_SET_NEXT
events to
the component.
ITEM_TOGGLE_SELECTED
event causes the current item to be toggled
between a selected and unselected state.
ITEM_SELECTION_CLEARED
event to the component causes the current
selection set to be cleared.
HItemEvent
with id SCROLL_PAGE_MORE
or SCROLL_PAGE_LESS by adjusting the scrollposition with the value returned
by HListGroupLook.getNumVisible(HVisible visible), or an implementation-
specific value if no look has been set on this widget.
HListGroup
has the following properties
which make it slightly different from the other platform
components.
HTextLayoutManager
to render text from the elements. HListGroup
is not required to respect the
default horizontal and vertical content alignments specified by
HVisible
. For HListGroup
these defaults are implementation
specific. Application programmers who require a specific
alignment policy must therefore make explicit calls to setHorizontalAlignment
and setVerticalAlignment
to enforce the alignments required.
HVisible
determines how the icons are scaled.
HItemEvent
events.
HListGroup
component, the following
constraints are applied:
HListGroupLook.getMinimumSize(org.havi.ui.HVisible)
).
setDefaultSize
rounded
down to the nearest element (minimum of one) or the size
required to present 5 elements if a default size is not set.
Interoperable HAVi applications shall not add
HListElements
more than once. If an
application requires items with identical contents (label and/or
icon), then additional items shall be created. The behavior of the
HListGroup
if duplicates are added is
implementation specific. The methods setIcon()
and
setLabel()
of HListElement
shall not be
used for elements, which are part of HListGroup
. If an
application requires to alter the content, it shall either replace
the entire element, or remove it temporarily and re-add it after the content
was changed.
By default this component uses the HListGroupLook
class to render itself.
Parameter | Description | Default value | Set method | Get method |
---|---|---|---|---|
x | x-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
y | y-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
width | width of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
height | height of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
items | The initial list of elements for this HListGroup or null for an empty list. | null | setListContent(org.havi.ui.HListElement[]) |
getListContent() |
HListElement
,
HListGroupLook
,
HNavigable
,
HItemValue
,
Serialized FormField Summary | |
static int |
ADD_INDEX_END
A constant for use with addItem and addItems
which specifies that the new items shall be appended to the
end of the list. |
static int |
DEFAULT_ICON_HEIGHT
A constant for use with setIconSize and getIconSize . |
static int |
DEFAULT_ICON_WIDTH
A constant for use with setIconSize and getIconSize . |
static int |
DEFAULT_LABEL_HEIGHT
A constant for use with setLabelSize and getLabelSize . |
static int |
DEFAULT_LABEL_WIDTH
A constant for use with setLabelSize and getLabelSize . |
static int |
ITEM_NOT_FOUND
A constant which shall be returned from getIndex if the
requested element is not found in the content. |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface org.havi.ui.HOrientable |
ORIENT_BOTTOM_TO_TOP, ORIENT_LEFT_TO_RIGHT, ORIENT_RIGHT_TO_LEFT, ORIENT_TOP_TO_BOTTOM |
Fields inherited from interface org.havi.ui.HState |
ACTIONED_FOCUSED_STATE, ACTIONED_STATE, ACTIONED_STATE_BIT, ALL_STATES, DISABLED_ACTIONED_FOCUSED_STATE, DISABLED_ACTIONED_STATE, DISABLED_FOCUSED_STATE, DISABLED_STATE, DISABLED_STATE_BIT, FIRST_STATE, FOCUSED_STATE, FOCUSED_STATE_BIT, LAST_STATE, NORMAL_STATE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HListGroup()
Creates an HListGroup
object. |
|
HListGroup(HListElement[] items)
Creates an HListGroup
object. |
|
HListGroup(HListElement[] items,
int x,
int y,
int width,
int height)
Creates an HListGroup
object. |
Method Summary | |
void |
addHFocusListener(HFocusListener l)
Adds the specified HFocusListener to
receive HFocusEvent events sent from
this HNavigable : 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. |
void |
addItem(HListElement item,
int index)
Add an item to this HListGroup . |
void |
addItemListener(HItemListener l)
Adds the specified HItemListener to
receive HItemEvents sent from this object. |
void |
addItems(HListElement[] items,
int index)
Add an array of items to this HListGroup . |
void |
clearSelection()
Destroy the selection. |
int |
getCurrentIndex()
Retrieve the current active item index, if one is currently chosen. |
HListElement |
getCurrentItem()
Retrieve the current active item, if one has been chosen. |
static HListGroupLook |
getDefaultLook()
Returns the currently set default HLook for HListGroup
components. |
HSound |
getGainFocusSound()
Get the sound associated with the gain focus event. |
java.awt.Dimension |
getIconSize()
Retrieve the icon size for this HListGroup . |
int |
getIndex(HListElement item)
Retrieve the index position of an item in the content list. |
HListElement |
getItem(int index)
Retrieve an item from the content list by index. |
java.awt.Dimension |
getLabelSize()
Retrieve the label size for this HListGroup . |
HListElement[] |
getListContent()
Retrieve the list content for this HListGroup . |
HSound |
getLoseFocusSound()
Get the sound associated with the lost focus event. |
HNavigable |
getMove(int keyCode)
Provides the HNavigable object
that is navigated to when a particular key is pressed. |
boolean |
getMultiSelection()
Return the multiple selection mode currently active for this HListGroup. |
int[] |
getNavigationKeys()
Retrieve the set of key codes which this component maps to navigation targets. |
int |
getNumItems()
Retrieve the number of items in the content list. |
int |
getNumSelected()
Return the number of items which would be in the selection, if the HListGroup#getSelection method were called at this time. |
int |
getOrientation()
Retrieve the orientation of the HListGroup. |
int |
getScrollPosition()
Retrieve the scroll position of the HListGroup . |
HListElement[] |
getSelection()
Get the selection from this HListGroup . |
int[] |
getSelectionIndices()
Get the list of selection indices from this HListGroup . |
boolean |
getSelectionMode()
Get the selection mode for this HListGroup . |
HSound |
getSelectionSound()
Get the sound to be played when the selection changes. |
boolean |
isItemSelected(int index)
Retrieve the selection state of a particular HListElement .
|
boolean |
isSelected()
Indicates if this component has focus. |
void |
processHFocusEvent(HFocusEvent evt)
Process an HFocusEvent sent to this HListGroup . |
void |
processHItemEvent(HItemEvent evt)
Process an HItemEvent sent to this HListGroup .
|
void |
removeAllItems()
Remove all the content. |
void |
removeHFocusListener(HFocusListener l)
Removes the specified HFocusListener
so that it no longer receives HFocusEvent events from this HNavigable . |
HListElement |
removeItem(int index)
Remove the HListElement at the specified index. |
void |
removeItemListener(HItemListener l)
Removes the specified HItemListener so
that it no longer receives HItemEvents from
this object. |
boolean |
setCurrentItem(int index)
Set the current active item. |
static void |
setDefaultLook(HListGroupLook look)
Sets the default HLook for further
HListGroup Components. |
void |
setFocusTraversal(HNavigable up,
HNavigable down,
HNavigable left,
HNavigable right)
Set the focus control for an HNavigable component. |
void |
setGainFocusSound(HSound sound)
Associate a sound with gaining focus, i.e. when the HNavigable receives a
HFocusEvent event of type
FOCUS_GAINED . |
void |
setIconSize(java.awt.Dimension size)
Set the icon size for this HListGroup . |
void |
setItemSelected(int index,
boolean sel)
Set the selection state of a particular HListElement .
|
void |
setLabelSize(java.awt.Dimension size)
Set the label size for this HListGroup . |
void |
setListContent(HListElement[] elements)
Set the list content for this HListGroup. |
void |
setLook(HLook hlook)
Sets the HLook for this component. |
void |
setLoseFocusSound(HSound sound)
Associate a sound with losing focus, i.e. when the HNavigable receives a
HFocusEvent event of type
FOCUS_LOST. |
void |
setMove(int keyCode,
HNavigable target)
Defines the navigation path from the current HNavigable to another HNavigable when a particular key is
pressed. |
void |
setMultiSelection(boolean multi)
Set the multiple selection mode for this HListGroup. |
void |
setOrientation(int orient)
Set the orientation of the HListGroup. |
void |
setScrollPosition(int scroll)
Set the scroll position of the HListGroup . |
void |
setSelectionMode(boolean edit)
Set the selection mode for this HListGroup .
|
void |
setSelectionSound(HSound sound)
Associate a sound to be played when the selection is modified. |
Methods inherited from class org.havi.ui.HComponent |
getMatte, isDoubleBuffered, isEnabled, processEvent, setMatte |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setCursor, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ITEM_NOT_FOUND
getIndex
if the
requested element is not found in the content.
public static final int ADD_INDEX_END
addItem
and addItems
which specifies that the new items shall be appended to the
end of the list.
public static final int DEFAULT_LABEL_WIDTH
setLabelSize
and getLabelSize
. When no call to
setLabelSize
has been
made then getLabelSize
will return this value for its default width. The default label
width for all orientations is implementation specific.
public static final int DEFAULT_LABEL_HEIGHT
setLabelSize
and getLabelSize
. When no call to
setLabelSize
has been
made then getLabelSize
will return this value for its default height. The default label
height for all orientations is the current font height.
public static final int DEFAULT_ICON_WIDTH
setIconSize
and getIconSize
. When no call to
setIconSize
has been
made then getIconSize
will return this value for its default width. The default icon
width for all orientations is implementation specific.
public static final int DEFAULT_ICON_HEIGHT
setIconSize
and getIconSize
. When no call to
setIconSize
has been
made then getIconSize
will return this value for its default height. The default icon
height for all orientations is implementation specific.
Constructor Detail |
public HListGroup()
HListGroup
object. See the class description for details of constructor
parameters and default values.
public HListGroup(HListElement[] items)
HListGroup
object. See the class description for details of constructor
parameters and default values.
public HListGroup(HListElement[] items, int x, int y, int width, int height)
HListGroup
object. See the class description for details of constructor
parameters and default values.
Method Detail |
public void setLook(HLook hlook) throws HInvalidLookException
HLook
for this component.
setLook
in class HVisible
hlook
- The HLook
that is to be
used for this component.
Note that this parameter may be null, in which case the
component will not draw itself until a look is set.
HInvalidLookException
- If the Look is not an HListGroupLook
.public static void setDefaultLook(HListGroupLook look)
HLook
for further
HListGroup
Components.
look
- The HLook
that will be
used by default when creating a new HListGroup
component.
Note that this parameter may be null, in which case newly
created components shall not draw themselves until a non-null
look is set using the setLook
method.public static HListGroupLook getDefaultLook()
HLook
for HListGroup
components.
HLook
that is used by
default when creating a new HListGroup
component.public HListElement[] getListContent()
HListGroup
.
null
if no content has
been set.public void setListContent(HListElement[] elements)
HItemEvent
with an ID of
ITEM_SELECTION_CLEARED
shall be generated and sent
to all registered listeners.
If elements
is null
then the current
active item index shall be set to ITEM_NOT_FOUND
. If
elements is not null
then the current active item
index shall be set to zero. An HItemEvent with an ID of
ITEM_SET_CURRENT
shall be sent to all registered listeners.
elements
- the list content. If this parameter is
null
any existing content is removed.public void addItem(HListElement item, int index)
HListGroup
. The item is inserted at the specified zero-based
index in the content list. All following elements are shifted. If
no content exists a new content list is created to contain the
new item and the value of the index
parameter is
ignored.
If the act of adding a new item causes the current active item
index to change, an HItemEvent
shall be sent.
Note that items are stored in the content list by reference, they are not copied.
item
- the item to add.index
- the index of the currently existing item which the
new item should be placed at, or ADD_INDEX_END
to append the new item to the end of the list. If this value
is not a valid item index for this list a
java.lang.IndexOutOfBoundsException
shall be
thrown.public void addItems(HListElement[] items, int index)
HListGroup
. The items are inserted in the same order as they
are in the array at the specified zero-based index. All following
items are shifted. If no content exists a new content list is
created to contain the new items and the value of the
index
parameter is ignored.
If the act of adding a new item causes the current active item
index to change, an HItemEvent
shall be sent.
Note that items are stored in the content list by reference, they are not copied.
items
- the items to add.index
- the index of the currently existing item which the
new items should be placed at, or ADD_INDEX_END
to append the new items to the end of the list. If this value
is not a valid item index for this list a
java.lang.IndexOutOfBoundsException
shall be
thrown.public HListElement getItem(int index)
index
- the index of the item to retrieve. If this
parameter is negative a
java.lang.IllegalArgumentException
shall be thrown.
HListElement
at
the given index, or null
if no such element
exists.public int getIndex(HListElement item)
item
- the item to retrieve the index for.
HListElement
, or ITEM_NOT_FOUND
if no such element exists.public int getNumItems()
public HListElement removeItem(int index)
If the item is the only HListElement in this HListGroup then the
current active item index shall be set to
ITEM_NOT_FOUND
. If the removal of the item causes
a change of the current active item index, then an HItemEvent
with an ID of ITEM_SET_CURRENT
shall be generated
and sent to all registered listeners.
If the item is selected then it shall be removed from the selection
and an HItemEvent with an ID of ITEM_CLEARED
shall
be generated and sent to all registered listeners.
index
- the index of the item to remove.
HListElement
that has
been removed or null
if the index is not valid. No
exception is thrown if index
is not valid.getSelection()
public void removeAllItems()
ITEM_SELECTION_CLEARED
shall be generated and sent
to all registered listeners.
The current active item index shall be set to
ITEM_NOT_FOUND
and an HItemEvent with an ID of
ITEM_SET_CURRENT
shall be generated and sent to all
registered listeners.
getSelection()
public int getCurrentIndex()
HListElement
which would be
selected or deselected should the user toggle the
HListGroup
. If there is no
current element or there is no content set this method shall
return ITEM_NOT_FOUND
.
ITEM_NOT_FOUND
if
no such item exists.public HListElement getCurrentItem()
HListElement
which
would be selected or deselected should the user toggle the
HListGroup
. If there is no
current item or there is no content set this method shall
return null
.
null
if no such item
exists.public boolean setCurrentItem(int index)
HListElement
which would be selected
or deselected should the user toggle the HListGroup.
If index is valid for this HListGroup then the current active item
index shall be set to index. If this causes a change in the current
active item index then an HItemEvent with an ID of
ITEM_SET_CURRENT
shall be generated and sent to
all registered listeners.
index
- the index of the new current item.
true
if the current item was changed,
false
if index
was not a valid index
for this HListGroup or the
current item was not changed because it was already
the current item. No exception is thrown if index
is not
valid.public int[] getSelectionIndices()
HListGroup
. The selection is
defined as that set of
HListElement
indices which
the user has caused to be selected by toggling the HListGroup
.
null
if no items
are selected. Only items which are currently part of the content
for this HListGroup
may be
selected.public HListElement[] getSelection()
HListGroup
. The selection is defined as that set of HListElements
which the user has
caused to be selected by toggling the HListGroup
.
null
if no items are
selected. Only items which are currently part of the content
for this HListGroup
may be
selected.public void clearSelection()
HListElement
, but does not
remove them from the HListGroup
. After calling this method calls to getSelection
shall return
null
until a new selection is made.
If the selection was not already empty, an HItemEvent
shall be sent to any registered listeners.
getSelection()
public int getNumSelected()
HListGroup#getSelection
method were called at this time.
public boolean getMultiSelection()
HListElement
selected at a time.
true
if multiple selections are permitted,
false
otherwise.public void setMultiSelection(boolean multi)
HListElement
selected at a time.
Note that if the HListGroup is
switched out of multiple selection mode and more than one item
is selected, the selection shall change so that the first of
the items is selected and the others are deselected. An
HItemEvent
with an ID of
ITEM_CLEARED
shall be sent to all registered listeners
for each deselected item.
multi
- true
if multiple selections are to be
permitted, false
otherwise.public void setItemSelected(int index, boolean sel)
HListElement
.
If a call to this method causes an item to become deselected an
HItemEvent with an ID of ITEM_CLEARED
shall be sent to
all registered listeners. This can happen because either
sel
is false or this HListGroup is not in multi
selection mode.
If a call to this method causes a non selected item to become a
selected item then an HItemEvent with an ID of
ITEM_SELECTED
shall be sent to all registered listeners.
index
- the index of the HListElement
to alter. A
java.lang.IllegalArgumentException
shall be thrown
if this index is not valid for the HListGroup
.sel
- true
to select the given HListElement
, false
otherwise.public boolean isItemSelected(int index)
HListElement
.
Note that if multiple selections are not permitted only one HListElement may be selected at a time.
index
- the index of the HListElement
to query. A
java.lang.IllegalArgumentException
shall be thrown
if this index is not valid for the HListGroup
.
true
if the given HListElement
is selected,
false
otherwise.public int getScrollPosition()
HListGroup
. The scroll position
determines the first HListElement
to be drawn when the HListGroupLook
lays out the list.
public void setScrollPosition(int scroll)
HListGroup
. The scroll position
determines the first HListElement
to be drawn when the HListGroupLook
lays out the list.
An IllegalArgumentException shall be thrown if scroll is not
a valid scroll position.
It is an implementation option for HListGroupLook
to draw elements
before this first one, in order to fill the available space.
Valid scrollpositions conform to 0<= scrollposition< size. If no content is set there are no valid scrollpositions.
scroll
- the scroll positionpublic java.awt.Dimension getIconSize()
HListGroup
. This size is the desired size of the area into
which the HListGroupLook
should render any image content of the HListElements
.
If label and icon size do not match the size per element, the
associated HListGroupLook
is allowed to use other
sizes during the rendering process. This size shall be used by
HListGroupLook
to calculate the size per element.
new
Dimension(DEFAULT_ICON_WIDTH, DEFAULT_ICON_HEIGHT)
.public void setIconSize(java.awt.Dimension size)
HListGroup
. This size is the desired size of the area into
which the HListGroupLook
should render any image content of the HListElements
.
If label and icon size do not match the size per element, the
associated HListGroupLook
is allowed to use other
sizes during the rendering process. This size shall be used by
HListGroupLook
to calculate the size per element.
size
- the icon size. If this parameter is new
Dimension(DEFAULT_ICON_WIDTH, DEFAULT_ICON_HEIGHT)
or
null
the HListGroup
shall revert to using an implementation-specific icon size.public java.awt.Dimension getLabelSize()
HListGroup
. This size is the desired size of the area into
which the HListGroupLook
should render any textual content of the HListElements
.
If label and icon size do not match the size per element, the
associated HListGroupLook
is allowed to use other
sizes during the rendering process. This size shall be used by
HListGroupLook
to calculate the size per element.
new
Dimension(DEFAULT_LABEL_WIDTH, DEFAULT_LABEL_HEIGHT)
.public void setLabelSize(java.awt.Dimension size)
HListGroup
. This size is the desired size of the area into
which the HListGroupLook
should render any textual content of the HListElements
.
If label and icon size do not match the size per element, the
associated HListGroupLook
is allowed to use other
sizes during the rendering process. This size shall be used by
HListGroupLook
to calculate the size per element.
size
- the label size. If this parameter is new
Dimension(DEFAULT_LABEL_WIDTH, DEFAULT_LABEL_HEIGHT)
or
null
the HListGroup
shall revert to using an implementation-specific label size.public void setMove(int keyCode, HNavigable target)
HNavigable
to another HNavigable
when a particular key is
pressed. Note that setFocusTraversal
is
equivalent to multiple calls to setMove
, where the key codes
VK_UP
, VK_DOWN
, VK_LEFT
,
VK_RIGHT
are used.
setMove
in interface HNavigable
keyCode
- The key code of the pressed key. Any numerical
keycode is allowed, but the platform may not be able to
generate all keycodes. Application authors should only use keys
for which HRcCapabilities.isSupported()
or
HKeyCapabilities.isSupported()
returns true.target
- The target HNavigable
object that should be navigated to. If a target is
to be removed from a particular navigation path, then
null
shall be specified.public HNavigable getMove(int keyCode)
HNavigable
object
that is navigated to when a particular key is pressed.
getMove
in interface HNavigable
keyCode
- The key code of the pressed key.
HNavigable
object or null
if no HNavigable
is associated with the keyCode.public void setFocusTraversal(HNavigable up, HNavigable down, HNavigable left, HNavigable right)
HNavigable
component. Note setFocusTraversal
is a
convenience function for application programmers where a standard
up, down, left and right focus traversal between components is
required.
Note setFocusTraversal
is equivalent to multiple calls to setMove
, where the key codes
VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT are used.
Note that this
API does not prevent the creation of "isolated"
HNavigable
components --- authors
should endeavor to avoid confusing the user.
setFocusTraversal
in interface HNavigable
up
- The HNavigable
component
to move to, when the user generates a VK_UP KeyEvent. If there is no HNavigable
component to move
"up" to, then null shall be specified.down
- The HNavigable
component to move to, when the user generates a VK_DOWN KeyEvent. If there
is no HNavigable
component to move
"down" to, then null shall be specified.left
- The HNavigable
component to move to, when the user generates a VK_LEFT KeyEvent. If there
is no HNavigable
component to move
"left" to, then null shall be specified.right
- The HNavigable
component to move to, when the user generates a VK_RIGHT KeyEvent. If there
is no HNavigable
component to move
"right" to, then null shall be specified.public boolean isSelected()
isSelected
in interface HNavigable
true
if the component has focus, otherwise
returns false
.public void setGainFocusSound(HSound sound)
HNavigable
receives a
HFocusEvent
event of type
FOCUS_GAINED
. This sound will start to be played
when an object implementing this interface gains focus. It is
not guaranteed to be played to completion. If the object
implementing this interface loses focus before the audio
completes playing, the audio will be truncated. Applications
wishing to ensure the audio is always played to completion must
implement special logic to slow down the focus transitions.
By default, an HNavigable
object
does not have any gain focus sound associated with it.
Note that the ordering of playing sounds is dependent on the order of the focus lost, gained events.
setGainFocusSound
in interface HNavigable
sound
- the sound to be played, when the component gains
focus. If sound content is already set, the original content is
replaced. To remove the sound specify a null HSound
.public void setLoseFocusSound(HSound sound)
HNavigable
receives a
HFocusEvent
event of type
FOCUS_LOST. This sound will start to be played when an object
implementing this interface loses focus. It is not guaranteed to be
played to completion. It is implementation dependent whether and when
this sound will be truncated by any gain focus sound played by the next
object to gain focus. By default, an HNavigable
object does not have any
lose focus sound associated with it.
Note that the ordering of playing sounds is dependent on the order of the focus lost, gained events.
setLoseFocusSound
in interface HNavigable
sound
- the sound to be played, when the component loses
focus. If sound content is already set, the original content is
replaced. To remove the sound specify a null HSound
.public HSound getGainFocusSound()
getGainFocusSound
in interface HNavigable
public HSound getLoseFocusSound()
getLoseFocusSound
in interface HNavigable
public void addHFocusListener(HFocusListener l)
HFocusListener
to
receive HFocusEvent
events sent from
this HNavigable
: 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.
addHFocusListener
in interface HNavigable
l
- the HFocusListener to addpublic void removeHFocusListener(HFocusListener l)
HFocusListener
so that it no longer receives HFocusEvent
events from this HNavigable
. 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.
removeHFocusListener
in interface HNavigable
l
- the HFocusListener to removepublic int[] getNavigationKeys()
getNavigationKeys
in interface HNavigationInputPreferred
null
if no
navigation targets are set on this component.public void processHFocusEvent(HFocusEvent evt)
HFocusEvent
sent to this HListGroup
.
processHFocusEvent
in interface HNavigationInputPreferred
evt
- the HFocusEvent
to process.public int getOrientation()
HLook
lays out the component and affects the
visual behavior of HItemEvent
events.
getOrientation
in interface HOrientable
ORIENT_LEFT_TO_RIGHT
, ORIENT_RIGHT_TO_LEFT
, ORIENT_TOP_TO_BOTTOM
, or ORIENT_BOTTOM_TO_TOP
.public void setOrientation(int orient)
setOrientation
in interface HOrientable
orient
- one of ORIENT_LEFT_TO_RIGHT
, ORIENT_RIGHT_TO_LEFT
, ORIENT_TOP_TO_BOTTOM
, or ORIENT_BOTTOM_TO_TOP
.public void addItemListener(HItemListener l)
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.
addItemListener
in interface HItemValue
l
- the HItemListener
to be notified.public void removeItemListener(HItemListener l)
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.
removeItemListener
in interface HItemValue
l
- the HItemListener
to be removed from notification.public void setSelectionSound(HSound sound)
HItemEvent
is sent to one or more
listeners.
setSelectionSound
in interface HItemValue
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
.public HSound getSelectionSound()
getSelectionSound
in interface HItemValue
public boolean getSelectionMode()
HListGroup
. If the returned value is true
the
component is in selection mode, and the selection may be changed.
The component is switched into and out of selection mode on
receiving ITEM_START_CHANGE
and ITEM_END_CHANGE
events. Note that these events are ignored, if
the component is disabled.
getSelectionMode
in interface HSelectionInputPreferred
HComponent.setEnabled(boolean)
public void setSelectionMode(boolean edit)
HListGroup
.
This method is provided for the convenience of component implementors. Interoperable applications shall not call this method. It cannot be made protected because interfaces cannot have protected methods.
Calls to this method shall be ignored, if the component is disabled.
setSelectionMode
in interface HSelectionInputPreferred
edit
- true to switch this component into selection mode,
false otherwise.HComponent.setEnabled(boolean)
,
HSelectionInputPreferred.getSelectionMode()
public void processHItemEvent(HItemEvent evt)
HItemEvent
sent to this HListGroup
.
Widgets implementing this interface shall ignore
HItemEvent
a, while the component is disabled.
processHItemEvent
in interface HSelectionInputPreferred
evt
- the HItemEvent
to process.HComponent.setEnabled(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |