|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Top of the FieldView-hierarchy.
A FieldView is responsible for painting (at least parts of) one Field. This means, it may paint an image representing the whole Field, but may also paint just an Image representing the Terrain and nothing else.
Method Summary | |
Field |
getField()
Returns the field this FieldView displays. |
java.util.List |
getListenerSectionsForParent()
Returns a List of Sections defining which GameChanges this FieldView listens to. |
Coordinate |
getPaintSize()
Returns the size of the area this FieldView paints to. |
void |
paint(Coordinate coord,
java.awt.Graphics graphics)
Paints (some parts of) the field this FieldView is assigned to. |
void |
updateImage()
If this FieldView stores some images (and doesn't just load and calculate the needed images inside the paint-method), this method recalculates that images. |
Method Detail |
public Field getField()
public void paint(Coordinate coord, java.awt.Graphics graphics)
coord
- base-Coordinate used for paintinggraphics
- Graphics-object to paint withpublic Coordinate getPaintSize()
public void updateImage()
So this method should be called whenever some data the FieldView displays changes.
Note: Subinterfaces / implementing classes may specify that they listen to all required GameChanges directly. Then, calling this method from the XXXChanged-methods inside the FieldView suffices. (This behaviour can't be standard since some thousand Fields listening to a GameChange affecting just one or two Fields would be pretty inefficient).
public java.util.List getListenerSectionsForParent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |