com.eteks.java2d
Class PJAGraphicsManager2D
java.lang.Object
|
+--com.eteks.awt.PJAGraphicsManager
|
+--com.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
- Author:
- Emmanuel Puybaret
- See Also:
PJAToolkit
|
Method Summary |
int |
checkImage(Image image,
int width,
int height,
ImageObserver observer)
Checks the status of an image laoding. |
Image |
createImage(ImageProducer producer)
Creates an image from the producer. |
Image |
createImage(int width,
int height)
Creates an image of width x height pixels. |
String[] |
getFontList()
Returns the array {"Dialog", "SansSerif", "Serif", "Monospaced", "DialogInput"}. |
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics of a font. |
java.awt.peer.FontPeer |
getFontPeer(String name,
int style)
Returns a dummy FontPeer object. |
GraphicsConfiguration |
getGraphicsConfiguration()
Returns a GraphicsConfiguration instance required by the the method
getGraphicsConfiguration () of ComponentPeer interface. |
boolean |
prepareImage(Image image,
int width,
int height,
ImageObserver observer)
Starts the loading of an image. |
| Methods inherited from class com.eteks.awt.PJAGraphicsManager |
, createImage, createImage, createImage, getClosestColorIndex, getColorModel, getDefaultFont, getDefaultGraphicsManager, getFontMetrics, getFontPeer, getFontsDirectory, getFontsPath, getImage, getImage, getScreenHeight, getScreenResolution, getScreenWidth, isClassAccessible, isFontInstantiable, isFontInstantiableInternal, loadFont, loadFonts, loadFonts, sync, updateFontList, useJava2D |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
java2DGraphicsInstance
private static Graphics java2DGraphicsInstance
java2DGraphicsConfiguration
private static GraphicsConfiguration java2DGraphicsConfiguration
PJAGraphicsManager2D
public PJAGraphicsManager2D()
getFontPeer
public java.awt.peer.FontPeer getFontPeer(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)
getFontList
public 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 FontMetrics getFontMetrics(Font font)
- Returns the font metrics of a font.
- Overrides:
getFontMetrics in class PJAGraphicsManager
prepareImage
public boolean prepareImage(Image image,
int width,
int height,
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(Image image,
int width,
int height,
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 Image createImage(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.
createImage
public 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 GraphicsConfiguration getGraphicsConfiguration()
- Returns a
GraphicsConfiguration instance required by the the method
getGraphicsConfiguration () of ComponentPeer interface.
- Overrides:
getGraphicsConfiguration in class PJAGraphicsManager
- Since:
- PJA2.0