public class StateRenderLayer extends java.lang.Object implements RenderLayer
Modifier and Type | Class and Description |
---|---|
static class |
StateRenderLayer.ObjectPainterAndClassNamePair
A pair of the name of an object class to paint, and the
ObjectPainter to
use to paint it. |
Modifier and Type | Field and Description |
---|---|
protected State |
curState
the current state to be painted next
|
protected java.util.List<StateRenderLayer.ObjectPainterAndClassNamePair> |
objectClassPainterList
Ordered list of painters for each object class
|
protected java.util.Map<java.lang.String,ObjectPainter> |
specificObjectPainters
Map of painters that define how to paint specific objects; if an object it appears in both specific and general lists, the specific painter is used
|
protected java.util.List<StaticPainter> |
staticPainters
list of static painters that pain static non-object defined properties of the domain
|
Constructor and Description |
---|
StateRenderLayer() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectClassPainter(java.lang.String className,
ObjectPainter op)
Adds a class that will paint objects that belong to a given OO-MDPclass.
|
void |
addSpecificObjectPainter(java.lang.String objectName,
ObjectPainter op)
Adds a painter that will be used to paint a specific object in states
|
void |
addStaticPainter(StaticPainter sp)
Adds a static painter for the domain.
|
State |
getCurState() |
java.util.List<StateRenderLayer.ObjectPainterAndClassNamePair> |
getObjectClassPainterList() |
java.util.Map<java.lang.String,ObjectPainter> |
getSpecificObjectPainters() |
java.util.List<StaticPainter> |
getStaticPainters() |
void |
render(java.awt.Graphics2D g2,
float width,
float height) |
void |
updateState(State s)
Updates the state that needs to be painted
|
protected State curState
protected java.util.List<StaticPainter> staticPainters
protected java.util.List<StateRenderLayer.ObjectPainterAndClassNamePair> objectClassPainterList
protected java.util.Map<java.lang.String,ObjectPainter> specificObjectPainters
public void addStaticPainter(StaticPainter sp)
sp
- the static painter to add.public void addObjectClassPainter(java.lang.String className, ObjectPainter op)
className
- the name of the class that the provided painter can paintop
- the painterpublic void addSpecificObjectPainter(java.lang.String objectName, ObjectPainter op)
objectName
- the name of the object this painter is used to paintop
- the painterpublic void updateState(State s)
s
- the state to paintpublic State getCurState()
public java.util.List<StaticPainter> getStaticPainters()
public java.util.List<StateRenderLayer.ObjectPainterAndClassNamePair> getObjectClassPainterList()
public java.util.Map<java.lang.String,ObjectPainter> getSpecificObjectPainters()
public void render(java.awt.Graphics2D g2, float width, float height)
render
in interface RenderLayer