sim.portrayal
Interface Portrayal

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
Portrayal2D, Portrayal3D
All Known Implementing Classes:
FieldPortrayal2D, FieldPortrayal3D, QuadPortrayal, SimplePortrayal2D, SimplePortrayal3D

public interface Portrayal
extends java.io.Serializable

A common interface for portrayal classes.


Method Summary
 Inspector getInspector(LocationWrapper wrapper, GUIState state)
          Provide an inspector for an object.
 java.lang.String getName(LocationWrapper wrapper)
          Returns a name for the given object that is useful for a human to distinguish it from other objects.
 boolean setSelected(LocationWrapper wrapper, boolean selected)
          Change the portrayal state to reflect the fact that you've been selected or not selected.
 

Method Detail

getInspector

public Inspector getInspector(LocationWrapper wrapper,
                              GUIState state)
Provide an inspector for an object.


getName

public java.lang.String getName(LocationWrapper wrapper)
Returns a name for the given object that is useful for a human to distinguish it from other objects. A simple default would be just to return "" + object.


setSelected

public boolean setSelected(LocationWrapper wrapper,
                           boolean selected)
Change the portrayal state to reflect the fact that you've been selected or not selected. Always return true, except if you've received a setSelected(true) and in fact do not wish to be selectable, in which case return false in that sole situation.