|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfreerails.client.renderer.BufferedTiledBackgroundRenderer
public abstract class BufferedTiledBackgroundRenderer
This abstract class stores a buffer of the background of the current visible rectangle of the map. Code that is independent of how tiles are represented, e.g. whether they are square or isometric, should go here.
Field Summary | |
---|---|
(package private) java.awt.image.VolatileImage |
backgroundBuffer
An offscreen image storing the background of a region of the map. |
(package private) java.awt.Graphics |
bg
Used to draw on the backbuffer. |
(package private) java.awt.Rectangle |
bufferRect
The bounds and location of the map region that is stored in the offscreen Image backgraoundBuffer. |
private java.awt.GraphicsConfiguration |
defaultConfig
This is used to create images that are compatible with the default graphics configuration. |
private java.awt.Graphics |
translatedBg
Used to draw on the backbuffer. |
Constructor Summary | |
---|---|
BufferedTiledBackgroundRenderer()
|
Method Summary | |
---|---|
protected abstract void |
paintBufferRectangle(int x,
int y,
int width,
int height)
|
void |
paintRect(java.awt.Graphics outputGraphics,
java.awt.Rectangle newVisibleRectectangle)
Updates the backbuffer as necessay, then draws it on to the Graphics object passed. |
void |
refreshAll()
|
private void |
refreshBackground()
|
private void |
scrollbackgroundBuffer(int dx,
int dy)
|
private void |
setbackgroundBuffer(int w,
int h)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jfreerails.client.renderer.MapLayerRenderer |
---|
paintTile, refreshTile |
Field Detail |
---|
private final java.awt.GraphicsConfiguration defaultConfig
java.awt.Graphics bg
private java.awt.Graphics translatedBg
final java.awt.Rectangle bufferRect
java.awt.image.VolatileImage backgroundBuffer
Constructor Detail |
---|
public BufferedTiledBackgroundRenderer()
Method Detail |
---|
public void paintRect(java.awt.Graphics outputGraphics, java.awt.Rectangle newVisibleRectectangle)
paintRect
in interface MapLayerRenderer
outputGraphics
- Once it has been updated, the backbuffer is drawn onto this
Graphics object.newVisibleRectectangle
- The region of the map that the backbuffer must be updated to
display.private void refreshBackground()
public void refreshAll()
refreshAll
in interface MapLayerRenderer
private void setbackgroundBuffer(int w, int h)
protected abstract void paintBufferRectangle(int x, int y, int width, int height)
private void scrollbackgroundBuffer(int dx, int dy)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |