PJA Toolkit 2.6

com.eteks.java2d
Class PJAGraphicsEnvironment

java.lang.Object
  extended by java.awt.GraphicsEnvironment
      extended by sun.java2d.SunGraphicsEnvironment
          extended by com.eteks.java2d.PJAGraphicsEnvironment
All Implemented Interfaces:
java.util.EventListener, sun.awt.DisplayChangedListener, sun.java2d.FontSupport

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 PJADemo.java source for a way to change of .pjaf font).

Since:
PJA2.0
Version:
2.5
Author:
Emmanuel Puybaret
See Also:
PJAToolkit, PJAGraphicsManager

Nested Class Summary
 
Nested classes/interfaces inherited from class sun.java2d.SunGraphicsEnvironment
sun.java2d.SunGraphicsEnvironment.T1Filter, sun.java2d.SunGraphicsEnvironment.TTFilter
 
Field Summary
 
Fields inherited from class sun.java2d.SunGraphicsEnvironment
allFamilies, debugFonts, displayChanger, eudcFontFileName, fontPath, isLinux, isSolaris, jreFontDirName, jreLibDirName, lastDefaultLocale, logger, lucidaFontName, noType1Font, registeredFontFiles, screens, t1Filter, ttFilter
 
Constructor Summary
PJAGraphicsEnvironment()
           
 
Method Summary
protected  sun.awt.FontConfiguration createFontConfiguration()
          Implementation of the abstract method of SunGraphicsEnvironment.
 sun.awt.FontConfiguration createFontConfiguration(boolean preferLocaleFonts, boolean preferPropFonts)
          Implementation of the abstract method of SunGraphicsEnvironment.
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
addDisplayChangedListener, addFontToPlatformFontPath, addToMissingFontFileList, createCompositeFonts, displayChanged, fontSupportsDefaultEncoding, getAllFonts, getAllInstalledFonts, getAvailableFontFamilyNames, getAvailableFontFamilyNames, getDefaultFontFaceName, getDefaultFontFile, getDefaultScreenDevice, getFileNameFromPlatformName, getFontConfiguration, getInstalledFontFamilyNames, getJREFontFamilyNames, getNativeNames, getPlatformFontPath, getPlatformFontPathFromFontConfig, getPrinterJob, getScreenDevices, getSystemStartupLocale, getUsableBounds, isLogicalFont, loadFontFiles, loadFonts, paletteChanged, register1dot0Fonts, registerFontDir, registerFontDirs, registerFontFile, registerFontsInDir, registerFontsInDir, registerJREFontsWithPlatform, registerPlatformFontsUsedByFontConfiguration, removeDisplayChangedListener, useAbsoluteFontFileNames, useAlternateFontforJALocales
 
Methods inherited from class java.awt.GraphicsEnvironment
getCenterPoint, getLocalGraphicsEnvironment, getMaximumWindowBounds, isHeadless, isHeadlessInstance, preferLocaleFonts, preferProportionalFonts, registerFont
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PJAGraphicsEnvironment

public PJAGraphicsEnvironment()
Method Detail

getNumScreens

protected int getNumScreens()
Returns the number of screens.

Specified by:
getNumScreens in class sun.java2d.SunGraphicsEnvironment
Returns:
1

makeScreenDevice

protected java.awt.GraphicsDevice makeScreenDevice(int screenNum)
Specified by:
makeScreenDevice in class sun.java2d.SunGraphicsEnvironment

createGraphics

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

Overrides:
createGraphics in class sun.java2d.SunGraphicsEnvironment

createFontProperties

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

Since:
PJA2.5

createFontConfiguration

protected sun.awt.FontConfiguration createFontConfiguration()
Implementation of the abstract method of SunGraphicsEnvironment. This method appeared in JVM version 1.5.

Specified by:
createFontConfiguration in class sun.java2d.SunGraphicsEnvironment
Since:
PJA2.6

createFontConfiguration

public sun.awt.FontConfiguration createFontConfiguration(boolean preferLocaleFonts,
                                                         boolean preferPropFonts)
Implementation of the abstract method of SunGraphicsEnvironment. This method appeared in JVM version 1.5.

Specified by:
createFontConfiguration in class sun.java2d.SunGraphicsEnvironment
Since:
PJA2.6

PJA Toolkit 2.6

© Copyrights 1997-2008 eTeks - All rights reserved