| java.lang.Object com.sun.midp.chameleon.CLayer com.sun.midp.chameleon.layers.SoftButtonLayer
Field Summary | |
protected boolean | alertUP A flag indicating the alert is up. | protected int | buttonxbuttonybuttonwbuttonh Internal variables for the paint loop. | final protected static int[] | cmdWeights A set of weights assigned to each of the types of Commands.
The array is set up to return the weight of the Command type
for each index, ie. | protected ItemCommandListener | itemListener The ItemCommandListener to notify for any item commands executed. | protected Command[] | itmCmds A cached copy of the set of item commands sent from
the Display. | protected String[] | labels Labels for each of the softbuttons. | protected MenuLayer | menuLayer A System menu to popup and display when a set of commands
needs to be displayed. | protected boolean | menuUP A flag indicating the system menu is up. | protected Command[] | scrCmds A cached copy of the set of screen commands sent from
the Display. | protected CommandListener | scrListener The CommandListener to notify for any screen commands executed. | protected Command | soft1 The command associated with soft button #1. | protected Command[] | soft2 The set of commands associated with soft button #2. | protected SubMenuCommand | subMenu When a sub menu is currently active, this reference is non-null. | protected Command | swap An internal variable defined once to avoid costly heap thrashing. | protected ChamDisplayTunnel | tunnel A tunnel to utilize to notify of command invocation. | protected int | typeXtypeY Internal variables defined once to avoid costly heap thrashing. |
Method Summary | |
public boolean | belongToCmdLayers(int x, int y) | public void | commandAction(Command c, Displayable d) Commandlistener interface implementation. | public void | commandSelected(Command cmd) Selects a command. | protected int | compare(Command a, Command b) Compares two commands. | public void | dismissMenu() Dismiss menu layer. | public Command | getSoftOne() Returns the left soft button (one). | public Command[] | getSoftTwo() Returns the command array tied to the right soft button (two). | protected void | initMenu() Initializes the menu from menu resources. | protected void | initialize() Initializes the soft button layer. | protected boolean | isCommandActive(Command cmd) Determines if it is possible to process the command. | public boolean | isInteractive() Returnes true if user is interacting with the layer,
false otherwise. | protected boolean | isItemCommand(Command cmd) Checks if the item is a command. | protected boolean | isSoft1Active() Determines if soft button 1 will be processed by the layer. | protected boolean | isSoft2Active() Determines if soft button 2 will be processed by the layer. | public boolean | keyInput(int type, int keyCode) Handle key input from a keypad. | protected void | paintBody(Graphics g) Renders the soft button layer. | public boolean | pointerInput(int type, int x, int y) Handles pointer input events. | protected void | processCommand(Command cmd) Processes commands. | public void | setAnchor() Sets the anchor constraints for rendering operation. | protected void | setButtonLabels() Sets the button labels. | protected void | soft1() Soft button 1 handler. | protected void | soft2() Soft button 2 handler. | protected void | softPress(int buttonID) Switch based on soft button pressed. | protected void | sortCommands(Command[] cmds, int num) Rearranges the commands based on weights and priority. | public boolean | systemMenuUp() Returns true if system menu is currently up, false otherwise. | public void | toggleAlert(boolean alertUp) Toggles the alert. | public void | toggleMenu(boolean menuUp) Toggles the current menu selection. | public void | update(CLayer[] layers) | public void | updateCommandSet(Command[] itemCmds, int numI, ItemCommandListener itemListener, Command[] screenCmds, int numS, CommandListener scrListener) Called by the system to update the set of commands associated
with this button bar and its subsequent system menu. |
alertUP | protected boolean alertUP(Code) | | A flag indicating the alert is up.
|
buttonxbuttonybuttonwbuttonh | protected int buttonxbuttonybuttonwbuttonh(Code) | | Internal variables for the paint loop.
|
cmdWeights | final protected static int[] cmdWeights(Code) | | A set of weights assigned to each of the types of Commands.
The array is set up to return the weight of the Command type
for each index, ie. Command.BACK has a defined value of 2 from
the MIDP specification, cmdWieghts[Command.BACK] == 4, that is,
there are three other Command types which sort higher than BACK
(ITEM, SCREEN, and OK). The weighting is specified in the
MIDP Human Interface Specification (Sun Internal).
|
itemListener | protected ItemCommandListener itemListener(Code) | | The ItemCommandListener to notify for any item commands executed.
|
itmCmds | protected Command[] itmCmds(Code) | | A cached copy of the set of item commands sent from
the Display.
|
labels | protected String[] labels(Code) | | Labels for each of the softbuttons.
|
menuLayer | protected MenuLayer menuLayer(Code) | | A System menu to popup and display when a set of commands
needs to be displayed.
|
menuUP | protected boolean menuUP(Code) | | A flag indicating the system menu is up.
|
scrCmds | protected Command[] scrCmds(Code) | | A cached copy of the set of screen commands sent from
the Display.
|
scrListener | protected CommandListener scrListener(Code) | | The CommandListener to notify for any screen commands executed.
|
soft1 | protected Command soft1(Code) | | The command associated with soft button #1.
null if there is no command associated with button #1.
|
soft2 | protected Command[] soft2(Code) | | The set of commands associated with soft button #2.
null if there are no commands associated with button #2.
If there is only one element in this array, there is no need
for a menu and soft button #2 will behave similar to soft
button #1 and invoke the listener directly upon button press.
|
subMenu | protected SubMenuCommand subMenu(Code) | | When a sub menu is currently active, this reference is non-null.
|
swap | protected Command swap(Code) | | An internal variable defined once to avoid costly heap thrashing.
|
typeXtypeY | protected int typeXtypeY(Code) | | Internal variables defined once to avoid costly heap thrashing.
|
SoftButtonLayer | public SoftButtonLayer(ChamDisplayTunnel tunnel)(Code) | | Construct a SoftButtonLayer. The layer's background image and color
information is obtained directly from the SoftButtonSkin class,
such as background image, tile, and/or background color.
Parameters: tunnel - channel for command notifications |
belongToCmdLayers | public boolean belongToCmdLayers(int x, int y)(Code) | | Returns true if the point lies in the bounds of commnad layers
subset like buttons, menu, submenu
Parameters: x - the "x" coordinate of the point Parameters: y - the "y" coordinate of the point true if the point lies in the bounds of commnad layerssubset |
commandAction | public void commandAction(Command c, Displayable d)(Code) | | Commandlistener interface implementation. Handle softbuton commands.
Parameters: c - command Parameters: d - displayable |
commandSelected | public void commandSelected(Command cmd)(Code) | | Selects a command.
Parameters: cmd - the command selected |
compare | protected int compare(Command a, Command b)(Code) | | Compares two commands.
Parameters: a - first command for comparison Parameters: b - second command for comparison 0 if commands are the same; negativeif the first object is lower; positive is firstcommand is higher. |
dismissMenu | public void dismissMenu()(Code) | | Dismiss menu layer.
|
getSoftOne | public Command getSoftOne()(Code) | | Returns the left soft button (one).
the command that's tied to the left soft button |
getSoftTwo | public Command[] getSoftTwo()(Code) | | Returns the command array tied to the right soft button (two).
the command array that's tied to the right soft button |
initMenu | protected void initMenu()(Code) | | Initializes the menu from menu resources.
|
initialize | protected void initialize()(Code) | | Initializes the soft button layer.
|
isCommandActive | protected boolean isCommandActive(Command cmd)(Code) | | Determines if it is possible to process the command.
Parameters: cmd - the command to check true if command can be processed, false otherwise |
isInteractive | public boolean isInteractive()(Code) | | Returnes true if user is interacting with the layer,
false otherwise.
used by MIDPWindow to check if the layer should become
visible.
|
isItemCommand | protected boolean isItemCommand(Command cmd)(Code) | | Checks if the item is a command.
Parameters: cmd - the item to be checked true if the command is found in thelist of item commands |
isSoft1Active | protected boolean isSoft1Active()(Code) | | Determines if soft button 1 will be processed by the layer.
Called by keyInput to determine if the corresponding key event
should be absorbed by SoftButtonLayer.
true if soft1 command can be processed, false otherwise |
isSoft2Active | protected boolean isSoft2Active()(Code) | | Determines if soft button 2 will be processed by the layer.
Called by keyInput to determine if the corresponding key event
should be absorbed by SoftButtonLayer.
true if soft2 command can be processed, false otherwise |
keyInput | public boolean keyInput(int type, int keyCode)(Code) | | Handle 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 this method processed the input,otherwise false. |
paintBody | protected void paintBody(Graphics g)(Code) | | Renders the soft button layer.
Parameters: g - the graphics context to be updated |
pointerInput | public boolean pointerInput(int type, int x, int y)(Code) | | Handles pointer input events.
Parameters: type - the event type for this input event Parameters: x - the x coordinate of the input event Parameters: y - the y coordinate of the input event true always |
processCommand | protected void processCommand(Command cmd)(Code) | | Processes commands.
Parameters: cmd - the selected command |
setAnchor | public void setAnchor()(Code) | | Sets the anchor constraints for rendering operation.
|
setButtonLabels | protected void setButtonLabels()(Code) | | Sets the button labels.
|
soft1 | protected void soft1()(Code) | | Soft button 1 handler.
|
soft2 | protected void soft2()(Code) | | Soft button 2 handler.
|
softPress | protected void softPress(int buttonID)(Code) | | Switch based on soft button pressed.
Parameters: buttonID - the button pushed |
sortCommands | protected void sortCommands(Command[] cmds, int num)(Code) | | Rearranges the commands based on weights and priority.
Parameters: cmds - the commands to be sorted Parameters: num - the number of commands to check |
systemMenuUp | public boolean systemMenuUp()(Code) | | Returns true if system menu is currently up, false otherwise.
true if system menu is up, false otherwise |
toggleAlert | public void toggleAlert(boolean alertUp)(Code) | | Toggles the alert. Grabs the background and requests a
repaint.
Parameters: alertUp - flag indicating the alaert has expired |
toggleMenu | public void toggleMenu(boolean menuUp)(Code) | | Toggles the current menu selection.
Grabs the background and requests a repaint.
Parameters: menuUp - the flag indicating the menu selection |
update | public void update(CLayer[] layers)(Code) | | Update bounds of layer
Parameters: layers - - current layer can be dependant on this parameter |
updateCommandSet | public void updateCommandSet(Command[] itemCmds, int numI, ItemCommandListener itemListener, Command[] screenCmds, int numS, CommandListener scrListener)(Code) | | Called by the system to update the set of commands associated
with this button bar and its subsequent system menu.
Parameters: itemCmds - an array of item specific commands Parameters: numI - the number of item specific commands Parameters: itemListener - the ItemCommandListener to notify if anyitem commands are selected Parameters: screenCmds - an array of screen specific commands Parameters: numS - the number of screen specific commands Parameters: scrListener - the CommandListener to notify if anyscreen commands are selected |
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)
|
|
|