|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object civquest.swing.quadmap.Properties
Every subclass of this class implements all data and function that is specific to the particular type of map (at present flat or iso) QuadMap runs on at the moment.
Some definitions:
The drawing-buffer-coordinate of a Field is the coordinate of the pixel in the column of the most western pixel and the row of the most northern pixel of the Field.
An absolute paint-coordinate is a coordinate relative to the viewportPosition (0,0). NOTE that no negative x or y-values are allowed for such a coordinate!!!
(Really?) An unscrolled array-coordinate is an array-coordinate that is not necessarily within map.
Field Summary | |
protected QuadMap |
quadMap
|
Constructor Summary | |
Properties()
|
Method Summary | |
abstract Coordinate |
adjustArrayCoordToScrolling(Coordinate coord)
Adjusts the given array-coordinate to the scrolling; this means that coordinates east/west of the east/west map-edge are converted to the corresponding coordinate on the map. |
Coordinate |
adjustArrayCoordToScrolling(int x,
int y)
|
abstract civquest.swing.UnitPainter |
constructUnitPainter(QuadMap quadMap)
Returns an UnitPainter appropriate for this type of map. |
abstract civquest.swing.UnitView |
constructUnitView(Unit unit)
Constructs a UnitView for the given Unit. |
abstract Coordinate[] |
getAbsFieldEdgeCoords(Coordinate coord)
Returns an array containing the (abs. |
Coordinate[] |
getAbsFieldEdgeCoords(Field field)
|
abstract Coordinate |
getAbsImagePaintCoord(Coordinate coord)
Returns the (absolute paint-)coordinate that must be used in order to paint an image for this field. |
abstract Rectangle |
getAbsImagePaintRectangle(Coordinate coord)
Returns the smallest rectangle containing the complete image used for drawing the field at the given array-coordinate. |
Rectangle |
getAbsImagePaintRectangle(Field field)
|
abstract Coordinate |
getAbsMiddlePaintCoord(Coordinate coord)
Returns the "middle"-absolute-paintcoord of Field field. |
abstract Coordinate |
getAbsPaintCoord(Coordinate coord)
Returns the drawing-buffer-coordinate of Field (array- x,y) (as an absolute paint-coordinate). |
java.util.Iterator |
getAbsRectFieldIterator(Buffer buffer)
|
abstract java.util.Iterator |
getAbsRectFieldIterator(Coordinate c1,
Coordinate c2)
Returns an iterator that iterates through all Fields located within the specified rectangle, where the coords are given as absolute-paint-coords. |
abstract Field |
getFieldByAbs(Coordinate paintCoord)
Returns a reference to the field that is at the given absolute paint-coordinate. |
abstract Rectangle |
getFieldRectangle(int x1,
int y1,
int x2,
int y2)
|
Rectangle |
getFieldRectangle(Rectangle paintRect)
Returns the smallest rectangle (inside the fields-array) containing all fields displayed within the given rectangle (in absolute paint-coords). |
abstract Coordinate |
getPaintSize()
Returns the number of pixels you need to paint the complete map. |
abstract Coordinate |
getScrollSize()
Returns the number of pixels you need to scroll in a direction in order to end up at the same position again. |
abstract Registry |
getSpecializedRegistry()
Returns the registry, where settings specific to _this_ type of map (for example "iso") get stored. |
abstract Coordinate |
getUnscrolledArrayCoord(Coordinate paintCoord)
Transforms the given absolute paint-coordinate into an unscrolled array-coordinate. |
Coordinate |
getUnscrolledArrayCoord(int x,
int y)
|
abstract void |
paintField(civquest.swing.quadmap.PaintInfo paintInfo,
Buffer buffer)
Paint the field specified in the given paintInfo into the given buffer, using the unscrolled array-coordinate specified in the given paintInfo. |
void |
repaintBuffer(Buffer buffer)
Repaint the whole buffer. |
abstract void |
updateDirtyFields(Buffer buffer)
Update all fields marked for update within the given buffer. |
abstract void |
updateFields(Buffer buffer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected QuadMap quadMap
Constructor Detail |
public Properties()
Method Detail |
public abstract Coordinate getScrollSize()
public abstract Coordinate getPaintSize()
public abstract Coordinate adjustArrayCoordToScrolling(Coordinate coord)
coord
- a coordinate in the array-coordinate-system (not necessarily in the array)
public Coordinate adjustArrayCoordToScrolling(int x, int y)
public abstract Coordinate getUnscrolledArrayCoord(Coordinate paintCoord)
public Coordinate getUnscrolledArrayCoord(int x, int y)
public abstract Field getFieldByAbs(Coordinate paintCoord)
public abstract Coordinate getAbsPaintCoord(Coordinate coord)
public abstract Coordinate getAbsImagePaintCoord(Coordinate coord)
public abstract Rectangle getAbsImagePaintRectangle(Coordinate coord)
coord
- an array-coordinate
public Rectangle getAbsImagePaintRectangle(Field field)
public abstract Coordinate[] getAbsFieldEdgeCoords(Coordinate coord)
public Coordinate[] getAbsFieldEdgeCoords(Field field)
public Rectangle getFieldRectangle(Rectangle paintRect)
paintRect
- a rectangle given by absolute paint-coords
public abstract Rectangle getFieldRectangle(int x1, int y1, int x2, int y2)
public abstract Coordinate getAbsMiddlePaintCoord(Coordinate coord)
public abstract java.util.Iterator getAbsRectFieldIterator(Coordinate c1, Coordinate c2)
If the fields are painted in the iteration-order, they are painted correct (no field is painted above a possibly shadowing one).
public java.util.Iterator getAbsRectFieldIterator(Buffer buffer)
public abstract void updateFields(Buffer buffer)
public abstract Registry getSpecializedRegistry()
public abstract civquest.swing.UnitPainter constructUnitPainter(QuadMap quadMap)
public abstract civquest.swing.UnitView constructUnitView(Unit unit)
unit
- any Unit
public abstract void paintField(civquest.swing.quadmap.PaintInfo paintInfo, Buffer buffer)
paintInfo
- paintInfo-object storing a reference to the field we
want to paint and the unscrolled array-coordinate (UAC)
(remember: one field my have multiple UACs)buffer
- any bufferpublic abstract void updateDirtyFields(Buffer buffer)
Afterwards, no field is marked for update within the given buffer.
buffer
- any Bufferpublic void repaintBuffer(Buffer buffer)
This means, start with a new/cleared buffer-image and paint all fields contained by this buffer into that image.
buffer
- any Buffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |