Java Doc for MIDPWindow.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » chameleon » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.chameleon.CWindow
      com.sun.midp.chameleon.MIDPWindow

MIDPWindow
public class MIDPWindow extends CWindow (Code)
The MIDPWindow class is a concrete instance of a CWindow which implements the MIDP specification and its graphical elements, such as a title bar, soft buttons, ticker, etc.


Field Summary
final public static  intALERT_LAYER
    
final public static  intALERT_WASH_LAYER
    
final public static  intBODY_LAYER
    
final public static  intBTN_LAYER
    
final public static  intLAST_LAYER
    
final public static  intPTI_LAYER
    
final public static  intTICKER_LAYER
    
final public static  intTITLE_LAYER
    
final public static  intWASH_LAYER
    
 Command[]itemCmdCache
    
 intitemCmdCount
    
 ItemCommandListeneritemCmdListener
    
 CLayer[]mainLayers
    
 Command[]scrCmdCache
    
 intscrCmdCount
    
 CommandListenerscrCmdListener
    
 intscreenMode
    
 booleansizeChangedOccured
    
 ChamDisplayTunneltunnel
    

Constructor Summary
public  MIDPWindow(ChamDisplayTunnel tunnel)
    

Method Summary
public  booleanaddLayer(CLayer layer)
     Add the given layer to this window.
public  booleanbelongToCmdLayers(int x, int y)
    
public  booleanbodyContainsPoint(int x, int y)
     Utility method to determine if the given point lies within the bounds of body layer.
public  voidcallPaint(Graphics g, CGraphicsQ refreshQ)
     MIDPWindow overrides the parent paint method in order to do special effects such as paint a "wash" over the background when a dialog is up.
protected  voidclearPopups()
     Internal method to clear all current popups.
public  intgetBodyAnchorX()
     Get the current x anchor coordinate for the body layer (the body layer renders the contents of the current displayable).
public  intgetBodyAnchorY()
     Get the current y anchor coordinate for the body layer (the body layer renders the contents of the current displayable).
public  intgetBodyHeight()
     Get the current height of the body layer (the body layer renders the contents of the current displayable).
public  int[]getBodyLayerBounds()
    
public  intgetBodyWidth()
     Get the current width of the body layer (the body layer renders the contents of the current displayable).
public  CommandgetSoftOne()
     Returns the left soft button (one).
public  Command[]getSoftTwo()
     Returns the command array tied to the right soft button (two).
public  PopupLayergetTopMostPopup()
     Gets the "top" most Popup layer added to this body layer.
public  voidhideDisplayable(Displayable displayable)
     Alert this MIDPWindow that the given displayable is no longer current and should be removed from the screen.
public  booleanisInFullScreenMode()
     Determines if window is in full screen mode.
public  voidpaintWash(boolean onOff)
     Called to paint a wash over the background of this window.
public  booleanremoveLayer(CLayer layer)
     Remove the given layer from this window.
