Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java
38829 views
/*1* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d;2627import java.awt.GraphicsEnvironment;28import java.awt.GraphicsDevice;29import java.awt.Graphics2D;30import java.awt.HeadlessException;31import java.awt.image.BufferedImage;32import java.awt.Font;33import java.text.AttributedCharacterIterator;34import java.awt.print.PrinterJob;35import java.util.Map;36import java.util.Hashtable;37import java.util.Locale;38import java.util.Vector;39import java.util.StringTokenizer;40import java.util.ResourceBundle;41import java.util.MissingResourceException;42import java.io.IOException;43import java.io.FilenameFilter;44import java.io.File;45import java.util.NoSuchElementException;46import sun.awt.FontConfiguration;47import java.util.TreeMap;48import java.util.Set;49import java.awt.font.TextAttribute;50import java.io.InputStream;51import java.io.FileInputStream;52import java.io.BufferedInputStream;53import java.util.Properties;54import java.awt.Point;55import java.awt.Rectangle;5657/**58* Headless decorator implementation of a SunGraphicsEnvironment59*/6061public class HeadlessGraphicsEnvironment extends GraphicsEnvironment {6263private GraphicsEnvironment ge;6465public HeadlessGraphicsEnvironment(GraphicsEnvironment ge) {66this.ge = ge;67}6869public GraphicsDevice[] getScreenDevices()70throws HeadlessException {71throw new HeadlessException();72}7374public GraphicsDevice getDefaultScreenDevice()75throws HeadlessException {76throw new HeadlessException();77}7879public Point getCenterPoint() throws HeadlessException {80throw new HeadlessException();81}8283public Rectangle getMaximumWindowBounds() throws HeadlessException {84throw new HeadlessException();85}8687public Graphics2D createGraphics(BufferedImage img) {88return ge.createGraphics(img); }8990public Font[] getAllFonts() { return ge.getAllFonts(); }9192public String[] getAvailableFontFamilyNames() {93return ge.getAvailableFontFamilyNames(); }9495public String[] getAvailableFontFamilyNames(Locale l) {96return ge.getAvailableFontFamilyNames(l); }9798/* Used by FontManager : internal API */99public GraphicsEnvironment getSunGraphicsEnvironment() {100return ge;101}102}103104105