com.alienfactory.javamappy.viewer.render
Class JDK11Renderer

java.lang.Object
  extended by 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

Field Summary
protected  int blockHeight
           
protected  int blockWidth
           
protected  java.awt.Image[] opaqueImages
           
protected  java.awt.Image[] transparentImages
           
 
Fields inherited from interface com.alienfactory.javamappy.viewer.render.Renderer
DRAW_LEFT_SIDE_ONLY, DRAW_RIGHT_SIDE_ONLY, NONE
 
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
 

Field Detail

opaqueImages

protected java.awt.Image[] opaqueImages

transparentImages

protected java.awt.Image[] transparentImages

blockWidth

protected final int blockWidth

blockHeight

protected final int blockHeight
Constructor Detail

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
Method Detail

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 region
y - the start coordinate of the clipping region
width - the width of the clipping region
height - 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 rendered
dstPixY - the coordinate of where the image should be rendered
transparency - 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.