Java Doc for CLayer.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.CLayer

All known Subclasses:   com.sun.midp.chameleon.layers.ScrollIndLayer,  com.sun.midp.chameleon.layers.SoftButtonLayer,  com.sun.midp.chameleon.layers.BackgroundLayer,  com.sun.midp.chameleon.layers.TickerLayer,  com.sun.midp.chameleon.layers.PopupLayer,  com.sun.midp.chameleon.layers.BodyLayer,  com.sun.midp.chameleon.layers.TitleLayer,  com.sun.midp.chameleon.layers.WashLayer,
CLayer
public class CLayer (Code)
This class represents a "layer". A layer is an element used to comprise a higher-level "window" (see CWindow.java). A layer has several properties such as its visibility, whether it accepts input, its size, etc. A layer also has content, such as its background and its foreground.


Field Summary
final public static  intH
    
final public static  intW
    
final public static  intX
    
final public static  intY
    
protected  intbgColor
    
protected  Image[]bgImage
     The image to use as a background for this layer if this layer is not transparent and does not use a fill color.
public  int[]bounds
     An array holding the bounds of this layer.
protected  int[]boundsCopy
    
protected  int[]dirtyBounds
     Array holding a bounding rectangle of an area needing repainting.
protected  int[]dirtyBoundsCopy
    
 intgraphicsColor
     When in the paint() routine, graphicsColor will be set to the default graphics color.
 FontgraphicsFont
     When in the paint() routine, graphicsFont will be set to the default graphics Font.
protected  booleanopaque
     Flag indicating this layer is either completely opaque, or not. By default, a layer is not opaque, and thus requires the background and any layers below it to be painted in addition to itself.
protected  CWindowowner
     The window which owns this layer.
protected  booleansupportsInput
     Flag indicating the ability of this layer to support key/pen input.
protected  booleantileBG
     If this layer is not transparent and uses a background image, a flag indicating if that image should be tiled or otherwise centered.
protected  booleantransparent
     Flag indicating if this layer has a transparent background or not.
protected  booleanvisible
     Flag indicating the current visibility state of this layer.

Constructor Summary
public  CLayer()
     Construct a default, transparent layer.
public  CLayer(Image bgImage, int bgColor)
     Construct a layer with the given background image if it is not null or with a background fill color. The color should be in the 0xaarrggbb format.
public  CLayer(Image[] bgImages, int bgColor)
     Construct a layer with the given background images (if not null) or with a background fill color and border.

Method Summary
public  voidaddDirtyRegion()
     Add this layer's entire area to be marked for repaint.
public  booleanaddDirtyRegion(int x, int y, int w, int h)
     Add an area to be marked for repaint to this layer.
public  voidaddNotify()
     Called by CWindow to notify the layer that is has been added to the active stack.
protected  voidcleanDirty()
     Clean any dirty regions of the layer and mark layer as not dirty.
protected  voidcleanDirtyRegions()
     Clean any dirty regions of the layer.
public  booleancontainsPoint(int x, int y)
     Utility method to determine if the given point lies within the bounds of this layer.
 voidcopyLayerBounds()
    
public  int[]getBounds()
     Return the bounds of this layer (in the coordinate space of its parent Window).
public  booleanhandlePoint(int x, int y)
     Utility method to determine if this layer wanna handle the given point.
protected  voidinitialize()
     Finish initialization of this CLayer.
public  booleanisDirty()
     Returns true if this layer is in need of repainting.
protected  booleanisEmptyDirtyRegions()
     Determines whether dirty regions are empty.
public  booleanisOpaque()
    
public  booleanisVisible()
     Determine the current visibility of this layer.
public  booleankeyInput(int type, int code)
     Handle key input from a keypad.
protected  StringlayerID()
    
public  booleanmethodInput(String str)
     Handle input from some type of device-dependent input method.
public  voidpaint(Graphics g)
     Paint this layer.
protected  voidpaintBackground(Graphics g)
     Paint the background of this layer.
protected  voidpaintBody(Graphics g)
     Paint the body or content of this layer.
public  booleanpointerInput(int type, int x, int y)
     Handle input from a pen tap.
public  voidrelocateNotify(int[] oldBounds)
     Called by CWindow to notify the layer that is has been moved to another location.
public  voidremoveNotify(CWindow owner)
     Called by CWindow to notify the layer that is has been removed from the active stack.
public  voidrequestRepaint()
     Request a repaint for the entire contents of this layer.
public  voidrequestRepaint(int x, int y, int w, int h)
     Request a repaint for a specific region of this layer.
