com.alienfactory.javamappy.viewer.render
Class JDK11Renderer
java.lang.Object
com.alienfactory.javamappy.viewer.render.JDK11Renderer
- All Implemented Interfaces:
- Renderer
public class JDK11Renderer
- extends java.lang.Object
This Renderer
is for use by JDK 1.1.x JVMs. This is the only
Renderer suitable for use by all Applets (including Microsoft's JVM).
The JDK11Renderer
creates its images using
java.awt.image.MemoryImageSources
. If the map has a colour depth
of 8 then java.awt.image.IndexColorModels
are used to speed up
image rendering. (Thanks go to Robin Burrows for the tip)
- Author:
- Steve Eynon
Constructor Summary |
JDK11Renderer(Map map)
Uses the raw pixel data and colour map from the given Map to
create the solid and transparent images in a JDK specific manner. |
Method Summary |
void |
drawImage(java.lang.Object objGFX,
int imageIndex,
int dstPixX,
int dstPixY,
boolean transparency,
int modification)
Draws an image as given by imageIndex at the given coordinates. |
void |
restoreClip(java.lang.Object objGFX)
This is called after a Layer is drawn to restore the
clipping region to what it used to be. |
void |
setClip(java.lang.Object objGFX,
int x,
int y,
int width,
int height)
This is called just before a Layer is drawn to allow the
Renderer to set the desired clipping region. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
opaqueImages
protected java.awt.Image[] opaqueImages
transparentImages
protected java.awt.Image[] transparentImages
blockWidth
protected final int blockWidth
blockHeight
protected final int blockHeight
JDK11Renderer
public JDK11Renderer(Map map)
throws java.lang.IllegalArgumentException
- Uses the raw pixel data and colour map from the given
Map
to
create the solid and transparent images in a JDK specific manner.
- Parameters:
map
- the Map
containing the image data to be rendered
- Throws:
java.lang.IllegalArgumentException
- if Map
is null
setClip
public void setClip(java.lang.Object objGFX,
int x,
int y,
int width,
int height)
throws java.lang.IllegalArgumentException
- Description copied from interface:
Renderer
- This is called just before a
Layer
is drawn to allow the
Renderer
to set the desired clipping region.
- Specified by:
setClip
in interface Renderer
- Parameters:
objGFX
- the gfx object specific to the Renderer
x
- the start coordinate of the clipping regiony
- the start coordinate of the clipping regionwidth
- the width of the clipping regionheight
- the height of the clipping region
- Throws:
java.lang.IllegalArgumentException
- if objGFX
is null
restoreClip
public void restoreClip(java.lang.Object objGFX)
throws java.lang.IllegalArgumentException
- Description copied from interface:
Renderer
- This is called after a
Layer
is drawn to restore the
clipping region to what it used to be.
- Specified by:
restoreClip
in interface Renderer
- Parameters:
objGFX
- the gfx object specific to the Renderer
- Throws:
java.lang.IllegalArgumentException
- if objGFX
is null
drawImage
public final void drawImage(java.lang.Object objGFX,
int imageIndex,
int dstPixX,
int dstPixY,
boolean transparency,
int modification)
throws java.lang.IllegalArgumentException
- Description copied from interface:
Renderer
- Draws an image as given by
imageIndex
at the given coordinates.
- Specified by:
drawImage
in interface Renderer
- Parameters:
objGFX
- the gfx object specific to the Renderer
imageIndex
- the index of the image to draw - see Map.getImageData()
dstPixX
- the coordinate of where the image should be rendereddstPixY
- the coordinate of where the image should be renderedtransparency
- whether or not the image should rendered honouring
it's transparent pixels.modification
- any modification style should be applied to the image
- Throws:
java.lang.IllegalArgumentException
- if objGFX
is null
Copyright © 2001-2009 Alien-Factory Ltd. All Rights Reserved.