Package sim.portrayal.simple
Class ValuePortrayal2D
java.lang.Object
sim.portrayal.SimplePortrayal2D
sim.portrayal.simple.AbstractShapePortrayal2D
sim.portrayal.simple.RectanglePortrayal2D
sim.portrayal.simple.ValuePortrayal2D
- All Implemented Interfaces:
Serializable
,Portrayal
,Portrayal2D
The ValuePortrayal2D is the default portrayal for ValueGridPortrayal2Ds.
It requires a parent (the ValueGridPortrayal2D), which it uses to determine
the correct colors for a given object. The objects portrayed must be
instances of MutableDouble, where the value represents the level of the color.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Fields inherited from class sim.portrayal.simple.AbstractShapePortrayal2D
defaultStroke, filled, fillPaint, paint, scale, stroke, strokePaint
Fields inherited from class sim.portrayal.SimplePortrayal2D
TYPE_HIT_OBJECT, TYPE_SELECTED_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Object object, Graphics2D graphics, DrawInfo2D info) Draw a the given object with an origin at (info.draw.x, info.draw.y), and with the coordinate system scaled by so that 1 unit is in the x and y directions are equal to info.draw.width and info.draw.height respectively in pixels.getInspector
(LocationWrapper wrapper, GUIState state) Provide an inspector for an object.getName
(LocationWrapper wrapper) Returns a static, one-line name for the given object that is useful for a human to distinguish it from other objects.getStatus
(LocationWrapper wrapper) Returns a simple, informative one-line description of the current status of the object, which may change at any time to reflect how the object is changing.void
setParent
(ValueGridPortrayal2D parent) Deprecated.does nothing nowMethods inherited from class sim.portrayal.simple.RectanglePortrayal2D
hitObject, setStroke, setStroke
Methods inherited from class sim.portrayal.SimplePortrayal2D
handleMouseEvent, setSelected
-
Constructor Details
-
ValuePortrayal2D
public ValuePortrayal2D() -
ValuePortrayal2D
Deprecated.
-
-
Method Details
-
setParent
Deprecated.does nothing now -
draw
Description copied from interface:Portrayal2D
Draw a the given object with an origin at (info.draw.x, info.draw.y), and with the coordinate system scaled by so that 1 unit is in the x and y directions are equal to info.draw.width and info.draw.height respectively in pixels. The rectangle given by info.clip specifies the only region in which it is necessary to draw. If info.precise is true, try to draw using real-valued high-resolution drawing rather than faster integer drawing. It is possible that object is null. The location of the object in the field may (and may not) be stored in info.location. The form of that location varies depending on the kind of field used.- Specified by:
draw
in interfacePortrayal2D
- Overrides:
draw
in classRectanglePortrayal2D
-
getInspector
Description copied from interface:Portrayal
Provide an inspector for an object.- Specified by:
getInspector
in interfacePortrayal
- Overrides:
getInspector
in classSimplePortrayal2D
-
getStatus
Description copied from interface:Portrayal
Returns a simple, informative one-line description of the current status of the object, which may change at any time to reflect how the object is changing. A simple default would be just to return getName(wrapper).- Specified by:
getStatus
in interfacePortrayal
- Overrides:
getStatus
in classSimplePortrayal2D
-
getName
Description copied from interface:Portrayal
Returns a static, one-line name for the given object that is useful for a human to distinguish it from other objects. A simple default would be just to return "" + object.- Specified by:
getName
in interfacePortrayal
- Overrides:
getName
in classSimplePortrayal2D
-