Package sim.portrayal.grid
Class FastHexaValueGridPortrayal2D
java.lang.Object
sim.portrayal.FieldPortrayal
sim.portrayal.FieldPortrayal2D
sim.portrayal.grid.ValueGridPortrayal2D
sim.portrayal.grid.HexaValueGridPortrayal2D
sim.portrayal.grid.FastHexaValueGridPortrayal2D
- All Implemented Interfaces:
Portrayal
,Portrayal2D
-
Field Summary
Fields inherited from class sim.portrayal.grid.ValueGridPortrayal2D
locationToPass
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
ConstructorDescriptionFastHexaValueGridPortrayal2D
(boolean immutableField) If immutableField is true, we presume that the grid doesn't change.FastHexaValueGridPortrayal2D
(String valueName) FastHexaValueGridPortrayal2D
(String valueName, boolean immutableField) If immutableField is true, we presume that the grid doesn't change. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Object object, 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].Methods inherited from class sim.portrayal.grid.HexaValueGridPortrayal2D
getLocationPosition, getPositionLocation, getScale, hitOrDraw, setBorder, setGridLines
Methods inherited from class sim.portrayal.grid.ValueGridPortrayal2D
getDefaultPortrayal, getMap, getValueName, getWrapper, newValue, setBorderColor, setBorderLineFraction, setBorderLineMinMaxWidth, setField, setGridColor, setGridLineFraction, setGridLineMinMaxWidth, setGridMinSpacing, setGridModulus, setMap, setValueName
Methods inherited from class sim.portrayal.FieldPortrayal2D
getBuffering, getClipLocation, getObjectPosition, getRelativeObjectPosition, hitObjects, setBuffering, setObjectPosition
Methods inherited from class sim.portrayal.FieldPortrayal
getAlternatePortrayalOrdering, getDefaultNullPortrayal, getField, getInspector, getName, getObjectLocation, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setAlternatePortrayalOrdering, setDirtyField, setImmutableField, setObjectLocation, setPortrayalForAll, setPortrayalForClass, setPortrayalForNonNull, setPortrayalForNull, setPortrayalForObject, setPortrayalForRemainder, setSelected, 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, setSelected
-
Constructor Details
-
FastHexaValueGridPortrayal2D
If immutableField is true, we presume that the grid doesn't change. This allows us to just re-splat the buffer. -
FastHexaValueGridPortrayal2D
-
FastHexaValueGridPortrayal2D
public FastHexaValueGridPortrayal2D(boolean immutableField) If immutableField is true, we presume that the grid doesn't change. This allows us to just re-splat the buffer. -
FastHexaValueGridPortrayal2D
public FastHexaValueGridPortrayal2D()
-
-
Method Details
-
draw
Description copied from class:FieldPortrayal2D
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]. The only parts that need be drawn are those which fall within the [info.clip] rectangle. Since your draw and hitObjects methods are likely to be nearly identical, you can choose instead to override the hitOrDraw method to handle both of them. By default this method simply calls hitOrDraw. FieldPortrayals will receive null for the object; they should just draw their own fields.- Specified by:
draw
in interfacePortrayal2D
- Overrides:
draw
in classFieldPortrayal2D
-