Source Code Cross Referenced for GraphicsDevice.java in  » 6.0-JDK-Modules » j2me » java » awt » 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 » java.awt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)GraphicsDevice.java	1.13 06/10/10
003:         *
004:         * Copyright  1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation. 
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt). 
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA 
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions. 
025:         *
026:         */
027:
028:        package java.awt;
029:
030:        /**
031:         * The <code>GraphicsDevice</code> class describes the graphics devices
032:         * that might be available in a particular graphics environment.  These
033:         * include screen and printer devices. Note that there can be many screens
034:         * and many printers in an instance of {@link GraphicsEnvironment}. Each
035:         * graphics device has one or more {@link GraphicsConfiguration} objects
036:         * associated with it.  These objects specify the different configurations
037:         * in which the <code>GraphicsDevice</code> can be used.
038:         * <p>
039:         * In a multi-screen environment, the <code>GraphicsConfiguration</code>
040:         * objects can be used to render components on multiple screens.  The
041:         * following code sample demonstrates how to create a <code>JFrame</code>
042:         * object for each <code>GraphicsConfiguration</code> on each screen
043:         * device in the <code>GraphicsEnvironment</code>:
044:         * <pre>
045:         *   GraphicsEnvironment ge = GraphicsEnvironment.
046:         *   getLocalGraphicsEnvironment();
047:         *   GraphicsDevice[] gs = ge.getScreenDevices();
048:         *   for (int j = 0; j < gs.length; j++) {
049:         *      GraphicsDevice gd = gs[j];
050:         *      GraphicsConfiguration[] gc =
051:         * 	gd.getConfigurations();
052:         *      for (int i=0; i < gc.length; i++) {
053:         *         JFrame f = new
054:         *         JFrame(gs[j].getDefaultConfiguration());
055:         *         Canvas c = new Canvas(gc[i]);
056:         *         Rectangle gcBounds = gc[i].getBounds();
057:         *         int xoffs = gcBounds.x;
058:         *         int yoffs = gcBounds.y;
059:         *	   f.getContentPane().add(c);
060:         *	   f.setLocation((i*50)+xoffs, (i*60)+yoffs);
061:         *         f.show();
062:         *      }
063:         *   }
064:         * </pre>
065:         * @see GraphicsEnvironment
066:         * @see GraphicsConfiguration
067:         * @version 1.21, 02/09/01
068:         */
069:        public abstract class GraphicsDevice {
070:            private Window fullScreenWindow = null;
071:            private Rectangle windowedModeBounds = null;
072:
073:            /**
074:             * This is an abstract class that cannot be instantiated directly.
075:             * Instances must be obtained from a suitable factory or query method.
076:             * @see GraphicsEnvironment#getScreenDevices
077:             * @see GraphicsEnvironment#getDefaultScreenDevice
078:             * @see GraphicsConfiguration#getDevice
079:             */
080:            protected GraphicsDevice() {
081:            }
082:
083:            /**
084:             * Device is a raster screen.
085:             */
086:            public final static int TYPE_RASTER_SCREEN = 0;
087:            /**
088:             * Device is a printer.
089:             */
090:            public final static int TYPE_PRINTER = 1;
091:            /**
092:             * Device is an image buffer.  This buffer can reside in device
093:             * or system memory but it is not physically viewable by the user.
094:             */
095:            public final static int TYPE_IMAGE_BUFFER = 2;
096:
097:            /**
098:             * Returns the type of this <code>GraphicsDevice</code>.
099:             * @return the type of this <code>GraphicsDevice</code>, which can
100:             * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER.
101:             * @see #TYPE_RASTER_SCREEN
102:             * @see #TYPE_PRINTER
103:             * @see #TYPE_IMAGE_BUFFER
104:             */
105:            public abstract int getType();
106:
107:            /**
108:             * Returns the identification string associated with this
109:             * <code>GraphicsDevice</code>.
110:             * <p>
111:             * A particular program might use more than one
112:             * <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>.
113:             * This method returns a <code>String</code> identifying a
114:             * particular <code>GraphicsDevice</code> in the local
115:             * <code>GraphicsEnvironment</code>.  Although there is
116:             * no public method to set this <code>String</code>, a programmer can
117:             * use the <code>String</code> for debugging purposes.  Vendors of
118:             * the Java<sup><font size=-2>TM</font></sup> Runtime Environment can
119:             * format the return value of the <code>String</code>.  To determine
120:             * how to interpret the value of the <code>String</code>, contact the
121:             * vendor of your Java Runtime.  To find out who the vendor is, from
122:             * your program, call the
123:             * {@link System#getProperty(String) getProperty} method of the
124:             * System class with "java.vendor".
125:             * @return a <code>String</code> that is the identification
126:             * of this <code>GraphicsDevice</code>.
127:             */
128:            public abstract String getIDstring();
129:
130:            /**
131:             * Returns all of the <code>GraphicsConfiguration</code>
132:             * objects associated with this <code>GraphicsDevice</code>.
133:             * @return an array of <code>GraphicsConfiguration</code>
134:             * objects that are associated with this
135:             * <code>GraphicsDevice</code>.
136:             */
137:            public abstract GraphicsConfiguration[] getConfigurations();
138:
139:            /**
140:             * Returns the default <code>GraphicsConfiguration</code>
141:             * associated with this <code>GraphicsDevice</code>.
142:             * @return the default <code>GraphicsConfiguration</code>
143:             * of this <code>GraphicsDevice</code>.
144:             */
145:            public abstract GraphicsConfiguration getDefaultConfiguration();
146:
147:            /**
148:             * Returns the "best" configuration possible that passes the
149:             * criteria defined in the {@link GraphicsConfigTemplate}.
150:             * @param gct the <code>GraphicsConfigTemplate</code> object
151:             * used to obtain a valid <code>GraphicsConfiguration</code>
152:             * @return a <code>GraphicsConfiguration</code> that passes
153:             * the criteria defined in the specified
154:             * <code>GraphicsConfigTemplate</code>.
155:             * @see GraphicsConfigTemplate
156:             */
157:
158:            /*
159:             public GraphicsConfiguration
160:             getBestConfiguration(GraphicsConfigTemplate gct) {
161:             GraphicsConfiguration[] configs = getConfigurations();
162:             return gct.getBestConfiguration(configs);
163:             }
164:             */
165:
166:            /**
167:             * Returns <code>true</code> if this <code>GraphicsDevice</code>
168:             * supports full-screen exclusive mode.
169:             * @return whether full-screen exclusive mode is available for
170:             * this graphics device
171:             * @since 1.4
172:             */
173:            public abstract boolean isFullScreenSupported();
174:
175:            public abstract int getAvailableAcceleratedMemory();
176:
177:            /**
178:             * Enter full-screen mode, or return to windowed mode.
179:             * <p>
180:             * If <code>isFullScreenSupported</code> returns <code>true</code>, full
181:             * screen mode is considered to be <i>exclusive</i>, which implies:
182:             * <ul>
183:             * <li>Windows cannot overlap the full-screen window.  All other application
184:             * windows will always appear beneath the full-screen window in the Z-order.
185:             * <li>Input method windows are disabled.  It is advisable to call
186:             * <code>Component.enableInputMethods(false)</code> to make a component
187:             * a non-client of the input method framework.
188:             * </ul>
189:             * <p>
190:             * If <code>isFullScreenSupported</code> returns
191:             * <code>false</code>, full-screen exclusive mode is simulated by resizing
192:             * the window to the size of the screen and positioning it at (0,0).
193:             * <p>
194:             * When returning to windowed mode from an exclusive full-screen window, any
195:             * display changes made by calling <code>setDisplayMode</code> are
196:             * automatically restored to their original state.
197:             *
198:             * @param w a window to use as the full-screen window; <code>null</code>
199:             * if returning to windowed mode.
200:             * @see #isFullScreenSupported
201:             * @see #getFullScreenWindow
202:             * @see #setDisplayMode
203:             * @see Component#enableInputMethods
204:             * @since 1.4
205:             */
206:            public abstract void setFullScreenWindow(Window w);
207:
208:            /**
209:             * Returns the <code>Window</code> object representing the
210:             * full-screen window if the device is in full-screen mode.
211:             * @return the full-screen window, <code>null</code> if the device is
212:             * not in full-screen mode.
213:             * @see #setFullScreenWindow(Window)
214:             * @since 1.4
215:             */
216:            public abstract Window getFullScreenWindow();
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.