|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.GraphicsEnvironment
public abstract class GraphicsEnvironment
This descibes the collection of GraphicsDevice and Font objects available on a given platform. The resources might be local or remote, and specify the valid configurations for displaying graphics.
GraphicsDevice
,
GraphicsConfiguration
Constructor Summary | |
---|---|
protected |
GraphicsEnvironment()
The environment must be obtained from a factory or query method, hence this constructor is protected. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GraphicsEnvironment()
Method Detail |
---|
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 into
public 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 use
getAllFonts()
,
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |