|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.portrayal.FieldPortrayal
sim.portrayal.FieldPortrayal2D
sim.portrayal.grid.ObjectGridPortrayal2D
sim.portrayal.grid.FastObjectGridPortrayal2D
A "Fast" version of ObjectGridPortrayal2D, which draws objects as rectangles of specified colors, rather than using the provided SimplePortrayal2Ds. FastObjectGridPortrayal2D contains an underlying FastValueGridPortrayal2D. When the field needs to be drawn, it is first mapped into a DoubleGrid2D, using the mapping function doubleValue(...) (which you can override to provide specialized behavior). This DoubleGrid2D is then handed to the underlying FastValueGridPortrayal2D to draw with the provided ColorMap.
Nested Class Summary |
Nested classes inherited from class sim.portrayal.FieldPortrayal |
FieldPortrayal.CustomInspector |
Field Summary |
Fields inherited from class sim.portrayal.FieldPortrayal2D |
DEFAULT, DONT_USE_BUFFER, USE_BUFFER |
Fields inherited from class sim.portrayal.FieldPortrayal |
classPortrayals, dirtyField, field, immutableField, portrayalForAll, portrayalForNull, portrayalForRemainder, portrayals |
Constructor Summary | |
FastObjectGridPortrayal2D()
Equivalent to FastObjectGridPortrayal2D(false); |
|
FastObjectGridPortrayal2D(boolean immutableField)
If immutableField is true, we presume that the grid doesn't change. |
Method Summary | |
double |
doubleValue(java.lang.Object obj)
Override this as necessary to map the provided object into a double value. |
void |
draw(java.lang.Object object,
java.awt.Graphics2D graphics,
DrawInfo2D info)
Draws the field with its origin at [info.draw.x,info.draw.y], relative to the scaled coordinate system defined by [info.draw.width,info.draw.height]. |
int |
getBuffering()
Returns whether or not the FieldPortrayal2D will use a buffering "trick" to draw quickly. |
ColorMap |
getMap()
|
void |
reset()
Resets the underlying FastValueGridPortrayal2D. |
void |
setBuffering(int val)
Sets whether or not the FieldPortrayal2D will use a buffering "trick" to draw quickly. |
void |
setField(java.lang.Object field)
Sets the field. |
void |
setImmutableField(boolean immutableField)
Specifies that the underlying field is (or is not) to be assumed unchanging -- thus there's no reason to update once we're created. |
void |
setMap(ColorMap m)
|
Methods inherited from class sim.portrayal.grid.ObjectGridPortrayal2D |
getDefaultPortrayal, getWrapper, hitOrDraw |
Methods inherited from class sim.portrayal.FieldPortrayal2D |
getSelectedObjects, hitObjects, move, setSelected |
Methods inherited from class sim.portrayal.FieldPortrayal |
getDefaultNullPortrayal, getField, getInspector, getName, getPortrayalForAll, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, isImmutableField, setPortrayalForAll, setPortrayalForClass, setPortrayalForNull, setPortrayalForObject, setPortrayalForRemainder, setSelected |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface sim.portrayal.Portrayal |
getInspector, getName, setSelected |
Constructor Detail |
public FastObjectGridPortrayal2D(boolean immutableField)
public FastObjectGridPortrayal2D()
Method Detail |
public void setImmutableField(boolean immutableField)
FieldPortrayal
setImmutableField
in class FieldPortrayal
public void setField(java.lang.Object field)
FieldPortrayal
setField
in class ObjectGridPortrayal2D
public double doubleValue(java.lang.Object obj)
The default form of this function is:
public void reset()
public ColorMap getMap()
public void setMap(ColorMap m)
public int getBuffering()
FieldPortrayal2D
getBuffering
in class FieldPortrayal2D
public void setBuffering(int val)
FieldPortrayal2D
setBuffering
in class FieldPortrayal2D
public void draw(java.lang.Object object, java.awt.Graphics2D graphics, DrawInfo2D info)
FieldPortrayal2D
draw
in interface Portrayal2D
draw
in class FieldPortrayal2D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |