http://www.eteks.com

com.eteks.awt
Class PJAImage

java.lang.Object
  |
  +--java.awt.Image
        |
        +--com.eteks.awt.PJAImage

public class PJAImage
extends java.awt.Image

Pure Java AWT Image implementation. This image stores in a buffer an offscreen image using default RGB color model or another indexed color model.

Since:
PJA1.0
Version:
2.3
Author:
Emmanuel Puybaret

Fields inherited from class java.awt.Image
SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
 
Constructor Summary
PJAImage(java.awt.image.ImageProducer producer)
          Creates an initial image with a producer.
PJAImage(int width, int height)
          Creates an empty image of width x height pixels.
PJAImage(int width, int height, java.awt.image.ColorModel colorModel)
          Creates an empty image of width x height pixels.
 
Method Summary
protected  int check(java.awt.image.ImageObserver observer)
           
 void flush()
          java.awt.Image implementation.
 java.awt.image.ColorModel getColorModel()
          Returns this image's color model
 java.awt.Graphics getGraphics()
          java.awt.Image implementation.
protected  int getHeight()
           
 int getHeight(java.awt.image.ImageObserver observer)
          java.awt.Image implementation.
protected  int getPixelColor(int x, int y)
          Gets the color at the point (x,y).
protected  int[] getPixels()
          Gets the array used to store the pixels of this image.
protected  java.lang.Object getPixelsArray()
          Gets the array used to store the pixels of this image.
 java.lang.Object getProperty(java.lang.String name, java.awt.image.ImageObserver observer)
          java.awt.Image implementation.
 java.awt.image.ImageProducer getSource()
          java.awt.Image implementation.
protected  int getWidth()
           
 int getWidth(java.awt.image.ImageObserver observer)
          java.awt.Image implementation.
protected  boolean prepare(java.awt.image.ImageObserver observer)
           
protected  void setPixelColor(int x, int y, int ARGB)
          Sets the color at the point (x,y).
 void sync()
          Synchronizes the image loading.
 
Methods inherited from class java.awt.Image
getScaledInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PJAImage

public PJAImage(java.awt.image.ImageProducer producer)
Creates an initial image with a producer.
Parameters:
producer - An instance of a class that implements ImagePoducer.

PJAImage

public PJAImage(int width,
                int height)
Creates an empty image of width x height pixels. The image is created transparent.
See Also:
PJAToolkit

PJAImage

public PJAImage(int width,
                int height,
                java.awt.image.ColorModel colorModel)
Creates an empty image of width x height pixels. The image is created transparent with colorModel color model.
Since:
PJA2.3
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String name,
                                    java.awt.image.ImageObserver observer)
java.awt.Image implementation.
Overrides:
getProperty in class java.awt.Image
See Also:
Image

getWidth

public int getWidth(java.awt.image.ImageObserver observer)
java.awt.Image implementation.
Overrides:
getWidth in class java.awt.Image
See Also:
Image

getHeight

public int getHeight(java.awt.image.ImageObserver observer)
java.awt.Image implementation.
Overrides:
getHeight in class java.awt.Image
See Also:
Image

getSource

public java.awt.image.ImageProducer getSource()
java.awt.Image implementation.
Overrides:
getSource in class java.awt.Image
See Also:
Image

getGraphics

public java.awt.Graphics getGraphics()
java.awt.Image implementation. Contrary to JDK default behavior, PJA allows to retrieve an instance of Graphics on images created with a producer. This enables to draw in transparent images.
Overrides:
getGraphics in class java.awt.Image
See Also:
Image

getColorModel

public java.awt.image.ColorModel getColorModel()
Returns this image's color model
Returns:
the image's color model. null means the default color model.
Since:
PJA2.3

flush

public void flush()
java.awt.Image implementation.
Overrides:
flush in class java.awt.Image
See Also:
Image

check

protected int check(java.awt.image.ImageObserver observer)

prepare

protected boolean prepare(java.awt.image.ImageObserver observer)

getWidth

protected int getWidth()

getHeight

protected int getHeight()

getPixels

protected int[] getPixels()
Gets the array used to store the pixels of this image.
Returns:
an array of int or null if the array contains byte or if the image was flushed.

getPixelsArray

protected java.lang.Object getPixelsArray()
Gets the array used to store the pixels of this image.
Returns:
an array of int or byte.
Since:
PJA2.3

getPixelColor

protected int getPixelColor(int x,
                            int y)
Gets the color at the point (x,y).
Parameters:
x - the point coordinates.
y -  
Returns:
the color of the point in default RGB model.
Since:
PJA2.0

setPixelColor

protected void setPixelColor(int x,
                             int y,
                             int ARGB)
Sets the color at the point (x,y).
Parameters:
x - the point coordinates.
y -  
ARGB - the color of the point in default RGB model.
Since:
PJA2.0

sync

public void sync()
Synchronizes the image loading.
Since:
PJA2.0

© 1997-2001 eTeks - All rights reserved