http://www.eteks.com

com.eteks.java2d
Class PJAGraphicsManager2D

java.lang.Object
  extended bycom.eteks.awt.PJAGraphicsManager
      extended bycom.eteks.java2d.PJAGraphicsManager2D

public class PJAGraphicsManager2D
extends PJAGraphicsManager

Pure Java AWT Manager for Java2D. This class manages fonts and images with Java 2D GraphicsEnvironment. Fonts come from True Type font files and images are build with PJABufferedImage.

Since:
PJA2.0
Version:
2.1
Author:
Emmanuel Puybaret
See Also:
PJAToolkit

Constructor Summary
PJAGraphicsManager2D()
           
 
Method Summary
 int checkImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)
          Checks the status of an image laoding.
 java.awt.Image createImage(java.awt.image.ImageProducer producer)
          Creates an image from the producer.
 java.awt.Image createImage(int width, int height)
          Creates an image of width x height pixels.
 java.lang.String[] getFontList()
          Returns the array {"Dialog", "SansSerif", "Serif", "Monospaced", "DialogInput"}.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          Returns the font metrics of a font.
 java.awt.peer.FontPeer getFontPeer(java.lang.String name, int style)
          Returns a dummy FontPeer object.
 java.awt.GraphicsConfiguration getGraphicsConfiguration()
          Returns a GraphicsConfiguration instance required by the the method getGraphicsConfiguration () of ComponentPeer interface.
 boolean prepareImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)
          Starts the loading of an image.
 
Methods inherited from class com.eteks.awt.PJAGraphicsManager
createImage, createImage, createImage, getClosestColorIndex, getColorModel, getDefaultFont, getDefaultGraphicsManager, getFontsDirectory, getFontsPath, getImage, getImage, getScreenHeight, getScreenResolution, getScreenWidth, isClassAccessible, isFontInstantiable, loadFont, loadFonts, loadFonts, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PJAGraphicsManager2D

public PJAGraphicsManager2D()
Method Detail

getFontPeer

public java.awt.peer.FontPeer getFontPeer(java.lang.String name,
                                          int style)
Returns a dummy FontPeer object.

Overrides:
getFontPeer in class PJAGraphicsManager
Parameters:
name - The font name.
style - The font style (Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC)
Returns:
Always return a FontPeer object. If the font name isn't available the FontPeer of the default font name is returned.
See Also:
PJAGraphicsManager.loadFonts()

getFontList

public java.lang.String[] getFontList()
Returns the array {"Dialog", "SansSerif", "Serif", "Monospaced", "DialogInput"}. The list of True Type fonts is obtained from GraphicsEnvironment getAvailableFontFamilyNames() method.

Overrides:
getFontList in class PJAGraphicsManager

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
Returns the font metrics of a font.

Overrides:
getFontMetrics in class PJAGraphicsManager

prepareImage

public boolean prepareImage(java.awt.Image image,
                            int width,
                            int height,
                            java.awt.image.ImageObserver observer)
Starts the loading of an image.

Overrides:
prepareImage in class PJAGraphicsManager
See Also:
PJAToolkit.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver)

checkImage

public int checkImage(java.awt.Image image,
                      int width,
                      int height,
                      java.awt.image.ImageObserver observer)
Checks the status of an image laoding.

Overrides:
checkImage in class PJAGraphicsManager
See Also:
PJAToolkit.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver)

createImage

public java.awt.Image createImage(java.awt.image.ImageProducer producer)
Creates an image from the producer. This is the method that finally creates an instance of PJABufferedImage.

Overrides:
createImage in class PJAGraphicsManager
Returns:
An instance of the class java.awt.Image.
See Also:
PJAToolkit.createImage(ImageProducer)

createImage

public java.awt.Image createImage(int width,
                                  int height)
Creates an image of width x height pixels. This method returns an instance of com.eteks.awt.PJABufferedImage.

Overrides:
createImage in class PJAGraphicsManager
Parameters:
width - Width in pixels of the new image.
height - Height in pixels of the new image.
Returns:
An instance of the class java.awt.Image.
See Also:
PJAGraphicsEnvironment

getGraphicsConfiguration

public java.awt.GraphicsConfiguration getGraphicsConfiguration()
Returns a GraphicsConfiguration instance required by the the method getGraphicsConfiguration () of ComponentPeer interface.

Overrides:
getGraphicsConfiguration in class PJAGraphicsManager
Since:
PJA2.0

© 1997-2003 eTeks - All rights reserved