Java Doc for OGLUtilities.java in  » 6.0-JDK-Modules-sun » java2d » sun » java2d » opengl » 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 sun » java2d » sun.java2d.opengl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.java2d.opengl.OGLUtilities

OGLUtilities
class OGLUtilities (Code)
This class contains a number of static utility methods that may be called (via reflection) by a third-party library, such as JOGL, in order to interoperate with the OGL-based Java 2D pipeline. WARNING: These methods are being made available as a temporary measure until we offer a more complete, public solution. Like any sun.* class, this class is not an officially supported public API; it may be modified at will or removed completely in a future release.


Field Summary
final public static  intFBOBJECT
    
final public static  intFLIP_BACKBUFFER
    
final public static  intPBUFFER
    
final public static  intTEXTURE
    
final public static  intUNDEFINED
     These OGL-specific surface type constants are the same as those defined in the OGLSurfaceData class and are duplicated here so that clients of this API can access them more easily via reflection.
final public static  intWINDOW
    


Method Summary
public static  RectanglegetOGLScissorBox(Graphics g)
     Returns the Rectangle describing the OpenGL scissor box on the Java 2D surface associated with the given Graphics object.
public static  ObjectgetOGLSurfaceIdentifier(Graphics g)
     Returns an Object identifier for the Java 2D surface associated with the given Graphics object.
public static  intgetOGLSurfaceType(Graphics g)
     Returns one of the OGL-specific surface type constants (defined in this class), which describes the surface associated with the given Graphics object.
public static  intgetOGLTextureType(Graphics g)
     Returns the OpenGL texture target constant (either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB) for the surface associated with the given Graphics object.
public static  RectanglegetOGLViewport(Graphics g, int componentWidth, int componentHeight)
     Returns the Rectangle describing the OpenGL viewport on the Java 2D surface associated with the given Graphics object and component width and height.
public static  booleaninvokeWithOGLContextCurrent(Graphics g, Runnable r)
     Invokes the given Runnable on the OGL QueueFlusher thread with the OpenGL context corresponding to the given Graphics object made current.
public static  booleaninvokeWithOGLSharedContextCurrent(GraphicsConfiguration config, Runnable r)
     Invokes the given Runnable on the OGL QueueFlusher thread with the "shared" OpenGL context (corresponding to the given GraphicsConfiguration object) made current.
public static  booleanisQueueFlusherThread()
     Returns true if the current thread is the OGL QueueFlusher thread.

Field Detail
FBOBJECT
final public static int FBOBJECT(Code)



FLIP_BACKBUFFER
final public static int FLIP_BACKBUFFER(Code)



PBUFFER
final public static int PBUFFER(Code)



TEXTURE
final public static int TEXTURE(Code)



UNDEFINED
final public static int UNDEFINED(Code)
These OGL-specific surface type constants are the same as those defined in the OGLSurfaceData class and are duplicated here so that clients of this API can access them more easily via reflection.



WINDOW
final public static int WINDOW(Code)





Method Detail
getOGLScissorBox
public static Rectangle getOGLScissorBox(Graphics g)(Code)
Returns the Rectangle describing the OpenGL scissor box on the Java 2D surface associated with the given Graphics object. When a third-party library is performing OpenGL rendering directly into the visible region of the associated surface, this scissor box must be set to avoid drawing over existing rendering results. Note that the x/y values in the returned Rectangle object represent the lower-left corner of the scissor region, relative to the lower-left corner of the given surface.
Parameters:
  g - the Graphics object for the corresponding destination surface;cannot be null a Rectangle describing the OpenGL scissor box for the givenGraphics object and corresponding destination surface, or null if thegiven Graphics object is invalid or the clip region is non-rectangular



getOGLSurfaceIdentifier
public static Object getOGLSurfaceIdentifier(Graphics g)(Code)
Returns an Object identifier for the Java 2D surface associated with the given Graphics object. This identifier may be used to determine whether the surface has changed since the last invocation of this operation, and thereby whether the OpenGL state corresponding to the old surface must be destroyed and recreated.
Parameters:
  g - the Graphics object for the corresponding destination surface;cannot be null an identifier for the surface associated with the givenGraphics object, or null if the given Graphics object is invalid



