Java Doc for SoftButtonLayer.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » chameleon » layers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.chameleon.layers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.chameleon.CLayer
      com.sun.midp.chameleon.layers.SoftButtonLayer

SoftButtonLayer
public class SoftButtonLayer extends CLayer implements CommandListener(Code)
Soft button layer.


Field Summary
protected  booleanalertUP
     A flag indicating the alert is up.
protected  intbuttonxbuttonybuttonwbuttonh
     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  ItemCommandListeneritemListener
     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  MenuLayermenuLayer
     A System menu to popup and display when a set of commands needs to be displayed.
protected  booleanmenuUP
     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  CommandListenerscrListener
     The CommandListener to notify for any screen commands executed.
protected  Commandsoft1
     The command associated with soft button #1.
protected  Command[]soft2
     The set of commands associated with soft button #2.
protected  SubMenuCommandsubMenu
     When a sub menu is currently active, this reference is non-null.
protected  Commandswap
     An internal variable defined once to avoid costly heap thrashing.
protected  ChamDisplayTunneltunnel
     A tunnel to utilize to notify of command invocation.
protected  inttypeXtypeY
     Internal variables defined once to avoid costly heap thrashing.

Constructor Summary
public  SoftButtonLayer(ChamDisplayTunnel tunnel)
     Construct a SoftButtonLayer.

Method Summary
public  booleanbelongToCmdLayers(int x, int y)
    
public  voidcommandAction(Command c, Displayable d)
     Commandlistener interface implementation.
public  voidcommandSelected(Command cmd)
     Selects a command.
protected  intcompare(Command a, Command b)
     Compares two commands.
public  voiddismissMenu()
     Dismiss menu layer.
public  CommandgetSoftOne()
     Returns the left soft button (one).
public  Command[]getSoftTwo()
     Returns the command array tied to the right soft button (two).
protected  voidinitMenu()
     Initializes the menu from menu resources.
protected  voidinitialize()
     Initializes the soft button layer.
protected  booleanisCommandActive(Command cmd)
     Determines if it is possible to process the command.
public  booleanisInteractive()
     Returnes true if user is interacting with the layer, false otherwise.
protected  booleanisItemCommand(Command cmd)
     Checks if the item is a command.
protected  booleanisSoft1Active()
     Determines if soft button 1 will be processed by the layer.
protected  booleanisSoft2Active()
     Determines if soft button 2 will be processed by the layer.
public  booleankeyInput(int type, int keyCode)
     Handle key input from a keypad.
protected  voidpaintBody(Graphics g)
     Renders the soft button layer.
public  booleanpointerInput(int type, int x, int y)
     Handles pointer input events.
protected  voidprocessCommand(Command cmd)
     Processes commands.
public  voidsetAnchor()
     Sets the anchor constraints for rendering operation.
protected  voidsetButtonLabels()
     Sets the button labels.
protected  voidsoft1()
     Soft button 1 handler.
protected  voidsoft2()
     Soft button 2 handler.
protected  voidsoftPress(int buttonID)
     Switch based on soft button pressed.
protected  voidsortCommands(Command[] cmds, int num)
     Rearranges the commands based on weights and priority.
public  booleansystemMenuUp()
     Returns true if system menu is currently up, false otherwise.
public  voidtoggleAlert(boolean alertUp)
     Toggles the alert.
public  voidtoggleMenu(boolean menuUp)
     Toggles the current menu selection.
public  voidupdate(CLayer[] layers)
    
public  voidupdateCommandSet(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.

Field Detail
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.



tunnel
protected ChamDisplayTunnel tunnel(Code)
A tunnel to utilize to notify of command invocation.



typeXtypeY
protected int typeXtypeY(Code)
Internal variables defined once to avoid costly heap thrashing.




Constructor Detail
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




Method Detail
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



Fields inherited from com.sun.midp.chameleon.CLayer
final public static int H(Code)(Java Doc)
final public static int W(Code)(Java Doc)
final public static int X(Code)(Java Doc)
final public static int Y(Code)(Java Doc)
protected int bgColor(Code)(Java Doc)
protected Image[] bgImage(Code)(Java Doc)
public int[] bounds(Code)(Java Doc)
protected int[] boundsCopy(Code)(Java Doc)
protected int[] dirtyBounds(Code)(Java Doc)
protected int[] dirtyBoundsCopy(Code)(Java Doc)
protected boolean opaque(Code)(Java Doc)
protected CWindow owner(Code)(Java Doc)
protected boolean supportsInput(Code)(Java Doc)
protected boolean tileBG(Code)(Java Doc)
protected boolean transparent(Code)(Java Doc)
protected boolean visible(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.