History

My first initial commit with all of mine experimental changes.

Dmitry Kabak (userdima committed 13 years ago

Commit d37b88d1 parent 3f5b46618352 files · +2598093 −-8690Browse files

Showing the changes to java/pkg/sun/java2d/HeadlessGraphicsEnvironment.java (1 of 18352 files). Show all

Unified · Split

java/pkg/sun/java2d/HeadlessGraphicsEnvironment.java+103−0
@@ -0,0 +1,103 @@
1/*
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package sun.java2d;
27
28import java.awt.GraphicsEnvironment;
29import java.awt.GraphicsDevice;
30import java.awt.Graphics2D;
31import java.awt.HeadlessException;
32import java.awt.image.BufferedImage;
33import java.awt.Font;
34import java.text.AttributedCharacterIterator;
35import java.awt.print.PrinterJob;
36import java.util.Map;
37import java.util.Hashtable;
38import java.util.Locale;
39import java.util.Vector;
40import java.util.StringTokenizer;
41import java.util.ResourceBundle;
42import java.util.MissingResourceException;
43import java.io.IOException;
44import java.io.FilenameFilter;
45import java.io.File;
46import java.util.NoSuchElementException;
47import sun.awt.FontConfiguration;
48import java.util.TreeMap;
49import java.util.Set;
50import java.awt.font.TextAttribute;
51import java.io.InputStream;
52import java.io.FileInputStream;
53import java.io.BufferedInputStream;
54import java.util.Properties;
55import java.awt.Point;
56import java.awt.Rectangle;
57
58/**
59 * Headless decorator implementation of a SunGraphicsEnvironment
60 */
61
62public class HeadlessGraphicsEnvironment extends GraphicsEnvironment {
63
64 private GraphicsEnvironment ge;
65
66 public HeadlessGraphicsEnvironment(GraphicsEnvironment ge) {
67 this.ge = ge;
68 }
69
70 public GraphicsDevice[] getScreenDevices()
71 throws HeadlessException {
72 throw new HeadlessException();
73 }
74
75 public GraphicsDevice getDefaultScreenDevice()
76 throws HeadlessException {
77 throw new HeadlessException();
78 }
79
80 public Point getCenterPoint() throws HeadlessException {
81 throw new HeadlessException();
82 }
83
84 public Rectangle getMaximumWindowBounds() throws HeadlessException {
85 throw new HeadlessException();
86 }
87
88 public Graphics2D createGraphics(BufferedImage img) {
89 return ge.createGraphics(img); }
90
91 public Font[] getAllFonts() { return ge.getAllFonts(); }
92
93 public String[] getAvailableFontFamilyNames() {
94 return ge.getAvailableFontFamilyNames(); }
95
96 public String[] getAvailableFontFamilyNames(Locale l) {
97 return ge.getAvailableFontFamilyNames(l); }
98
99 /* Used by FontManager : internal API */
100 public GraphicsEnvironment getSunGraphicsEnvironment() {
101 return ge;
102 }
103}