public  voidsetBackground(Image bgImage, boolean tileBG, int bgColor)
     Establish a background.
public  voidsetBackground(Image[] bgImages, int bgColor)
     Establish a background.
public  voidsetBounds(int x, int y, int w, int h)
     Establish the bounds of this layer.
protected  voidsetDirty()
     Mark this layer as being dirty.
protected  voidsetDirtyButNotNotifyOwner()
     Mark this layer as being dirty but don't mark the containing window.
public  voidsetOpaque(boolean opaque)
     Set the opacity flag for this layer.
public  voidsetSupportsInput(boolean support)
     Toggle the ability of this layer to receive input.
public  voidsetVisible(boolean visible)
     Toggle the visibility state of this layer within its containing window.
 booleansubDirtyRegion(int x, int y, int w, int h)
     Subtract a layer area not needed for repaint of this layer.
public  booleansupportsInput()
     Determine if this layer supports input, such as key and pen events.
public  StringtoString()
    
public  voidupdate(CLayer[] mainLayers)
    

Field Detail
H
final public static int H(Code)
Constant used to reference the '3' index of the bounds array



W
final public static int W(Code)
Constant used to reference the '2' index of the bounds array



X
final public static int X(Code)
Constant used to reference the '0' index of the bounds array



Y
final public static int Y(Code)
Constant used to reference the '1' index of the bounds array



bgColor
protected int bgColor(Code)
If this layer has a filled color background, the 0xrrggbbaa value of that color



bgImage
protected Image[] bgImage(Code)
The image to use as a background for this layer if this layer is not transparent and does not use a fill color.



bounds
public int[] bounds(Code)
An array holding the bounds of this layer. The indices are as follows: 0 = layer's 'x' coordinate 1 = layer's 'y' coordinate 2 = layer's width 3 = layer's height The 'x' and 'y' coordinates are in the coordinate space of the window which contains this layer.



boundsCopy
protected int[] boundsCopy(Code)
Copy of the layer bounds needed to unlock the layers for painting



dirtyBounds
protected int[] dirtyBounds(Code)
Array holding a bounding rectangle of an area needing repainting.



dirtyBoundsCopy
protected int[] dirtyBoundsCopy(Code)
Copy of the dirty bounds needed to unlock the layers for painting



graphicsColor
int graphicsColor(Code)
When in the paint() routine, graphicsColor will be set to the default graphics color. This is a convenience variable for subclasses to easily modify and then reset the graphics color.



graphicsFont
Font graphicsFont(Code)
When in the paint() routine, graphicsFont will be set to the default graphics Font. This is a convenience variable for subclasses to easily modify and then reset the graphics font.



opaque
protected boolean opaque(Code)
Flag indicating this layer is either completely opaque, or not. By default, a layer is not opaque, and thus requires the background and any layers below it to be painted in addition to itself. However, if a layer is opaque, it does not require anything it is obscuring to be painted, just itself. All layers are opaque by default.



owner
protected CWindow owner(Code)
The window which owns this layer. If this layer has not been added to a window or it has been removed from a window, the owner will be null.



supportsInput
protected boolean supportsInput(Code)
Flag indicating the ability of this layer to support key/pen input.



tileBG
protected boolean tileBG(Code)
If this layer is not transparent and uses a background image, a flag indicating if that image should be tiled or otherwise centered.



transparent
protected boolean transparent(Code)
Flag indicating if this layer has a transparent background or not.



visible
protected boolean visible(Code)
Flag indicating the current visibility state of this layer.




Constructor Detail
CLayer
public CLayer()(Code)
Construct a default, transparent layer. As a result, the 'transparent' value will be set to true.



CLayer
public CLayer(Image bgImage, int bgColor)(Code)
Construct a layer with the given background image if it is not null or with a background fill color. The color should be in the 0xaarrggbb format. If the bgColor is invalid and bgImage is null, this layer will be transparent and equal to the no-argument constructor.
Parameters:
  bgImage - The background image to use for this layer.
Parameters:
  bgColor - The color (0xaarrggbb) to use as the background fill



CLayer
public CLayer(Image[] bgImages, int bgColor)(Code)
Construct a layer with the given background images (if not null) or with a background fill color and border. The background images should be a 9 element array, creating a 9-piece image background. The color should be in the 0xaarrggbb format. If the bgColor is invalid and bgImages are null, this layer will be transparent and equal to the no-argument constructor.
Parameters:
  bgImages - The background image to use for this layer.
Parameters:
  bgColor - The color (0xaarrggbb) to use as the background fill