public  voidrepaintDisplayable(int x, int y, int w, int h)
     Request a repaint of a region of the current displayable. This method specifically marks a region of the body layer (which renders the displayable's contents) as dirty and results in a repaint request being scheduled.
public  voidrequestRepaint()
     Request a repaint.
public  voidresize()
     Internal method to resize window and its content layers according to a size changes in the loaded skins. This is important to re-calculate whenever things such as titles, tickers, fullscreen mode, etc.
public  voidsetFullScreen(boolean onOff)
     Set this MIDPWindow's displayable to "fullscreen" mode.
public  booleansetGraphicsForCanvas(Graphics g)
     This method is an optimization which allows Display to bypass the Chameleon paint engine logic and directly paint an animating canvas.
public  voidsetTicker(Ticker ticker)
     Set the ticker of this MIDPWindow.
public  voidsetTitle(String title)
     Set the title of this MIDPWindow.
public  booleansetVerticalScroll(int scrollPosition, int scrollProportion)
     Set the current vertical scroll position and proportion.
Parameters:
  scrollPosition - vertical scroll position.
Parameters:
  scrollProportion - vertical scroll proportion.
public  voidshowDisplayable(Displayable displayable, int height)
     Alert this MIDPWindow that the given displayable is now current and should be shown on the screen.
public  booleansystemMenuUp()
     Determines if the system menu is currently visible.
public  voidupdateCommandSet(Command[] itemCommands, int itemCmdCount, ItemCommandListener itemCmdListener, Command[] scrCommands, int scrCmdCount, CommandListener scrCmdListener)
     Update this MIDPWindow's current command set to match the current displayable and possibly item selection.
public  voidupdateLayout()
    

Field Detail
ALERT_LAYER
final public static int ALERT_LAYER(Code)
Id of layer containing the alert displayable



ALERT_WASH_LAYER
final public static int ALERT_WASH_LAYER(Code)
Id of layer containing the alert wash



BODY_LAYER
final public static int BODY_LAYER(Code)
Id of layer containing the current displayable's contents



BTN_LAYER
final public static int BTN_LAYER(Code)
Id of layer rendering the soft button controls



LAST_LAYER
final public static int LAST_LAYER(Code)
Number of main layers



PTI_LAYER
final public static int PTI_LAYER(Code)
Id of layer containing the pti contents



TICKER_LAYER
final public static int TICKER_LAYER(Code)
Id of layer containing the ticker of the current displayable



TITLE_LAYER
final public static int TITLE_LAYER(Code)
Id of layer containing the title of the current displayable



WASH_LAYER
final public static int WASH_LAYER(Code)
Id of layer containing the mail



itemCmdCache
Command[] itemCmdCache(Code)
Cache of selected item commands



itemCmdCount
int itemCmdCount(Code)
Number of item commands in the cache



itemCmdListener
ItemCommandListener itemCmdListener(Code)
Listener to notify when an item command is selected



mainLayers
CLayer[] mainLayers(Code)



scrCmdCache
Command[] scrCmdCache(Code)
Cache of screen commands



scrCmdCount
int scrCmdCount(Code)
Number of screen commands in the cache



scrCmdListener
CommandListener scrCmdListener(Code)
Listener to notify when a screen command is selected



screenMode
int screenMode(Code)
Current screen mode



sizeChangedOccured
boolean sizeChangedOccured(Code)
Determines whether area of the window has been changed



tunnel
ChamDisplayTunnel tunnel(Code)
Used to call back into the Display class from this package




Constructor Detail
MIDPWindow
public MIDPWindow(ChamDisplayTunnel tunnel)(Code)
Construct a new MIDPWindow given the tunnel to the desired MIDP Display instance
Parameters:
  tunnel - the "tunnel" to make calls from this java packageback into the Display object in another package




Method Detail
addLayer
public boolean addLayer(CLayer layer)(Code)
Add the given layer to this window. This method is overridden from CWindow in order to special case popup layers. Popup layers can have their own commands which supercede those of the current displayable.
Parameters:
  layer - the CLayer to add to this window true if new layer was added, false otherwise



belongToCmdLayers
public boolean belongToCmdLayers(int x, int y)(Code)
Returns true if the point lies in the bounds of commnad layer
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 layer



bodyContainsPoint
public boolean bodyContainsPoint(int x, int y)(Code)
Utility method to determine if the given point lies within the bounds of body layer. The point should be in the coordinate space of this layer's containing CWindow.
Parameters:
  x - the "x" coordinate of the point
Parameters:
  y - the "y" coordinate of the point true if the coordinate lies in the bounds of this layer



callPaint
public void callPaint(Graphics g, CGraphicsQ refreshQ)(Code)
MIDPWindow overrides the parent paint method in order to do special effects such as paint a "wash" over the background when a dialog is up. Also in an effort to call javax.microedition.lcdui.Displayable.sizeChanged method before painting. This implementation determine whether size has been changed and calls sizeChanged() if it's so. Anyway it invokes the base class's CWindow.paint method.
Parameters:
  g - The graphics object to use to paint this MIDP window.
Parameters:
  refreshQ - The chameleon graphics queue.



clearPopups
protected void clearPopups()(Code)
Internal method to clear all current popups. This occurs if a change of displayable occurs, as all popups are treated as belonging to the current displayable.



getBodyAnchorX
public int getBodyAnchorX()(Code)
Get the current x anchor coordinate for the body layer (the body layer renders the contents of the current displayable). the x anchor coordinate of the body layer



getBodyAnchorY
public int getBodyAnchorY()(Code)
Get the current y anchor coordinate for the body layer (the body layer renders the contents of the current displayable). the y anchor coordinate of the body layer



getBodyHeight
public int getBodyHeight()(Code)
Get the current height of the body layer (the body layer renders the contents of the current displayable). the height of the body layer



getBodyLayerBounds
public int[] getBodyLayerBounds()(Code)
Return bounds of BodyLayer currently array of bounds



getBodyWidth
public int getBodyWidth()(Code)
Get the current width of the body layer (the body layer renders the contents of the current displayable). the width of the body 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



getTopMostPopup
public PopupLayer getTopMostPopup()(Code)
Gets the "top" most Popup layer added to this body layer. If there are no popups, this method returns null. the top most popup layer, or null if there are none.



hideDisplayable
public void hideDisplayable(Displayable displayable)(Code)
Alert this MIDPWindow that the given displayable is no longer current and should be removed from the screen. Special circumstances may occur if the displayable is an Alert, such as removing the popup and re-instating the previous displayable which was visible before the Alert popped up.
Parameters:
  displayable - the newly current displayable to show



isInFullScreenMode
public boolean isInFullScreenMode()(Code)
Determines if window is in full screen mode. true if in full screen mode



paintWash
public void paintWash(boolean onOff)(Code)
Called to paint a wash over the background of this window. Used by SoftButtonLayer when the system menu pops up, and internally when an Alert is shown.
Parameters:
  onOff - A flag indicating if the wash should be on or off



removeLayer
public boolean removeLayer(CLayer layer)(Code)
Remove the given layer from this window. This method is overridden from CWindow in order to special case popup layers. Popup layers can have their own commands which supercede those of the current displayable. In this case, the popup is removed and the commands in the soft button bar are restored to either the next top-most popup layer or the current displayable itself.
Parameters:
  layer - the CLayer to remove from this window true if the layer was able to be removed



repaintDisplayable
public void repaintDisplayable(int x, int y, int w, int h)(Code)
Request a repaint of a region of the current displayable. This method specifically marks a region of the body layer (which renders the displayable's contents) as dirty and results in a repaint request being scheduled. The coordinates are in the space of the displayable itself - that is, 0,0 represents the top left corner of the body layer.
Parameters:
  x - the x coordinate of the dirty region
Parameters:
  y - the y coordinate of the dirty region
Parameters:
  w - the width of the dirty region
Parameters:
  h - the height of the dirty region



requestRepaint
public void requestRepaint()(Code)
Request a repaint. This method does not require any bounds information as it is contained in each of the Chameleon layers. This method simply results in a repaint event being placed in the event queue for a future callback.



resize
public void resize()(Code)
Internal method to resize window and its content layers according to a size changes in the loaded skins. This is important to re-calculate whenever things such as titles, tickers, fullscreen mode, etc. change state.



setFullScreen
public void setFullScreen(boolean onOff)(Code)
Set this MIDPWindow's displayable to "fullscreen" mode. This will expand the region occupied by the current displayable to include the area previously occupied by the title and ticker if present
Parameters:
  onOff - true if the displayable should be in fullscreen mode



setGraphicsForCanvas
public boolean setGraphicsForCanvas(Graphics g)(Code)
This method is an optimization which allows Display to bypass the Chameleon paint engine logic and directly paint an animating canvas. Display will call this method with the graphics context and this method will either return false, indicating the Chameleon paint engine should not be bypassed, or will return true and will setup the graphics context for the canvas to be painted directly.
Parameters:
  g - the graphics context to setup true if Chameleon's paint logic can be bypassed and thecanvas can be rendered directly.



setTicker
public void setTicker(Ticker ticker)(Code)
Set the ticker of this MIDPWindow. This would typically correspond to the ticker of the current displayable, and may result in the ticker layer appearing or disappearing.
Parameters:
  ticker - the current Ticker object. null indicates thereis no ticker.



setTitle
public void setTitle(String title)(Code)
Set the title of this MIDPWindow. This would typically correspond to the title of the current displayable, and may result in the title layer appearing or disappearing.
Parameters:
  title - the value of the title. null indicates thereis no title.



setVerticalScroll
public boolean setVerticalScroll(int scrollPosition, int scrollProportion)(Code)
Set the current vertical scroll position and proportion.
Parameters:
  scrollPosition - vertical scroll position.
Parameters:
  scrollProportion - vertical scroll proportion. true if set vertical scroll occues



showDisplayable
public void showDisplayable(Displayable displayable, int height)(Code)
Alert this MIDPWindow that the given displayable is now current and should be shown on the screen. This will establish the given displayable on the screen, as well as reflect the displayable's title and ticker (if any). Special circumstances may occur if the displayable is an Alert, such as maintaining the current screen contents and showing the Alert in a popup.
Parameters:
  displayable - the newly current displayable to show
Parameters:
  height - the preferred height of the new displayable



systemMenuUp
public boolean systemMenuUp()(Code)
Determines if the system menu is currently visible. This can be useful in determining the current isShown() status of the displayable. true if the system menu is up



updateCommandSet
public void updateCommandSet(Command[] itemCommands, int itemCmdCount, ItemCommandListener itemCmdListener, Command[] scrCommands, int scrCmdCount, CommandListener scrCmdListener)(Code)
Update this MIDPWindow's current command set to match the current displayable and possibly item selection.
Parameters:
  itemCommands - the set of item specific commands
Parameters:
  itemCmdCount - the number of item commands
Parameters:
  itemCmdListener - the notification listener for item commands
Parameters:
  scrCommands - the set of screen specific commands
Parameters:
  scrCmdCount - the number of screen commands
Parameters:
  scrCmdListener - the notification listener for screen commands



updateLayout
public void updateLayout()(Code)
Update the current layout



Fields inherited from com.sun.midp.chameleon.CWindow
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 BackgroundLayer bgLayer(Code)(Java Doc)
protected int[] bounds(Code)(Java Doc)
protected int cXcYcWcH(Code)(Java Doc)
protected int color(Code)(Java Doc)
protected boolean dirty(Code)(Java Doc)
protected int dirtyCount(Code)(Java Doc)
protected CLayer[] dirtyLayers(Code)(Java Doc)
protected int dirtyMaxCount(Code)(Java Doc)
protected Font font(Code)(Java Doc)
protected CLayerList layers(Code)(Java Doc)
protected int tranXtranY(Code)(Java Doc)

Methods inherited from com.sun.midp.chameleon.CWindow
public boolean addLayer(CLayer layer)(Code)(Java Doc)
public boolean isDirty()(Code)(Java Doc)
public boolean keyInput(int type, int keyCode)(Code)(Java Doc)
public boolean methodInput(String str)(Code)(Java Doc)
public void paint(Graphics g, CGraphicsQ refreshQ)(Code)(Java Doc)
public boolean pointerInput(int type, int x, int y)(Code)(Java Doc)
public boolean relocateLayer(CLayer layer, int x, int y, int w, int h)(Code)(Java Doc)
public boolean removeLayer(CLayer layer)(Code)(Java Doc)
abstract public void requestRepaint()(Code)(Java Doc)
public void resize()(Code)(Java Doc)
public void setAllDirty()(Code)(Java Doc)
synchronized void setBackground(Image bgImage, int bgColor)(Code)(Java Doc)
public void setDirty()(Code)(Java Doc)
CLayerElement sweepLayer(CLayer layer)(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.