java.awt
public abstract class GraphicsEnvironment extends Object
GraphicsDevice
,
GraphicsConfiguration
Modifier | Constructor and Description |
---|---|
protected |
GraphicsEnvironment()
The environment must be obtained from a factory or query method, hence
this constructor is protected.
|
Modifier and Type | Method and Description |
---|---|
abstract Graphics2D |
createGraphics(BufferedImage image)
Return a Graphics2D object which will render into the specified image.
|
abstract Font[] |
getAllFonts()
Returns an array of the one-point size fonts available in this
environment.
|
abstract String[] |
getAvailableFontFamilyNames()
Returns an array of the font family names available in this environment.
|
abstract String[] |
getAvailableFontFamilyNames(Locale l)
Returns an array of the font family names available in this environment,
localized to the current Locale if l is non-null.
|
Point |
getCenterPoint()
Returns the point where a window should be centered.
|
abstract GraphicsDevice |
getDefaultScreenDevice()
Get the default screen GraphicsDevice object.
|
static GraphicsEnvironment |
getLocalGraphicsEnvironment()
Returns the local graphics environment.
|
Rectangle |
getMaximumWindowBounds()
Returns the maximum bounds for a centered window object.
|
abstract GraphicsDevice[] |
getScreenDevices()
Get an array of all the GraphicsDevice objects.
|
static boolean |
isHeadless()
Check if the local environment is headless, meaning that it does not
support a display, keyboard, or mouse.
|
boolean |
isHeadlessInstance()
Check if the given environment is headless, meaning that it does not
support a display, keyboard, or mouse.
|
protected GraphicsEnvironment()
public static GraphicsEnvironment getLocalGraphicsEnvironment()
public static boolean isHeadless()
HeadlessException
if this
returns true.
This method returns true if the java.awt.headless property is set
to "true".public boolean isHeadlessInstance()
HeadlessException
if this
returns true. This default implementation returns isHeadless(), so
subclasses need only override it if they differ.public abstract GraphicsDevice[] getScreenDevices()
HeadlessException
- if the environment is headlesspublic abstract GraphicsDevice getDefaultScreenDevice()
HeadlessException
- if the environment is headlesspublic abstract Graphics2D createGraphics(BufferedImage image)
image
- the image to render intopublic abstract Font[] getAllFonts()
deriveFont
.
Only one master version of each font appears in this array; if a font
can be derived from another, it must be created in that way.getAvailableFontFamilyNames()
,
Font.deriveFont(int, float)
public abstract String[] getAvailableFontFamilyNames()
getAllFonts()
,
Font.getFamily()
public abstract String[] getAvailableFontFamilyNames(Locale l)
l
- the locale to usegetAllFonts()
,
Font.getFamily()
public Point getCenterPoint()
HeadlessException
- if the environment is headlessgetMaximumWindowBounds()
public Rectangle getMaximumWindowBounds()
HeadlessException
- if the environment is headlessgetCenterPoint()
,
GraphicsConfiguration.getBounds()
,
Toolkit.getScreenInsets(GraphicsConfiguration)