2
Copyright (C) 2009 Volker Berlin (i-net software)
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
27
import java.awt.Graphics2D;
28
import java.awt.GraphicsDevice;
29
import java.awt.GraphicsEnvironment;
30
import java.awt.HeadlessException;
31
import java.awt.Point;
32
import java.awt.Rectangle;
33
import java.awt.image.BufferedImage;
34
import java.util.Locale;
38
* Placeholder for not supported headless environment
40
public class HeadlessGraphicsEnvironment extends GraphicsEnvironment{
42
private final GraphicsEnvironment env;
45
public HeadlessGraphicsEnvironment(GraphicsEnvironment env){
53
public Graphics2D createGraphics(BufferedImage img){
54
return env.createGraphics(img);
61
public boolean equals(Object obj){
62
return env.equals(obj);
69
public Font[] getAllFonts(){
70
return env.getAllFonts();
77
public String[] getAvailableFontFamilyNames(){
78
return env.getAvailableFontFamilyNames();
85
public String[] getAvailableFontFamilyNames(Locale l){
86
return env.getAvailableFontFamilyNames(l);
93
public Point getCenterPoint() throws HeadlessException{
94
return env.getCenterPoint();
101
public GraphicsDevice getDefaultScreenDevice() throws HeadlessException{
102
return env.getDefaultScreenDevice();
109
public Rectangle getMaximumWindowBounds() throws HeadlessException{
110
return env.getMaximumWindowBounds();
117
public GraphicsDevice[] getScreenDevices() throws HeadlessException{
118
return env.getScreenDevices();
125
public int hashCode(){
126
return env.hashCode();
133
public boolean isHeadlessInstance(){
134
return env.isHeadlessInstance();
141
public void preferLocaleFonts(){
142
env.preferLocaleFonts();
149
public void preferProportionalFonts(){
150
env.preferProportionalFonts();
157
public boolean registerFont(Font font){
158
return env.registerFont(font);
165
public String toString(){
166
return env.toString();