Class PJAGraphicsEnvironment

  extended byjava.awt.GraphicsEnvironment
      extended bysun.java2d.SunGraphicsEnvironment
          extended bycom.eteks.java2d.PJAGraphicsEnvironment
All Implemented Interfaces:

public class PJAGraphicsEnvironment
extends sun.java2d.SunGraphicsEnvironment

Pure Java AWT GraphicsEnvironment implementation. This implementation enables to get an environment even when no Display is available.
java.awt.graphicsenv system property have to be set to com.eteks.java2d.PJAGraphicsEnvironment to allow the change of java.awt.GraphicsEnvironment default implementation. java.awt.fonts system property must be set to the path where True Type fonts files will be loaded from (this property must be defined to avoid calling the getFontPath () native method of the class NativeFontWrapper which needs a X11 Display in Motif implementation).
This path can be equal to :

Java2D can work with PJA only with JVM version >= 1.2. When GraphicsEnvironment.getLocalGraphicsEnvironment () fails because PJAGraphicsEnvironment class can't be loaded or java.awt.graphicsenv system property can't be changed, java.awt.Font can't be instantiated without a Display since this class requires an instance of java.awt.GraphicsEnvironment in Java 1.2. In that case, it forbids to use Graphics2D methods in a program because Graphics2D needs a default font (see source for a way to change of .pjaf font).

Emmanuel Puybaret
See Also:
PJAToolkit, PJAGraphicsManager

Nested Class Summary
Nested classes inherited from class sun.java2d.SunGraphicsEnvironment
sun.java2d.SunGraphicsEnvironment.T1Filter, sun.java2d.SunGraphicsEnvironment.T2KFilter, sun.java2d.SunGraphicsEnvironment.TTFilter
Field Summary
Fields inherited from class sun.java2d.SunGraphicsEnvironment
debugMapping, fallbackFont, fontPath, hasPLSF, loadNativeFonts, noType1Font, registeredAllPaths, registeredFonts, screens
Constructor Summary
Method Summary
protected  sun.awt.FontProperties createFontProperties()
          Implementation of the abstract method of SunGraphicsEnvironment.
 java.awt.Graphics2D createGraphics(java.awt.image.BufferedImage image)
          Returns a Graphics2D instance or throws an AWTError exception.
protected  int getNumScreens()
          Returns the number of screens.
protected  java.awt.GraphicsDevice makeScreenDevice(int screenNum)
Methods inherited from class sun.java2d.SunGraphicsEnvironment
addPlatformCompatibilityFileNames, addPlatformNameForFontProperties, createFont, fontSupportsDefaultEncoding, getAllFonts, getAvailableFontFamilyNames, getAvailableFontFamilyNames, getBasePlatformFontPath, getBestFontFor, getDefaultScreenDevice, getFileNameFromPlatformName, getFontProperties, getFontPropertyFD, getInternalFontName, getNativeNames, getPlatformFontPath, getPrinterJob, getScreenDevices, getUsableBounds, isLogicalFont, isLogicalFont, loadFonts, mapFontName, parseFamilyNameProperty, preferLocaleSpecificFonts, registerFontFile, registerFontPath, registerFontPaths, registerFontPropertiesFonts, registerFontsWithPlatform, registerNative, registerNativeFonts, setFallbackFont, styleStr
Methods inherited from class java.awt.GraphicsEnvironment
getCenterPoint, getLocalGraphicsEnvironment, getMaximumWindowBounds, isHeadless, isHeadlessInstance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PJAGraphicsEnvironment()
Method Detail


protected int getNumScreens()
Returns the number of screens.



protected java.awt.GraphicsDevice makeScreenDevice(int screenNum)


public java.awt.Graphics2D createGraphics(java.awt.image.BufferedImage image)
Returns a Graphics2D instance or throws an AWTError exception.


protected sun.awt.FontProperties createFontProperties()
Implementation of the abstract method of SunGraphicsEnvironment. This method appeared in JVM version 1.4.1.


© 1997-2003 eTeks - All rights reserved