public class ContinuousPortrayal2D extends FieldPortrayal2D
DEFAULT, DONT_USE_BUFFER, USE_BUFFER
classPortrayals, field, immutableField, portrayalForAll, portrayalForNonNull, portrayalForNull, portrayalForRemainder, portrayals
Constructor and Description |
---|
ContinuousPortrayal2D() |
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
|
java.awt.geom.Point2D.Double |
getLocationPosition(java.lang.Object location,
DrawInfo2D fieldPortrayalInfo)
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 fieldPortrayalInfo)
Returns the Location, in the parlance of the underlying Field, of the given position.
|
java.awt.geom.Point2D.Double |
getRelativeObjectPosition(java.lang.Object location,
java.lang.Object otherObjectLocation,
DrawInfo2D otherObjectInfo)
Returns the position on-screen of an object at a given location in the field,
using another object's location and DrawInfo2D to perform the computation.
|
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 obj,
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.
|
boolean |
isDisplayingToroidally()
Returns TRUE if the portrayal is displaying objects multiply (in a toroidal fashion)
if they overlap on the edges of the field.
|
void |
setAxes(boolean on)
Turns axes on or off.
|
void |
setAxesColor(java.awt.Color val)
Sets the axes color.
|
void |
setAxesLineFraction(double val)
Sets the axis line fraction.
|
void |
setAxesLineMinMaxWidth(double min,
double max)
Sets the minimum and maximum width of a border line in pixels.
|
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 |
setDisplayingToroidally(boolean val)
Set this to TRUE to cause the portrayal to display objects multiply (in a toroidal fashion)
if they overlap on the edges of the field.
|
void |
setField(java.lang.Object field)
Sets the field, and sets the dirtyField flag to true.
|
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, 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 void setField(java.lang.Object field)
FieldPortrayal
setField
in class FieldPortrayal
public Portrayal getDefaultPortrayal()
FieldPortrayal
getDefaultPortrayal
in class FieldPortrayal2D
public java.awt.geom.Point2D.Double getRelativeObjectPosition(java.lang.Object location, java.lang.Object otherObjectLocation, DrawInfo2D otherObjectInfo)
FieldPortrayal2D
getRelativeObjectPosition
in class FieldPortrayal2D
public Double2D getScale(DrawInfo2D info)
FieldPortrayal2D
getScale
in class FieldPortrayal2D
public java.lang.Object getPositionLocation(java.awt.geom.Point2D.Double position, DrawInfo2D fieldPortrayalInfo)
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 fieldPortrayalInfo)
FieldPortrayal2D
getLocationPosition
in class FieldPortrayal2D
public void setDisplayingToroidally(boolean val)
public boolean isDisplayingToroidally()
protected void hitOrDraw(java.awt.Graphics2D graphics, DrawInfo2D info, Bag putInHere)
FieldPortrayal2D
hitOrDraw
in class FieldPortrayal2D
public LocationWrapper getWrapper(java.lang.Object obj, GUIState gui)
public boolean setSelected(LocationWrapper wrapper, boolean selected)
FieldPortrayal
setSelected
in interface Portrayal
setSelected
in class FieldPortrayal
public void setAxes(boolean on)
public void setAxesColor(java.awt.Color val)
public void setAxesLineFraction(double val)
public void setAxesLineMinMaxWidth(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)