getOGLSurfaceType
public static int getOGLSurfaceType(Graphics g)(Code)
Returns one of the OGL-specific surface type constants (defined in this class), which describes the surface associated with the given Graphics object.
Parameters:
  g - the Graphics object for the corresponding destination surface;cannot be null a constant that describes the surface associated with thegiven Graphics object; if the given Graphics object is invalid (i.e.is not associated with an OpenGL surface) this method will returnOGLUtilities.UNDEFINED



getOGLTextureType
public static int getOGLTextureType(Graphics g)(Code)
Returns the OpenGL texture target constant (either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB) for the surface associated with the given Graphics object. This method is only useful for those surface types that are backed by an OpenGL texture, namely TEXTURE , FBOBJECT , and (on Windows only) PBUFFER .
Parameters:
  g - the Graphics object for the corresponding destination surface;cannot be null the texture target constant for the surface associated with thegiven Graphics object; if the given Graphics object is invalid (i.e.is not associated with an OpenGL surface), or the associated surfaceis not backed by an OpenGL texture, this method will return zero.



getOGLViewport
public static Rectangle getOGLViewport(Graphics g, int componentWidth, int componentHeight)(Code)
Returns the Rectangle describing the OpenGL viewport on the Java 2D surface associated with the given Graphics object and component width and height. When a third-party library is performing OpenGL rendering directly into the visible region of the associated surface, this viewport helps the application position the OpenGL output correctly on that surface. Note that the x/y values in the returned Rectangle object represent the lower-left corner of the viewport region, relative to the lower-left corner of the given surface.
Parameters:
  g - the Graphics object for the corresponding destination surface;cannot be null
Parameters:
  componentWidth - width of the component to be painted
Parameters:
  componentHeight - height of the component to be painted a Rectangle describing the OpenGL viewport for the givendestination surface and component dimensions, or null if the givenGraphics object is invalid



invokeWithOGLContextCurrent
public static boolean invokeWithOGLContextCurrent(Graphics g, Runnable r)(Code)
Invokes the given Runnable on the OGL QueueFlusher thread with the OpenGL context corresponding to the given Graphics object made current. It is legal for OpenGL code executed in the given Runnable to change the current OpenGL context; it will be reset once the Runnable completes. No guarantees are made as to the state of the OpenGL context of the Graphics object; for example, calling code must set the scissor box using the return value from OGLUtilities.getOGLScissorBox to avoid drawing over other Swing components, and must typically set the OpenGL viewport using the return value from OGLUtilities.getOGLViewport to make the client's OpenGL rendering appear in the correct place relative to the scissor region. In order to avoid deadlock, it is important that the given Runnable does not attempt to acquire the AWT lock, as that will be handled automatically as part of the rq.flushAndInvokeNow() step.
Parameters:
  g - the Graphics object for the corresponding destination surface;if null, the step making a context current to the destination surfacewill be skipped
Parameters:
  r - the action to be performed on the QFT; cannot be null true if the operation completed successfully, or false ifthere was any problem making a context current to the surfaceassociated with the given Graphics object



invokeWithOGLSharedContextCurrent
public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration config, Runnable r)(Code)
Invokes the given Runnable on the OGL QueueFlusher thread with the "shared" OpenGL context (corresponding to the given GraphicsConfiguration object) made current. This method is typically used when the Runnable needs a current context to complete its operation, but does not require that the context be made current to a particular surface. For example, an application may call this method so that the given Runnable can query the OpenGL capabilities of the given GraphicsConfiguration, without making a context current to a dummy surface (or similar hacky techniques). In order to avoid deadlock, it is important that the given Runnable does not attempt to acquire the AWT lock, as that will be handled automatically as part of the rq.flushAndInvokeNow() step.
Parameters:
  config - the GraphicsConfiguration object whose "shared"context will be made current during this operation; if this value isnull or if OpenGL is not enabled for the GraphicsConfiguration, thismethod will return false
Parameters:
  r - the action to be performed on the QFT; cannot be null true if the operation completed successfully, or false ifthere was any problem making the shared context current



isQueueFlusherThread
public static boolean isQueueFlusherThread()(Code)
Returns true if the current thread is the OGL QueueFlusher thread.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.