com.alienfactory.javamappy.viewer.render
Interface Renderer

All Known Implementing Classes:
J2SE14Renderer, JDK11Renderer, JDK12Renderer, MIDP10Renderer, MIDP10RendererAlt, MIDP20Renderer, NokiaRenderer

public interface Renderer

A Renderer contains API specific drawing routines.

Author:
Steve Eynon

Field Summary
static int DRAW_LEFT_SIDE_ONLY
          When drawing an image this value specifies that only the left hand side of the image should be drawn (used in Pillar Rising Mode).
static int DRAW_RIGHT_SIDE_ONLY
          When drawing an image this value specifies that only the right hand side of the image should be drawn (used in Pillar Rising Mode).
static int NONE
          When drawing an image this value specifies that no modifications should be applied.
 
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.
 

Field Detail

NONE

static final int NONE
When drawing an image this value specifies that no modifications should be applied.

Has a constant value of 0.

See Also:
drawImage(Object, int, int, int, boolean, int), Constant Field Values

DRAW_LEFT_SIDE_ONLY

static final int DRAW_LEFT_SIDE_ONLY
When drawing an image this value specifies that only the left hand side of the image should be drawn (used in Pillar Rising Mode).

Has a constant value of 1.

See Also:
drawImage(Object, int, int, int, boolean, int), Constant Field Values

DRAW_RIGHT_SIDE_ONLY

static final int DRAW_RIGHT_SIDE_ONLY
When drawing an image this value specifies that only the right hand side of the image should be drawn (used in Pillar Rising Mode).

Has a constant value of 2.

See Also:
drawImage(Object, int, int, int, boolean, int), Constant Field Values
Method Detail

setClip

void setClip(java.lang.Object objGFX,
             int x,
             int y,
             int width,
             int height)
             throws java.lang.IllegalArgumentException
This is called just before a Layer is drawn to allow the Renderer to set the desired clipping region.

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

void restoreClip(java.lang.Object objGFX)
                 throws java.lang.IllegalArgumentException
This is called after a Layer is drawn to restore the clipping region to what it used to be.

Parameters:
objGFX - the gfx object specific to the Renderer
Throws:
java.lang.IllegalArgumentException - if objGFX is null

drawImage

void drawImage(java.lang.Object objGFX,
               int imageIndex,
               int dstPixX,
               int dstPixY,
               boolean transparency,
               int modification)
               throws java.lang.IllegalArgumentException
Draws an image as given by imageIndex at the given coordinates.

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.