| java.lang.Object com.sun.midp.chameleon.CLayer com.sun.midp.chameleon.layers.PopupLayer com.sun.midp.chameleon.layers.ScrollablePopupLayer com.sun.midp.chameleon.layers.MenuLayer
MenuLayer | public class MenuLayer extends ScrollablePopupLayer (Code) | | A special popup layer which implements a system
menu. The system menu is a collection of commands,
both screen (Back, Exit, etc) and item specific
commands.
|
Field Summary | |
protected SoftButtonLayer | btnLayer The SoftButtonLayer maintains the overall set of
commands and their associated listeners. | protected CascadeMenuLayer | cascadeMenu A cascading menu which holds commands for a SubMenuCommand. | protected boolean | cascadeMenuUp A flag indicating if a cascading menu is visible. | protected Command[] | menuCmds The list of Commands to display in the menu. | protected int | scrollIndex The number of commands which have been scrolled off the
top of the menu, normally 0 unless there are more commands
than can fit on the menu. | protected int | selI The currently selected index in the menu. |
Constructor Summary | |
public | MenuLayer() Construct a new system menu layer. |
Method Summary | |
protected void | alignMenu() Aligns the menu to the current screen. | public void | dismiss() Cleans up the display when the cascaded menu is dismissed. | public void | dismissCascadeMenu() Cleans up the display when the cascaded menu is dismissed. | public int | getIndex() Gets index of highlighted command. | protected void | initialize() Initializes the menu parameters. | public boolean | keyInput(int type, int keyCode) Handles key input from a keypad. | protected void | paintBody(Graphics g) Renders the body of the menu. | public boolean | pointerInput(int type, int x, int y) Handle input from a pen tap. | public void | scrollContent(int scrollType, int thumbPosition) Scroll content inside of the Menu.
Parameters: scrollType - scrollType. | public void | setMenuCommands(Command[] cmdList, SoftButtonLayer btnLayer, int index) Called typically by the SoftButtonLayer to establish the
set of Commands to display on this system menu. | public void | subCommandSelected(Command cmd) Notifies listener that a command has been selected. | void | uScrollAt(int position) Perform a scrolling at the given position. | public void | update(CLayer[] layers) | public void | updateScrollIndicator() Updates the scroll indicator. |
btnLayer | protected SoftButtonLayer btnLayer(Code) | | The SoftButtonLayer maintains the overall set of
commands and their associated listeners.
|
cascadeMenu | protected CascadeMenuLayer cascadeMenu(Code) | | A cascading menu which holds commands for a SubMenuCommand.
|
cascadeMenuUp | protected boolean cascadeMenuUp(Code) | | A flag indicating if a cascading menu is visible.
|
menuCmds | protected Command[] menuCmds(Code) | | The list of Commands to display in the menu.
|
scrollIndex | protected int scrollIndex(Code) | | The number of commands which have been scrolled off the
top of the menu, normally 0 unless there are more commands
than can fit on the menu.
|
selI | protected int selI(Code) | | The currently selected index in the menu.
|
MenuLayer | public MenuLayer()(Code) | | Construct a new system menu layer.
|
alignMenu | protected void alignMenu()(Code) | | Aligns the menu to the current screen.
|
dismiss | public void dismiss()(Code) | | Cleans up the display when the cascaded menu is dismissed.
Removes the layer with the menu and requests the display to be
repainted.
|
dismissCascadeMenu | public void dismissCascadeMenu()(Code) | | Cleans up the display when the cascaded menu is dismissed.
Removes the layer with the menu and requests the display to be
repainted.
|
getIndex | public int getIndex()(Code) | | Gets index of highlighted command.
highlighted index |
initialize | protected void initialize()(Code) | | Initializes the menu parameters.
|
keyInput | public boolean keyInput(int type, int keyCode)(Code) | | Handles key input from a keypad. Parameters describe
the type of key event and the platform-specific
code for the key. (Codes are translated using the
lcdui.Canvas)
Parameters: type - the type of key event Parameters: keyCode - the numeric code assigned to the key true if the input has been processed by thismethod, otherwise false (soft menu keys) |
paintBody | protected void paintBody(Graphics g)(Code) | | Renders the body of the menu.
Parameters: g - the graphics context to be updated |
pointerInput | public boolean pointerInput(int type, int x, int y)(Code) | | Handle input from a pen tap. Parameters describe
the type of pen event and the x,y location in the
layer at which the event occurred. Important : the
x,y location of the pen tap will already be translated
into the coordinate space of the layer.
Parameters: type - the type of pen event Parameters: x - the x coordinate of the event Parameters: y - the y coordinate of the event |
setMenuCommands | public void setMenuCommands(Command[] cmdList, SoftButtonLayer btnLayer, int index)(Code) | | Called typically by the SoftButtonLayer to establish the
set of Commands to display on this system menu. This method will
create a new copy of the array of commands passed in.
Parameters: cmdList - the set of commands to display in the menu(the commands should already be sorted by priority) Parameters: btnLayer - the SoftButtonLayer to notify of any commandselections Parameters: index - the command index has to be highlighted. If index exceedsthe number of commands the 1st command has to be highlighted. |
subCommandSelected | public void subCommandSelected(Command cmd)(Code) | | Notifies listener that a command has been selected.
Dismisses the cascaded menu and the button layer.
Parameters: cmd - the command that was selected |
uScrollAt | void uScrollAt(int position)(Code) | | Perform a scrolling at the given position.
Parameters: context - position |
update | public void update(CLayer[] layers)(Code) | | Update bounds of layer
Parameters: layers - - current layer can be dependant on this parameter |
updateScrollIndicator | public void updateScrollIndicator()(Code) | | Updates the scroll indicator.
|
Methods inherited from com.sun.midp.chameleon.CLayer | public void addDirtyRegion()(Code)(Java Doc) public boolean addDirtyRegion(int x, int y, int w, int h)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) protected void cleanDirty()(Code)(Java Doc) protected void cleanDirtyRegions()(Code)(Java Doc) public boolean containsPoint(int x, int y)(Code)(Java Doc) public int[] getBounds()(Code)(Java Doc) public boolean handlePoint(int x, int y)(Code)(Java Doc) protected void initialize()(Code)(Java Doc) public boolean isDirty()(Code)(Java Doc) protected boolean isEmptyDirtyRegions()(Code)(Java Doc) public boolean isOpaque()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) public boolean keyInput(int type, int code)(Code)(Java Doc) protected String layerID()(Code)(Java Doc) public boolean methodInput(String str)(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) protected void paintBackground(Graphics g)(Code)(Java Doc) protected void paintBody(Graphics g)(Code)(Java Doc) public boolean pointerInput(int type, int x, int y)(Code)(Java Doc) public void relocateNotify(int[] oldBounds)(Code)(Java Doc) public void removeNotify(CWindow owner)(Code)(Java Doc) public void requestRepaint()(Code)(Java Doc) public void requestRepaint(int x, int y, int w, int h)(Code)(Java Doc) public void setBackground(Image bgImage, boolean tileBG, int bgColor)(Code)(Java Doc) public void setBackground(Image[] bgImages, int bgColor)(Code)(Java Doc) public void setBounds(int x, int y, int w, int h)(Code)(Java Doc) protected void setDirty()(Code)(Java Doc) protected void setDirtyButNotNotifyOwner()(Code)(Java Doc) public void setOpaque(boolean opaque)(Code)(Java Doc) public void setSupportsInput(boolean support)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public boolean supportsInput()(Code)(Java Doc) public String toString()(Code)(Java Doc) public void update(CLayer[] mainLayers)(Code)(Java Doc)
|
|
|