Method Detail
addDirtyRegion
public void addDirtyRegion()(Code)
Add this layer's entire area to be marked for repaint. Any pending dirty regions will be cleared and the entire layer will be painted on the next repaint.



addDirtyRegion
public boolean addDirtyRegion(int x, int y, int w, int h)(Code)
Add an area to be marked for repaint to this layer. This could be needed for a variety of reasons, such as this layer being obscured by another layer or window element. The new region should be in the coordinate space of this layer.
Parameters:
  x - the x coordinate of the region
Parameters:
  y - the y coordinate of the region
Parameters:
  w - the width of the region
Parameters:
  h - the height of the region true if dirty region of the layer was changed,false otherwise



addNotify
public void addNotify()(Code)
Called by CWindow to notify the layer that is has been added to the active stack. By default this method do nothing. This method could be re-implemented by particular layer to do some specific action as soon as it's added to the stack



cleanDirty
protected void cleanDirty()(Code)
Clean any dirty regions of the layer and mark layer as not dirty.



cleanDirtyRegions
protected void cleanDirtyRegions()(Code)
Clean any dirty regions of the layer.



containsPoint
public boolean containsPoint(int x, int y)(Code)
Utility method to determine if the given point lies within the bounds of this 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



copyLayerBounds
void copyLayerBounds()(Code)
Copy bounds of the layer to use them on dirty layers painting when the layers are not locked for changes from other threads



getBounds
public int[] getBounds()(Code)
Return the bounds of this layer (in the coordinate space of its parent Window). Returns a 4 element array, containing the x, y, width, and height representing this layer's bounding rectangle this layer's bounding rectangle in the coordinate spaceof its parent window



handlePoint
public boolean handlePoint(int x, int y)(Code)
Utility method to determine if this layer wanna handle the given point. By default the layer handles the point if it lies within the bounds of this 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



initialize
protected void initialize()(Code)
Finish initialization of this CLayer. This can be extended by subclasses. The dimensions of the CLayer are stored in its bounds[]. The 'x' and 'y' coordinates are in the coordinate space of the window which contains this layer. By default, a layer is located at the origin and is as large as the screen size. The X and Y coordinates represent the upper left position of this CLayer in the containing CWindow's coordinate space.



isDirty
public boolean isDirty()(Code)
Returns true if this layer is in need of repainting. true if this layer is marked as 'dirty' and needs repainting.



isEmptyDirtyRegions
protected boolean isEmptyDirtyRegions()(Code)
Determines whether dirty regions are empty. true if dirty regions are not set,false otherwise



isOpaque
public boolean isOpaque()(Code)
Determine if this layer is opaque true if this layer does not have any transparentor translucent areas



isVisible
public boolean isVisible()(Code)
Determine the current visibility of this layer. Note that this state only pertains to the layer's visibility status within its containing window. The window itself may or may not be actually visible on the physical display. true if this layer is currently visible in a window



