The bluegammon.gui.menu
package is a standalone package for drawing
menus on a canvas in J2ME.
This package defines a user interface component visualizing a menu consisting of pages that have items. Each item can have an action.
The main class is the Menu
. The Menu
consists of a
MenuPage
as start page and a MenuPainter
implementation.
Each MenuPage
have zero or several PageItem
s that defines
possible choices per MenuPage
. A PageItem
can have one
implementation of ItemAction
, and/or a MenuPage
as sub-page
that will be navigated to when selecting and activating that item.
All implementations of ItemAction
are invoked in a new thread on
the activation of a PageItem
.
The navigation tree of a menu can be defined in two ways:
PageItem
constructor, by setting the subPage
argument
to the MenuPage
to go to if that particular PageItem
is selected
and activated.
ItemAction
. The implementation is set as action
to each PageItem
of the menu. The action then uses the gotoPage
method in the Menu
to navigate further when an item is selected and activated.