Java Doc for Layer.java in  » 6.0-JDK-Modules » j2me » javax » microedition » lcdui » game » 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 » javax.microedition.lcdui.game 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.microedition.lcdui.game.Layer

All known Subclasses:   javax.microedition.lcdui.game.TiledLayer,  javax.microedition.lcdui.game.Sprite,
Layer
abstract public class Layer (Code)
A Layer is an abstract class representing a visual element of a game. Each Layer has position (in terms of the upper-left corner of its visual bounds), width, height, and can be made visible or invisible. Layer subclasses must implement a Layer.paint(Graphics) method so that they can be rendered.

The Layer's (x,y) position is always interpreted relative to the coordinate system of the Graphics object that is passed to the Layer's paint() method. This coordinate system is referred to as the painter's coordinate system. The initial location of a Layer is (0,0).



Field Summary
 intheight
    
 booleanvisible
     If the Layer is visible it will be drawn when paint is called.
 intwidth
    
 intx
    
 inty
    

Constructor Summary
 Layer(int width, int height)
     Creates a new Layer with the specified dimensions.

Method Summary
final public  intgetHeight()
     Gets the current height of this layer, in pixels.
final public  intgetWidth()
     Gets the current width of this layer, in pixels.
final public  intgetX()
     Gets the horizontal position of this Layer's upper-left corner in the painter's coordinate system.
final public  intgetY()
     Gets the vertical position of this Layer's upper-left corner in the painter's coordinate system.
final public  booleanisVisible()
     Gets the visibility of this Layer.
public  voidmove(int dx, int dy)
     Moves this Layer by the specified horizontal and vertical distances.
abstract public  voidpaint(Graphics g)
     Paints this Layer if it is visible.
 voidsetHeightImpl(int height)
     Sets the current height of this layer, in pixels.
public  voidsetPosition(int x, int y)
     Sets this Layer's position such that its upper-left corner is located at (x,y) in the painter's coordinate system.
public  voidsetVisible(boolean visible)
     Sets the visibility of this Layer.
 voidsetWidthImpl(int width)
     Sets the current width of this layer, in pixels.

Field Detail
height
int height(Code)
height of layer



visible
boolean visible(Code)
If the Layer is visible it will be drawn when paint is called.



width
int width(Code)
width of layer



x
int x(Code)
position of layer in x offset



y
int y(Code)
position of layer in y offset




Constructor Detail
Layer
Layer(int width, int height)(Code)
Creates a new Layer with the specified dimensions. This constructor is declared package scope to prevent developers from creating Layer subclasses By default, a Layer is visible and its upper-left corner is positioned at (0,0).
Parameters:
  width - The width of the layer, in pixels
Parameters:
  height - The height of the layer, in pixels




Method Detail
getHeight
final public int getHeight()(Code)
Gets the current height of this layer, in pixels. the height in pixels
See Also:   Layer.getWidth



getWidth
final public int getWidth()(Code)
Gets the current width of this layer, in pixels. the width in pixels
See Also:   Layer.getHeight



getX
final public int getX()(Code)
Gets the horizontal position of this Layer's upper-left corner in the painter's coordinate system.

the Layer's horizontal position.
See Also:   Layer.getY
See Also:   Layer.setPosition
See Also:   Layer.move




getY
final public int getY()(Code)
Gets the vertical position of this Layer's upper-left corner in the painter's coordinate system.

the Layer's vertical position.
See Also:   Layer.getX
See Also:   Layer.setPosition
See Also:   Layer.move




isVisible
final public boolean isVisible()(Code)
Gets the visibility of this Layer. true if the Layer is visible,false if it is invisible.
See Also:   Layer.setVisible



move
public void move(int dx, int dy)(Code)
Moves this Layer by the specified horizontal and vertical distances.
The Layer's coordinates are subject to wrapping if the passed parameters will cause them to exceed beyond Integer.MAX_VALUE or Integer.MIN_VALUE.
Parameters:
  dx - the distance to move along horizontal axis (positiveto the right, negative to the left)
Parameters:
  dy - the distance to move along vertical axis (positivedown, negative up)
See Also:   Layer.setPosition
See Also:   Layer.getX
See Also:   Layer.getY



paint
abstract public void paint(Graphics g)(Code)
Paints this Layer if it is visible. The upper-left corner of the Layer is rendered at it's current (x,y) position relative to the origin of the provided Graphics object. Applications may make use of Graphics clipping and translation to control where the Layer is rendered and to limit the region that is rendered.

Implementations of this method are responsible for checking if this Layer is visible; this method does nothing if the Layer is not visible.

The attributes of the Graphics object (clip region, translation, drawing color, etc.) are not modified as a result of calling this method.
Parameters:
  g - the graphics object for rendering the Layer
throws:
  NullPointerException - if g is null




setHeightImpl
void setHeightImpl(int height)(Code)
Sets the current height of this layer, in pixels. The Layer's height is used to determine its bounds for rendering purposes.
Parameters:
  height - The height in pixels
throws:
  IllegalArgumentException - if the specified height is less than 0
See Also:   Layer.setWidthImpl
See Also:   Layer.getHeight
See Also:   Layer.getWidth



setPosition
public void setPosition(int x, int y)(Code)
Sets this Layer's position such that its upper-left corner is located at (x,y) in the painter's coordinate system. A Layer is located at (0,0) by default.

Parameters:
  x - the horizontal position
Parameters:
  y - the vertical position
See Also:   Layer.move
See Also:   Layer.getX
See Also:   Layer.getY



setVisible
public void setVisible(boolean visible)(Code)
Sets the visibility of this Layer. A visible Layer is rendered when its Layer.paint(Graphics) method is called; an invisible Layer is not rendered.
Parameters:
  visible - true to make the Layer visible, false to make it invisible
See Also:   Layer.isVisible



setWidthImpl
void setWidthImpl(int width)(Code)
Sets the current width of this layer, in pixels. The Layer's width is used to determine its bounds for rendering purposes.
Parameters:
  width - The width in pixels
throws:
  IllegalArgumentException - if the specified width is less than 0
See Also:   Layer.setHeightImpl
See Also:   Layer.getHeight
See Also:   Layer.getWidth



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.