keyInput
public boolean keyInput(int type, int code)(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:
  code - the numeric code assigned to the key



layerID
protected String layerID()(Code)
A String identifier used by subclasses (for debug purposes) abbreviated class name of the layer instance



methodInput
public boolean methodInput(String str)(Code)
Handle input from some type of device-dependent input method. This could be input from something such as T9, or a phonebook lookup, etc.
Parameters:
  str - the text to handle as direct input



paint
public void paint(Graphics g)(Code)
Paint this layer. This method should not generally be overridden by subclasses. This method carefully stores the clip, translation, and color before calling into subclasses. The graphics region will be translated such that it is in this layer's coordinate space (0,0 is the top left corner of this layer). The paintBackground() method will be called first, then the paintBody() method. The graphics will then carefully be put back into its original state before returning. Subclasses should override the paintBody() method and do not generally need to do any translates or bother to undo any changes made to the Graphics object.
Parameters:
  g - The graphics object to use to paint this layer.



paintBackground
protected void paintBackground(Graphics g)(Code)
Paint the background of this layer. This method will automatically handle a transparent layer, a layer with a background color (and/or border color), and a layer with a background image (either centered or tiled). Subclasses may override this method if they require a more advanced background (note that the transparent value should be set to false in order for the paintBackground() method to be called), but subclasses must be careful to reset any modifications made to the Graphics object before returning.
Parameters:
  g - The Graphics object to use to paint the background.



paintBody
protected void paintBody(Graphics g)(Code)
Paint the body or content of this layer. This method should be overridden by subclasses. Note that the Graphics object will already be translated into this layer's coordinate space. Subclasses do not need to reset any changes made to the Graphics object as the CLayer paint() routine will do that automatically.
Parameters:
  g - The Graphics object to use to paint the content of this layer



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



relocateNotify
public void relocateNotify(int[] oldBounds)(Code)
Called by CWindow to notify the layer that is has been moved to another location. By default this method do nothing. This method could be re-implemented by particular layer to do some specific action as soon as it's moved
Parameters:
  oldBounds - original bounds of this layer before it has been moved



removeNotify
public void removeNotify(CWindow owner)(Code)
Called by CWindow to notify the layer that is has been removed from the active stack. By default this method do nothing. This method could be re-implemented by particular layer to do some specific action as soon as it's removed from the stack
Parameters:
  owner - an instance of CWindow this layer has been removed from



requestRepaint
public void requestRepaint()(Code)
Request a repaint for the entire contents of this layer.



requestRepaint
public void requestRepaint(int x, int y, int w, int h)(Code)
Request a repaint for a specific region of this layer.
Parameters:
  x - The 'x' coordinate of the upper left corner of therepaint region
Parameters:
  y - The 'y' coordinate of the upper right corner of therepaint region
Parameters:
  w - The width of the repaint region
Parameters:
  h - The height of the repaint region



setBackground
public void setBackground(Image bgImage, boolean tileBG, int bgColor)(Code)
Establish a background. This method will evaluate the parameters and create a background which is appropriate. If the image is non-null, the image will be used to create the background. If the image is null, the values for the colors will be used and the background will be painted in fill color instead. If the image is null, and the background color is a negative value, this layer will become transparent and no background will be painted.
Parameters:
  bgImage - the image to use for the background tile (or null)
Parameters:
  tileBG - If true, then tile the background image as necessaryto fill a larger screen. If false, treat the imageas fullsize.
Parameters:
  bgColor - if the image is null, use this color as a backgroundfill color



setBackground
public void setBackground(Image[] bgImages, int bgColor)(Code)
Establish a background. This method will evaluate the parameters and create a background which is appropriate. If the images are non-null, the images will be used to create a 9-piece background. If the images are null, the value for the color will be used and the background will be painted in fill color instead. If the images are null, and the background color is a negative value, this layer will become transparent and no background will be painted.
Parameters:
  bgImages - an array containing a 9-piece image set to be usedas the background for this layer
Parameters:
  bgColor - if the images are null, use this color as a backgroundfill color



setBounds
public void setBounds(int x, int y, int w, int h)(Code)
Establish the bounds of this layer. The coordinate space for the 'x' and 'y' anchor will be interpreted in that of the window which contains this layer.
Parameters:
  x - The 'x' coordinate of this layer's origin
Parameters:
  y - The 'y' coordinate of this layer's origin
Parameters:
  w - The width of this layer
Parameters:
  h - The height of this layer



setDirty
protected void setDirty()(Code)
Mark this layer as being dirty. By default, this will also mark the containing window (if there is one) as being dirty as well.



setDirtyButNotNotifyOwner
protected void setDirtyButNotNotifyOwner()(Code)
Mark this layer as being dirty but don't mark the containing window.



setOpaque
public void setOpaque(boolean opaque)(Code)
Set the opacity flag for this layer. True means that this layer does not have any transparent or translucent areas
Parameters:
  opaque - a flag indicating the layer's opacity



setSupportsInput
public void setSupportsInput(boolean support)(Code)
Toggle the ability of this layer to receive input.
Parameters:
  support - If true, this layer will receive user input events(as long as the layer is also visible)



setVisible
public void setVisible(boolean visible)(Code)
Toggle the visibility state of this layer within its containing window.
Parameters:
  visible - If true, this layer will be painted as part of itscontaining window, as well as receive events if itsupports input.



subDirtyRegion
boolean subDirtyRegion(int x, int y, int w, int h)(Code)
Subtract a layer area not needed for repaint of this layer. It could be needed for a variety of reasons, such as layer being overlapped with opague higher layer or window element. The subtracted region should be in the coordinate space of this layer.
Parameters:
  x - the x coordinate of the region
Parameters:
  y - the y coordinate of the region
Parameters:
  w - the width of the region
Parameters:
  h - the height of the region true if dirty region of the layer was changed,false otherwise



supportsInput
public boolean supportsInput()(Code)
Determine if this layer supports input, such as key and pen events. true if this layer supports handling input events



toString
public String toString()(Code)
Get the layer details including its bound and dirty region information String with layer details



update
public void update(CLayer[] mainLayers)(Code)



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.