public static class BlocksWorldVisualizer.BlockPainter extends java.lang.Object implements ObjectPainter
Constructor and Description |
---|
BlocksWorldVisualizer.BlockPainter() |
BlocksWorldVisualizer.BlockPainter(int fontSize)
Initializes with a font size for rendering the name of the block object.
|
Modifier and Type | Method and Description |
---|---|
protected java.awt.Color |
getColorForString(java.lang.String colName) |
protected int |
getHeight(State s,
ObjectInstance ob) |
protected java.lang.String |
getStackBottom(State s,
ObjectInstance ob) |
void |
paintObject(java.awt.Graphics2D g2,
State s,
ObjectInstance ob,
float cWidth,
float cHeight)
Paints object instance ob to graphics context g2
|
public BlocksWorldVisualizer.BlockPainter()
public BlocksWorldVisualizer.BlockPainter(int fontSize)
fontSize
- a font size for rendering the name of the block object.public void paintObject(java.awt.Graphics2D g2, State s, ObjectInstance ob, float cWidth, float cHeight)
ObjectPainter
paintObject
in interface ObjectPainter
g2
- graphics context to which the object should be painteds
- the state of the object to be paintedob
- the instantiated object to be paintedcWidth
- width of the canvas sizecHeight
- height of the canvas sizeprotected java.lang.String getStackBottom(State s, ObjectInstance ob)
protected int getHeight(State s, ObjectInstance ob)
protected java.awt.Color getColorForString(java.lang.String colName)