com.eteks.awt
Class PJAImage
java.lang.Object
|
+--java.awt.Image
|
+--com.eteks.awt.PJAImage
- public class PJAImage
- extends 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
- Author:
- Emmanuel Puybaret
|
Constructor Summary |
PJAImage(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,
ColorModel colorModel)
Creates an empty image of width x height pixels. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
width
private int width
height
private int height
availableInfo
private int availableInfo
pixels
private Object pixels
colorModel
private ColorModel colorModel
properties
private Hashtable properties
productionStarted
private boolean productionStarted
initProducer
private ImageProducer initProducer
manager
private PJAGraphicsManager manager
PJAImage
public PJAImage(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,
ColorModel colorModel)
- Creates an empty image of
width x height pixels. The image is created transparent
with colorModel color model.
- Since:
- PJA2.3
void ()
- Overrides:
in class Image
getProperty
public Object getProperty(String name,
ImageObserver observer)
java.awt.Image implementation.
- Overrides:
getProperty in class Image
- See Also:
Image
getWidth
public int getWidth(ImageObserver observer)
java.awt.Image implementation.
- Overrides:
getWidth in class Image
- See Also:
Image
getHeight
public int getHeight(ImageObserver observer)
java.awt.Image implementation.
- Overrides:
getHeight in class Image
- See Also:
Image
getSource
public ImageProducer getSource()
java.awt.Image implementation.
- Overrides:
getSource in class Image
- See Also:
Image
getGraphics
public 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 Image
- See Also:
Image
getColorModel
public 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 Image
- See Also:
Image
check
protected int check(ImageObserver observer)
prepare
protected boolean prepare(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 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
loadInitImage
private void loadInitImage(boolean wait,
ImageObserver observer)