public class SparseGridPortrayal2D extends FieldPortrayal2D
Modifier and Type | Field and Description |
---|---|
DrawPolicy |
policy |
DEFAULT, DONT_USE_BUFFER, USE_BUFFER
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
Constructor and Description |
---|
SparseGridPortrayal2D() |
SparseGridPortrayal2D(DrawPolicy policy)
Deprecated.
Use setDrawPolicy.
|
Modifier and Type | Method and Description |
---|---|
Portrayal |
getDefaultPortrayal()
Should return a portrayal which can portray any object regardless of
whether it's valid or not
|
DrawPolicy |
getDrawPolicy() |
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, in the parlance of the underlying Field, of the given position.
|
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,
GUIState gui) |
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 |
setBorder(boolean on)
Turns border lines on or off.
|
void |
setBorderColor(java.awt.Color val)
Sets the border color.
|
void |
setBorderLineFraction(double val)
Sets the border line fraction.
|
void |
setBorderLineMinMaxWidth(double min,
double max)
Sets the minimum and maximum width of a border line in pixels.
|
void |
setDrawPolicy(DrawPolicy policy) |
void |
setField(java.lang.Object field)
Sets the field, and sets the dirtyField flag to true.
|
void |
setGridColor(java.awt.Color val)
Sets the grid color.
|
void |
setGridLineFraction(double val)
Sets the grid line fraction.
|
void |
setGridLineMinMaxWidth(double min,
double max)
Sets the minimum and maximum width of a grid line in pixels.
|
void |
setGridLines(boolean on)
Turns grid lines on or off.
|
void |
setGridMinSpacing(double val)
Sets the grid min spacing.
|
void |
setGridModulus(int val)
Sets the grid modulus.
|
void |
setObjectLocation(java.lang.Object object,
java.lang.Object location,
GUIState gui)
Sets location in the underlying field of the given object, if such a thing
is reasonable.
|
boolean |
setSelected(LocationWrapper wrapper,
boolean selected)
Selects or deselects all of the provided objects.
|
draw, getBuffering, getClipLocation, getObjectPosition, getRelativeObjectPosition, hitObjects, setBuffering, setObjectPosition
getDefaultNullPortrayal, getField, getInspector, getName, getPortrayalForAll, getPortrayalForNonNull, getPortrayalForNull, getPortrayalForObject, getPortrayalForRemainder, getStatus, isDirtyField, isImmutableField, reset, setDirtyField, setImmutableField, setPortrayalForAll, setPortrayalForClass, setPortrayalForNonNull, setPortrayalForNull, setPortrayalForObject, setPortrayalForRemainder, setSelected
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInspector, getName, getStatus
public DrawPolicy policy
public SparseGridPortrayal2D()
public SparseGridPortrayal2D(DrawPolicy policy)
public void setDrawPolicy(DrawPolicy policy)
public DrawPolicy getDrawPolicy()
public Portrayal getDefaultPortrayal()
FieldPortrayal
getDefaultPortrayal
in class FieldPortrayal2D
public void setField(java.lang.Object field)
FieldPortrayal
setField
in class FieldPortrayal
public Double2D getScale(DrawInfo2D info)
FieldPortrayal2D
getScale
in class FieldPortrayal2D
public java.lang.Object getPositionLocation(java.awt.geom.Point2D.Double position, DrawInfo2D info)
FieldPortrayal2D
getPositionLocation
in class FieldPortrayal2D
public void setObjectLocation(java.lang.Object object, java.lang.Object location, GUIState gui)
FieldPortrayal
setObjectLocation
in class FieldPortrayal
public java.lang.Object getObjectLocation(java.lang.Object object, GUIState gui)
FieldPortrayal
getObjectLocation
in class FieldPortrayal
public java.awt.geom.Point2D.Double getLocationPosition(java.lang.Object location, DrawInfo2D info)
FieldPortrayal2D
getLocationPosition
in class FieldPortrayal2D
protected void hitOrDraw(java.awt.Graphics2D graphics, DrawInfo2D info, Bag putInHere)
FieldPortrayal2D
hitOrDraw
in class FieldPortrayal2D
public LocationWrapper getWrapper(java.lang.Object object, GUIState gui)
public boolean setSelected(LocationWrapper wrapper, boolean selected)
FieldPortrayal
setSelected
in interface Portrayal
setSelected
in class FieldPortrayal
public void setGridLines(boolean on)
public void setGridColor(java.awt.Color val)
public void setGridModulus(int val)
public void setGridMinSpacing(double val)
public void setGridLineFraction(double val)
public void setGridLineMinMaxWidth(double min, double max)
public void setBorder(boolean on)
public void setBorderColor(java.awt.Color val)
public void setBorderLineFraction(double val)
public void setBorderLineMinMaxWidth(double min, double max)