civquest.swing.fieldview
Class LayeredFieldView

java.lang.Object
  extended bycivquest.swing.fieldview.CompositeFieldView
      extended bycivquest.swing.fieldview.LayeredFieldView
All Implemented Interfaces:
FieldView, FieldViewManager
Direct Known Subclasses:
QuadFlatLayeredFieldView, QuadIsoLayeredFieldView

public abstract class LayeredFieldView
extends CompositeFieldView

A CompositeFieldView that paints a Field by using some more basic FieldViews. Their paint-methods get called in the following, fixed order:

1. TerrainView (paints vegetation/height-level)

Paint of this class feeds these FieldViews with exactly the same Coordinate and the same graphics-object it gets itself. Class-invariant: All FieldViews getPaintSize-methods must return the same value.


Field Summary
protected  TerrainView terrainView
          Used for painting vegetation/height-level
 
Fields inherited from class civquest.swing.fieldview.CompositeFieldView
field, parent
 
Constructor Summary
LayeredFieldView(Field field, FieldViewManager parent)
           
 
Method Summary
 java.util.List getListenerSectionsForParent()
          Returns a List of Sections defining which GameChanges this FieldView listens to.
 Coordinate getPaintSize()
          Returns the paint-size as specified in the interface FieldView.
 void paint(Coordinate coord, java.awt.Graphics graphics)
          Paint the field as specified in the interface FieldView.
 
Methods inherited from class civquest.swing.fieldview.CompositeFieldView
getField, repaintChildFieldView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface civquest.swing.fieldview.FieldView
updateImage
 

Field Detail

terrainView

protected TerrainView terrainView
Used for painting vegetation/height-level

Constructor Detail

LayeredFieldView

public LayeredFieldView(Field field,
                        FieldViewManager parent)
Method Detail

paint

public void paint(Coordinate coord,
                  java.awt.Graphics graphics)
Paint the field as specified in the interface FieldView. For more information, see the class-comment.

Parameters:
coord -
graphics -

getPaintSize

public Coordinate getPaintSize()
Returns the paint-size as specified in the interface FieldView.

Returns:
paint-size as specified in the interface FieldView

getListenerSectionsForParent

public java.util.List getListenerSectionsForParent()
Returns a List of Sections defining which GameChanges this FieldView listens to. Only those sections which have to be processed by the parent of this FieldView (because this FieldView doesn't process them itself) are inserted into this List. (description copied from FieldView)

Returns:
a List of Section as defined