public class TransformedPortrayal2D extends SimplePortrayal2D
Modifier and Type | Field and Description |
---|---|
SimplePortrayal2D |
child |
java.awt.geom.AffineTransform |
transform |
TYPE_HIT_OBJECT, TYPE_SELECTED_OBJECT
Constructor and Description |
---|
TransformedPortrayal2D(SimplePortrayal2D child,
java.awt.geom.AffineTransform transform) |
Modifier and Type | Method and Description |
---|---|
void |
draw(java.lang.Object object,
java.awt.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.
|
SimplePortrayal2D |
getChild(java.lang.Object object) |
Inspector |
getInspector(LocationWrapper wrapper,
GUIState state)
Provide an inspector for an object.
|
java.lang.String |
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.
|
boolean |
hitObject(java.lang.Object object,
DrawInfo2D range)
Return true if the given object, when drawn, intersects with a provided rectangle, for
hit testing purposes.
|
boolean |
setSelected(LocationWrapper wrapper,
boolean selected)
Change the portrayal state to reflect the fact that you've
been selected or not selected.
|
getStatus, handleMouseEvent
public SimplePortrayal2D child
public java.awt.geom.AffineTransform transform
public TransformedPortrayal2D(SimplePortrayal2D child, java.awt.geom.AffineTransform transform)
public SimplePortrayal2D getChild(java.lang.Object object)
public void draw(java.lang.Object object, java.awt.Graphics2D graphics, DrawInfo2D info)
Portrayal2D
draw
in interface Portrayal2D
draw
in class SimplePortrayal2D
public boolean hitObject(java.lang.Object object, DrawInfo2D range)
SimplePortrayal2D
hitObject
in class SimplePortrayal2D
public boolean setSelected(LocationWrapper wrapper, boolean selected)
Portrayal
setSelected
in interface Portrayal
setSelected
in class SimplePortrayal2D
public Inspector getInspector(LocationWrapper wrapper, GUIState state)
Portrayal
getInspector
in interface Portrayal
getInspector
in class SimplePortrayal2D
public java.lang.String getName(LocationWrapper wrapper)
Portrayal
getName
in interface Portrayal
getName
in class SimplePortrayal2D