Class JtvMenu
public class JtvMenu
Represents one level of a menu tree.
JtvMenu holds the item list of JtvMenuItem records that form a single
menu level — either the top-level menu bar or one drop-down submenu.
A JtvMenuView (and its concrete descendants JtvMenuBar and
JtvMenuBox) owns a TMenu and iterates over items to render
and process the menu.
defaultItem remembers the last item that was focused so that reopening
the menu restores the previous position. It is updated by
JtvMenuView.execute() after the user dismisses the menu.
TMenu objects are typically constructed by helper code (e.g. application
initMenuBar) and passed to a JtvMenuBar or
JtvMenuBox constructor.
org.viktor44.jtvision.menus.JtvMenu
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | JtvMenu() |
| public | JtvMenu(JtvMenuItem items) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private | items | List<org.viktor44.jtvision.menus.JtvMenuItem> |
| private | defaultItem | org.viktor44.jtvision.menus.JtvMenuItem |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | addItem(JtvMenuItem item) | org.viktor44.jtvision.menus.JtvMenu |
| public | addSeparator() | org.viktor44.jtvision.menus.JtvMenu |
| public | getItems() | List<org.viktor44.jtvision.menus.JtvMenuItem> |
| public | getDefaultItem() | org.viktor44.jtvision.menus.JtvMenuItem |
| public | setDefaultItem(JtvMenuItem defaultItem) | void |
Constructors
JtvMenu()
Constructs an empty menu with no items and no default.
JtvMenu(JtvMenuItem items)
Constructs a menu and adds aItems (and any chained items).
The default item is set to the first inserted item.
Parameters
items- the firstJtvMenuItemto add
Fields
List<org.viktor44.jtvision.menus.JtvMenuItem> items
The ordered list of items in this menu.
org.viktor44.jtvision.menus.JtvMenuItem defaultItem
Pointer to the default (last focused) item in the list. Used to
restore the highlighted position when the menu is re-opened.
Initially set to items and updated by JtvMenuView.execute() after each interaction.
Methods
addItem(JtvMenuItem item)
No method description provided
Parameters
item
addSeparator()
No method description provided
getItems()
The ordered list of items in this menu.
getDefaultItem()
Pointer to the default (last focused) item in the list. Used to
restore the highlighted position when the menu is re-opened.
Initially set to items and updated by JtvMenuView.execute() after each interaction.
setDefaultItem(JtvMenuItem defaultItem)
Pointer to the default (last focused) item in the list. Used to
restore the highlighted position when the menu is re-opened.
Initially set to items and updated by JtvMenuView.execute() after each interaction.
Parameters
defaultItem