Source Code Cross Referenced for GraphicsEnvironment.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:         * @(#)GraphicsEnvironment.java	1.11 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:        import java.awt.image.BufferedImage;
031:        import java.util.Hashtable;
032:        import java.util.Locale;
033:        import java.util.Map;
034:        import java.io.InputStream;
035:
036:        /**
037:         *
038:         * The <code>GraphicsEnvironment</code> class describes the collection
039:         * of {@link GraphicsDevice} objects and {@link java.awt.Font} objects
040:         * available to a Java(tm) application on a particular platform.
041:         * The resources in this <code>GraphicsEnvironment</code> might be local
042:         * or on a remote machine.  <code>GraphicsDevice</code> objects can be
043:         * screens, printers or image buffers and are the destination of
044:         * {@link Graphics2D} drawing methods.  Each <code>GraphicsDevice</code>
045:         * has a number of {@link GraphicsConfiguration} objects associated with
046:         * it.  These objects specify the different configurations in which the
047:         * <code>GraphicsDevice</code> can be used.
048:         * @see GraphicsDevice
049:         * @see GraphicsConfiguration
050:         * @version 	1.42, 02/02/00
051:         */
052:
053:        public abstract class GraphicsEnvironment {
054:
055:            private static GraphicsEnvironment localEnv;
056:
057:            /**
058:             * This is an abstract class and cannot be instantiated directly.
059:             * Instances must be obtained from a suitable factory or query method.
060:             */
061:            protected GraphicsEnvironment() {
062:            }
063:
064:            /**
065:             * Returns the local <code>GraphicsEnvironment</code>.
066:             * @return this <code>GraphicsEnvironment</code>.
067:             */
068:
069:            /**
070:             * Returns the local <code>GraphicsEnvironment</code>.
071:             * @return this <code>GraphicsEnvironment</code>.
072:             */
073:            public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() {
074:                if (localEnv == null) {
075:                    String nm = (String) java.security.AccessController
076:                            .doPrivileged(new sun.security.action.GetPropertyAction(
077:                                    "java.awt.graphicsenv", null));
078:                    try {
079:                        localEnv = (GraphicsEnvironment) Class.forName(nm)
080:                                .newInstance();
081:                    } catch (ClassNotFoundException e) {
082:                        throw new Error("Could not find class: " + nm);
083:                    } catch (InstantiationException e) {
084:                        throw new Error(
085:                                "Could not instantiate Graphics Environment: "
086:                                        + nm);
087:                    } catch (IllegalAccessException e) {
088:                        throw new Error(
089:                                "Could not access Graphics Environment: " + nm);
090:                    }
091:                }
092:                return localEnv;
093:            }
094:
095:            /**
096:             * Tests whether or not a display, keyboard, and mouse can be
097:             * supported in this environment.  If this method returns true,
098:             * a HeadlessException is thrown from areas of the Toolkit
099:             * and GraphicsEnvironment that are dependent on a display,
100:             * keyboard, or mouse.
101:             * @return <code>true</code> if this environment cannot support
102:             * a display, keyboard, and mouse; <code>false</code>
103:             * otherwise
104:             * @see java.awt.HeadlessException
105:             * @since 1.4
106:             */
107:            public static boolean isHeadless() {
108:                // fix for 5086794, matching the impl to that of basis.	
109:                return false;
110:            }
111:
112:            public abstract Graphics2D createGraphics(BufferedImage img);
113:
114:            /**
115:             * Returns an array of all of the screen <code>GraphicsDevice</code>
116:             * objects.
117:             * @return an array containing all the <code>GraphicsDevice</code>
118:             * objects that represent screen devices.
119:             */
120:            public abstract GraphicsDevice[] getScreenDevices();
121:
122:            /**
123:             * Returns the default screen <code>GraphicsDevice</code>.
124:             * @return the <code>GraphicsDevice</code> that represents the
125:             * default screen device.
126:             */
127:            public abstract GraphicsDevice getDefaultScreenDevice();
128:
129:            /**
130:             * Returns a <code>Graphics2D</code> object for rendering into the
131:             * specified {@link BufferedImage}.
132:             * @param img the specified <code>BufferedImage</code>
133:             * @return a <code>Graphics2D</code> to be used for rendering into
134:             * the specified <code>BufferedImage</code>.
135:             */
136:            // public abstract Graphics2D createGraphics(BufferedImage img);
137:            /**
138:             * Returns an array containing a one-point size instance of all fonts
139:             * available in this <code>GraphicsEnvironment</code>.  Typical usage
140:             * would be to allow a user to select a particular font.  Then, the
141:             * application can size the font and set various font attributes by
142:             * calling the <code>deriveFont</code> method on the choosen instance.
143:             * <p>
144:             * This method provides for the application the most precise control
145:             * over which <code>Font</code> instance is used to render text.
146:             * If a font in this <code>GraphicsEnvironment</code> has multiple
147:             * programmable variations, only one
148:             * instance of that <code>Font</code> is returned in the array, and
149:             * other variations must be derived by the application.
150:             * <p>
151:             * If a font in this environment has multiple programmable variations,
152:             * such as Multiple-Master fonts, only one instance of that font is
153:             * returned in the <code>Font</code> array.  The other variations
154:             * must be derived by the application.
155:             * @return an array of <code>Font</code> objects.
156:             * @see #getAvailableFontFamilyNames
157:             * @see java.awt.Font
158:             * @see java.awt.Font#deriveFont
159:             * @see java.awt.Font#getFontName
160:             * @since 1.2
161:             */
162:            // public abstract Font[] getAllFonts();
163:            /**
164:             * Returns an array containing the names of all font families available
165:             * in this <code>GraphicsEnvironment</code>.
166:             * Typical usage would be to allow a user to select a particular family
167:             * name and allow the application to choose related variants of the
168:             * same family when the user specifies style attributes such
169:             * as Bold or Italic.
170:             * <p>
171:             * This method provides for the application some control over which
172:             * <code>Font</code> instance is used to render text, but allows the
173:             * <code>Font</code> object more flexibility in choosing its own best
174:             * match among multiple fonts in the same font family.
175:             * @return an array of <code>String</code> containing names of font
176:             * families.
177:             * @see #getAllFonts
178:             * @see java.awt.Font
179:             * @see java.awt.Font#getFamily
180:             * @since 1.2
181:             */
182:            public abstract String[] getAvailableFontFamilyNames();
183:
184:            /**
185:             * Returns an array containing the localized names of all font families
186:             * available in this <code>GraphicsEnvironment</code>.
187:             * Typical usage would be to allow a user to select a particular family
188:             * name and allow the application to choose related variants of the
189:             * same family when the user specifies style attributes such
190:             * as Bold or Italic.
191:             * <p>
192:             * This method provides for the application some control over which
193:             * <code>Font</code> instance used to render text, but allows the
194:             * <code>Font</code> object more flexibility in choosing its own best
195:             * match among multiple fonts in the same font family.
196:             * If <code>l</code> is <code>null</code>, this method returns an
197:             * array containing all font family names available in this
198:             * <code>GraphicsEnvironment</code>.
199:             * @param l a {@link Locale} object that represents a
200:             * particular geographical, political, or cultural region
201:             * @return an array of <code>String</code> objects containing names of
202:             * font families specific to the specified <code>Locale</code>.
203:             * @see #getAllFonts
204:             * @see java.awt.Font
205:             * @see java.awt.Font#getFamily
206:             * @since 1.2
207:             */
208:            public abstract String[] getAvailableFontFamilyNames(Locale l);
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.