All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intrigus.cocoja.java.awt.GraphicsEnvironment Maven / Gradle / Ivy

The newest version!

package com.intrigus.cocoja.java.awt;

import com.intrigus.cocoja.sun.awt.CGraphicsEnvironment;

/** The GraphicsEnvironment class describes the collection of {@link GraphicsDevice} objects and
 * {@link java.awt.Font} objects available to a Java(tm) application on a particular platform. The resources in this
 * GraphicsEnvironment might be local or on a remote machine. GraphicsDevice objects can be screens,
 * printers or image buffers and are the destination of {@link Graphics2D} drawing methods. Each GraphicsDevice has a
 * number of {@link GraphicsConfiguration} objects associated with it. These objects specify the different configurations in which
 * the GraphicsDevice can be used.
 * @see GraphicsDevice
 * @see GraphicsConfiguration */

public abstract class GraphicsEnvironment {
	private static GraphicsEnvironment localEnv;

	/** This is an abstract class and cannot be instantiated directly. Instances must be obtained from a suitable factory or query
	 * method. */
	protected GraphicsEnvironment () {
	}

	/** Returns the local GraphicsEnvironment.
	 * @return the local GraphicsEnvironment */
	public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment () {
		if (localEnv == null) {
			localEnv = createGE();
		}

		return localEnv;
	}

	/** Creates and returns the GraphicsEnvironment, according to the system property 'java.awt.graphicsenv'.
	 *
	 * @return the graphics environment */
	private static GraphicsEnvironment createGE () {
		return new CGraphicsEnvironment();
	}

	/** Returns an array of all of the screen GraphicsDevice objects.
	 * @return an array containing all the GraphicsDevice objects that represent screen devices
	 * @exception HeadlessException if isHeadless() returns true
	 * @see #isHeadless() */
	public abstract GraphicsDevice[] getScreenDevices ();

	/** Returns the default screen GraphicsDevice.
	 * @return the GraphicsDevice that represents the default screen device
	 * @exception HeadlessException if isHeadless() returns true
	 * @see #isHeadless() */
	public abstract GraphicsDevice getDefaultScreenDevice ();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy