public abstract class MapRenderer extends java.lang.Object implements IMapRenderer
| Constructor and Description |
|---|
MapRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.String |
getCacheKey(IMap map)
Gets the cache key.
|
java.awt.image.BufferedImage |
getImage(IMap map)
Gets a bufferedImage of the current map containing all tile layers.
|
java.awt.image.BufferedImage |
getImage(IMap map,
RenderType... renderTypes)
Gets a bufferedImage of the current map containing all tile layers.
|
protected abstract java.awt.image.BufferedImage |
getLayerImage(ITileLayer layer,
IMap map,
boolean includeAnimationTiles) |
protected static java.awt.Image |
getTileImage(IMap map,
ITile tile) |
protected static boolean |
isVisible(ILayer layer) |
void |
render(java.awt.Graphics2D g,
IMap map,
double offsetX,
double offsetY,
RenderType... renderTypes)
Renders all layers of the specified
Map onto the graphics object that meet the specified render types. |
void |
render(java.awt.Graphics2D g,
IMap map,
java.awt.geom.Rectangle2D viewport,
RenderType... renderTypes)
Renders all layers of the specified
Map onto the graphics object that meet the specified render types. |
void |
render(java.awt.Graphics2D g,
IMap map,
RenderType... renderTypes)
Renders all layers of the specified
Map onto the graphics object that meet the specified render types. |
protected static void |
renderImageLayer(java.awt.Graphics2D g,
IImageLayer layer,
java.awt.geom.Rectangle2D viewport) |
protected abstract void |
renderTileLayerImage(java.awt.Graphics2D g,
ITileLayer layer,
IMap map,
java.awt.geom.Rectangle2D viewport) |
protected static boolean |
shouldBeRendered(ILayer layer,
RenderType[] renderTypes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSupportedOrientationpublic void render(java.awt.Graphics2D g,
IMap map,
java.awt.geom.Rectangle2D viewport,
RenderType... renderTypes)
IMapRendererMap onto the graphics object that meet the specified render types.render in interface IMapRendererg - the graphics objectmap - the mapviewport - The viewport that defines the bound for the tiles to be rendered.renderTypes - All layers that have one of the specified render types will be rendered.
If nothing is specified, layers will be rendered independently of their render type.ILayer.getRenderType()public java.awt.image.BufferedImage getImage(IMap map, RenderType... renderTypes)
IMapRenderergetImage in interface IMapRenderermap - the maprenderTypes - the renderTypes we want to be displayed in our imageRenderTypespublic java.awt.image.BufferedImage getImage(IMap map)
IMapRenderergetImage in interface IMapRenderermap - the mappublic void render(java.awt.Graphics2D g,
IMap map,
RenderType... renderTypes)
IMapRendererMap onto the graphics object that meet the specified render types.render in interface IMapRendererg - the graphics objectmap - the maprenderTypes - All layers that have one of the specified render types will be rendered.
If nothing is specified, layers will be rendered independently of their render type.ILayer.getRenderType()public void render(java.awt.Graphics2D g,
IMap map,
double offsetX,
double offsetY,
RenderType... renderTypes)
IMapRendererMap onto the graphics object that meet the specified render types.render in interface IMapRendererg - the graphics objectmap - the mapoffsetX - The horizontal offset in pixels for the map image that is applied
when rendering on the graphics object.offsetY - The vertical offset in pixels for the map image that is applied
when rendering on the graphics object.renderTypes - All layers that have one of the specified render types will be rendered.
If nothing is specified, layers will be rendered independently of their render type.ILayer.getRenderType()protected abstract java.awt.image.BufferedImage getLayerImage(ITileLayer layer, IMap map, boolean includeAnimationTiles)
protected abstract void renderTileLayerImage(java.awt.Graphics2D g,
ITileLayer layer,
IMap map,
java.awt.geom.Rectangle2D viewport)
protected static boolean shouldBeRendered(ILayer layer, RenderType[] renderTypes)
protected static boolean isVisible(ILayer layer)
protected static void renderImageLayer(java.awt.Graphics2D g,
IImageLayer layer,
java.awt.geom.Rectangle2D viewport)
protected static java.lang.String getCacheKey(IMap map)
map - the map