public class ObjectGrid3DPortrayal2D extends ObjectGridPortrayal2D
By default this portrayal describes objects as gray ovals (that's what getDefaultPortrayal() returns) and null values as empty regions (that's what getDefaultNullPortrayal() returns). You may wish to override this for your own purposes. The 'location' passed into the DrawInfo2D handed to the SimplePortrayal2D is a MutableInt3D.
ObjectGridPortrayal2D.Message
Modifier and Type | Field and Description |
---|---|
protected MutableInt3D |
locationToPass |
DEFAULT, DONT_USE_BUFFER, USE_BUFFER
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
Constructor and Description |
---|
ObjectGrid3DPortrayal2D() |
Modifier and Type | Method and Description |
---|---|
boolean |
getIgnoresEmpty()
Returns whether null (empty) cells are completely ignored for hit-testing and drawing.
|
java.awt.geom.Point2D.Double |
getLocationPosition(java.lang.Object location,
DrawInfo2D info)
Returns the position on-screen of the provided location in the underlying field.
|
java.lang.Object |
getObjectLocation(java.lang.Object object,
GUIState gui)
Returns the first location in the underlying field of the given object, if such a thing
is reasonable.
|
java.lang.Object |
getPositionLocation(java.awt.geom.Point2D.Double position,
DrawInfo2D info)
Returns the location corresponding with the given position -- and assuming that the
location has a z-value of 0.
|
Double2D |
getScale(DrawInfo2D info)
Returns the width and height, in pixels, of 1.0 x 1.0 units in the underlying field.
|
LocationWrapper |
getWrapper(java.lang.Object object,
Int3D location) |
protected void |
hitOrDraw(java.awt.Graphics2D graphics,
DrawInfo2D info,
Bag putInHere)
Instead of overriding the draw and hitObjects methods, you can optionally override
this method to provide both the draw(...) and hitObjects(...)
functionality in a single method, as it's common that these two methods have nearly
identical code.
|
void |
setField(java.lang.Object field)
Sets the field, and sets the dirtyField flag to true.
|
void |
setIgnoresEmpty(boolean val)
Sets whether null (empty) cells are completely ignored for hit-testing and drawing.
|
getDefaultNullPortrayal, getDefaultPortrayal, getWrapper, setBorder, setBorderColor, setBorderLineFraction, setBorderLineMinMaxWidth, setGridColor, setGridLineFraction, setGridLineMinMaxWidth, setGridLines, setGridMinSpacing, setGridModulus, setSelected
draw, getBuffering, getClipLocation, getObjectPosition, getRelativeObjectPosition, hitObjects, setBuffering, setObjectPosition
getField, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setDirtyField, setImmutableField, setObjectLocation, setPortrayalForAll, setPortrayalForClass, setPortrayalForNonNull, setPortrayalForNull, setPortrayalForObject, setPortrayalForRemainder, setSelected
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInspector, getName, getStatus
protected final MutableInt3D locationToPass
public boolean getIgnoresEmpty()
public void setIgnoresEmpty(boolean val)
public void setField(java.lang.Object field)
FieldPortrayal
setField
in class ObjectGridPortrayal2D
public Double2D getScale(DrawInfo2D info)
FieldPortrayal2D
getScale
in class ObjectGridPortrayal2D
public java.lang.Object getPositionLocation(java.awt.geom.Point2D.Double position, DrawInfo2D info)
getPositionLocation
in class ObjectGridPortrayal2D
public java.lang.Object getObjectLocation(java.lang.Object object, GUIState gui)
FieldPortrayal
getObjectLocation
in class ObjectGridPortrayal2D
public java.awt.geom.Point2D.Double getLocationPosition(java.lang.Object location, DrawInfo2D info)
FieldPortrayal2D
getLocationPosition
in class ObjectGridPortrayal2D
protected void hitOrDraw(java.awt.Graphics2D graphics, DrawInfo2D info, Bag putInHere)
FieldPortrayal2D
hitOrDraw
in class ObjectGridPortrayal2D
public LocationWrapper getWrapper(java.lang.Object object, Int3D location)