civquest.swing.quadmap
Class Buffer

java.lang.Object
  extended bycivquest.swing.quadmap.Buffer

public class Buffer
extends java.lang.Object


Constructor Summary
Buffer(int x, int y, int width, int heigth, Properties properties)
           
 
Method Summary
 void deleteImage()
           
 Coordinate getBufferIntersectingCoord(Coordinate coord)
          Returns MapData.getAreaCoord.
 Rectangle getFieldRect()
           
 java.awt.Graphics2D getGraphics()
           
 int getHeight()
           
 java.awt.image.BufferedImage getImage()
           
 boolean[][] getMarkedFields()
           
 Coordinate getPosition()
           
 Coordinate getSize()
           
 int getStorePoints()
           
 int getWidth()
           
 boolean isImageCalculated()
           
 void markFieldForUpdate(Coordinate coord)
          Marks the field with the given Coordinate for update within this buffer.
 boolean mustBeRepainted()
           
 void repainted()
           
 void setImage(java.awt.image.BufferedImage image)
           
 boolean storeAlways()
           
 boolean updateImage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Buffer

public Buffer(int x,
              int y,
              int width,
              int heigth,
              Properties properties)
Method Detail

getPosition

public Coordinate getPosition()

getSize

public Coordinate getSize()

getWidth

public int getWidth()

getHeight

public int getHeight()

storeAlways

public boolean storeAlways()

isImageCalculated

public boolean isImageCalculated()

getImage

public java.awt.image.BufferedImage getImage()

getGraphics

public java.awt.Graphics2D getGraphics()

setImage

public void setImage(java.awt.image.BufferedImage image)

deleteImage

public void deleteImage()

getStorePoints

public int getStorePoints()

repainted

public void repainted()

mustBeRepainted

public boolean mustBeRepainted()

getFieldRect

public Rectangle getFieldRect()

getBufferIntersectingCoord

public Coordinate getBufferIntersectingCoord(Coordinate coord)
Returns MapData.getAreaCoord. If this method returns null for a field, markFieldForUpdate may not be called for that field!!!

Parameters:
coord - any field-Coordinate
Returns:
see MapData.getAreaCoord

getMarkedFields

public boolean[][] getMarkedFields()

markFieldForUpdate

public void markFieldForUpdate(Coordinate coord)
Marks the field with the given Coordinate for update within this buffer. NOTE that the field MUST INTERSECT this buffer!

Parameters:
coord - Coordinate of a Field intersecting this buffer

updateImage

public boolean updateImage()