APIdia Launch Partner
Top Description Fields Constructors Methods
sun.java2d

public final Class HeadlessGraphicsEnvironment

extends GraphicsEnvironment
Class Inheritance
Imports
java.awt.Font, .Graphics2D, .GraphicsDevice, .GraphicsEnvironment, .HeadlessException, .Point, .Rectangle, java.awt.image.BufferedImage, java.util.Locale

Headless decorator implementation of a SunGraphicsEnvironment

Field Summary

Modifier and TypeField and Description
private GraphicsEnvironment

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Graphics2D
createGraphics(BufferedImage img)

Implements abstract java.awt.GraphicsEnvironment.createGraphics.

Returns a Graphics2D object for rendering into the specified BufferedImage.

public Font[]
getAllFonts()

Implements abstract java.awt.GraphicsEnvironment.getAllFonts.

Returns an array containing a one-point size instance of all fonts available in this GraphicsEnvironment.

public String[]
getAvailableFontFamilyNames()

Implements abstract java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Returns an array containing the names of all font families in this GraphicsEnvironment localized for the default locale, as returned by Locale.getDefault().

public String[]
getAvailableFontFamilyNames(Locale l)

Implements abstract java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Returns an array containing the names of all font families in this GraphicsEnvironment localized for the specified locale.

public Point
getCenterPoint()

Overrides java.awt.GraphicsEnvironment.getCenterPoint.

Returns the Point where Windows should be centered.

public GraphicsDevice
getDefaultScreenDevice()

Implements abstract java.awt.GraphicsEnvironment.getDefaultScreenDevice.

Returns the default screen GraphicsDevice.

public Rectangle
getMaximumWindowBounds()

Overrides java.awt.GraphicsEnvironment.getMaximumWindowBounds.

Returns the maximum bounds for centered Windows.

public GraphicsDevice[]
getScreenDevices()

Implements abstract java.awt.GraphicsEnvironment.getScreenDevices.

Returns an array of all of the screen GraphicsDevice objects.

Inherited from java.awt.GraphicsEnvironment:
getLocalGraphicsEnvironmentisHeadlessisHeadlessInstancepreferLocaleFontspreferProportionalFontsregisterFont

Field Detail

geback to summary
private GraphicsEnvironment ge

Constructor Detail

HeadlessGraphicsEnvironmentback to summary
public HeadlessGraphicsEnvironment(GraphicsEnvironment ge)

Method Detail

createGraphicsback to summary
public Graphics2D createGraphics(BufferedImage img)

Implements abstract java.awt.GraphicsEnvironment.createGraphics.

Doc from java.awt.GraphicsEnvironment.createGraphics.

Returns a Graphics2D object for rendering into the specified BufferedImage.

Annotations
@Override
getAllFontsback to summary
public Font[] getAllFonts()

Implements abstract java.awt.GraphicsEnvironment.getAllFonts.

Doc from java.awt.GraphicsEnvironment.getAllFonts.

Returns an array containing a one-point size instance of all fonts available in this GraphicsEnvironment. Typical usage would be to allow a user to select a particular font. Then, the application can size the font and set various font attributes by calling the deriveFont method on the chosen instance.

This method provides for the application the most precise control over which Font instance is used to render text. If a font in this GraphicsEnvironment has multiple programmable variations, only one instance of that Font is returned in the array, and other variations must be derived by the application.

If a font in this environment has multiple programmable variations, such as Multiple-Master fonts, only one instance of that font is returned in the Font array. The other variations must be derived by the application.

Annotations
@Override
getAvailableFontFamilyNamesback to summary
public String[] getAvailableFontFamilyNames()

Implements abstract java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Doc from java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Returns an array containing the names of all font families in this GraphicsEnvironment localized for the default locale, as returned by Locale.getDefault().

Typical usage would be for presentation to a user for selection of a particular family name. An application can then specify this name when creating a font, in conjunction with a style, such as bold or italic, giving the font system flexibility in choosing its own best match among multiple fonts in the same font family.

Annotations
@Override
getAvailableFontFamilyNamesback to summary
public String[] getAvailableFontFamilyNames(Locale l)

Implements abstract java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Doc from java.awt.GraphicsEnvironment.getAvailableFontFamilyNames.

Returns an array containing the names of all font families in this GraphicsEnvironment localized for the specified locale.

Typical usage would be for presentation to a user for selection of a particular family name. An application can then specify this name when creating a font, in conjunction with a style, such as bold or italic, giving the font system flexibility in choosing its own best match among multiple fonts in the same font family.

Annotations
@Override
getCenterPointback to summary
public Point getCenterPoint() throws HeadlessException

Overrides java.awt.GraphicsEnvironment.getCenterPoint.

Doc from java.awt.GraphicsEnvironment.getCenterPoint.

Returns the Point where Windows should be centered. It is recommended that centered Windows be checked to ensure they fit within the available display area using getMaximumWindowBounds().

Annotations
@Override
Exceptions
HeadlessException:
if isHeadless() returns true
getDefaultScreenDeviceback to summary
public GraphicsDevice getDefaultScreenDevice() throws HeadlessException

Implements abstract java.awt.GraphicsEnvironment.getDefaultScreenDevice.

Doc from java.awt.GraphicsEnvironment.getDefaultScreenDevice.

Returns the default screen GraphicsDevice.

Annotations
@Override
Exceptions
HeadlessException:
if isHeadless() returns true
getMaximumWindowBoundsback to summary
public Rectangle getMaximumWindowBounds() throws HeadlessException

Overrides java.awt.GraphicsEnvironment.getMaximumWindowBounds.

Doc from java.awt.GraphicsEnvironment.getMaximumWindowBounds.

Returns the maximum bounds for centered Windows. These bounds account for objects in the native windowing system such as task bars and menu bars. The returned bounds will reside on a single display with one exception: on multi-screen systems where Windows should be centered across all displays, this method returns the bounds of the entire display area.

To get the usable bounds of a single display, use GraphicsConfiguration.getBounds() and Toolkit.getScreenInsets().

Annotations
@Override
Exceptions
HeadlessException:
if isHeadless() returns true
getScreenDevicesback to summary
public GraphicsDevice[] getScreenDevices() throws HeadlessException

Implements abstract java.awt.GraphicsEnvironment.getScreenDevices.

Doc from java.awt.GraphicsEnvironment.getScreenDevices.

Returns an array of all of the screen GraphicsDevice objects.

Annotations
@Override
Exceptions
HeadlessException:
if isHeadless() returns true