|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sim.portrayal.FieldPortrayal sim.portrayal.FieldPortrayal2D sim.portrayal.geo.GeomVectorFieldPortrayal
public class GeomVectorFieldPortrayal
Portrayal for MasonGeometry objects. The portrayal handles drawing and hit-testing (for inspectors).
GeomVectorFieldPortrayal overrides getPortrayalForObject to do a different thing than normal FieldPortrayals. Specifically:
Note that nowhere do we return portrayals for null objects: there is no PortrayalForNull and no DefaultNullPortrayal. Indeed, the method setPortrayalForNull will throw an error -- you are not permitted to call it.
Field Summary |
---|
Fields inherited from class sim.portrayal.FieldPortrayal2D |
---|
DEFAULT, DONT_USE_BUFFER, USE_BUFFER |
Fields inherited from class sim.portrayal.FieldPortrayal |
---|
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals |
Constructor Summary | |
---|---|
GeomVectorFieldPortrayal()
Default constructor |
|
GeomVectorFieldPortrayal(boolean immutableField)
Constructor which sets the field's immutable flag |
Method Summary | |
---|---|
sim.portrayal.Portrayal |
getDefaultPortrayal()
Return the underlying portrayal |
sim.portrayal.Portrayal |
getPortrayalForObject(java.lang.Object obj)
Returns the appropriate Portrayal. |
protected void |
hitOrDraw(java.awt.Graphics2D graphics,
sim.portrayal.DrawInfo2D info,
sim.util.Bag putInHere)
Handles hit-testing and drawing of the underlying geometry objects. |
void |
setField(java.lang.Object field)
Sets the underlying field, after ensuring its a GeomVectorField. |
void |
setPortrayalForNull(sim.portrayal.Portrayal portrayal)
Throws an exception. |
boolean |
setSelected(sim.portrayal.LocationWrapper wrapper,
boolean selected)
|
Methods inherited from class sim.portrayal.FieldPortrayal2D |
---|
draw, getBuffering, getClipLocation, getLocationPosition, getObjectLocation, getObjectPosition, getPositionLocation, getRelativeObjectPosition, getScale, hitObjects, setBuffering, setObjectPosition |
Methods inherited from class sim.portrayal.FieldPortrayal |
---|
getDefaultNullPortrayal, getField, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setDirtyField, setImmutableField, setPortrayalForAll, setPortrayalForClass, setPortrayalForNonNull, 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, getStatus |
Constructor Detail |
---|
public GeomVectorFieldPortrayal()
public GeomVectorFieldPortrayal(boolean immutableField)
Method Detail |
---|
public void setPortrayalForNull(sim.portrayal.Portrayal portrayal)
setPortrayalForNull
in class sim.portrayal.FieldPortrayal
public sim.portrayal.Portrayal getPortrayalForObject(java.lang.Object obj)
getPortrayalForObject
in class sim.portrayal.FieldPortrayal
public sim.portrayal.Portrayal getDefaultPortrayal()
getDefaultPortrayal
in class sim.portrayal.FieldPortrayal2D
protected void hitOrDraw(java.awt.Graphics2D graphics, sim.portrayal.DrawInfo2D info, sim.util.Bag putInHere)
hitOrDraw
in class sim.portrayal.FieldPortrayal2D
public void setField(java.lang.Object field)
setField
in class sim.portrayal.FieldPortrayal
public boolean setSelected(sim.portrayal.LocationWrapper wrapper, boolean selected)
setSelected
in interface sim.portrayal.Portrayal
setSelected
in class sim.portrayal.FieldPortrayal
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |