T
- The subclass of StandardEntity that this layer knows how to render.public abstract class StandardEntityViewLayer<T extends StandardEntity> extends StandardViewLayer
Modifier and Type | Field and Description |
---|---|
protected java.util.List<T> |
entities
The entities this layer should render.
|
VISIBILITY_SUFFIX, world
component
Modifier | Constructor and Description |
---|---|
protected |
StandardEntityViewLayer(java.lang.Class<T> clazz)
Construct a new StandardViewLayer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
postView()
Perform any post-processing required after
view(java.lang.Object...) has been called. |
protected void |
preView()
Perform any pre-processing required before
view(java.lang.Object...) has been called. |
java.util.Collection<RenderedObject> |
render(java.awt.Graphics2D g,
ScreenTransform transform,
int width,
int height)
Render this layer and return a collection of RenderedObjects.
|
abstract java.awt.Shape |
render(T entity,
java.awt.Graphics2D graphics,
ScreenTransform transform)
Render an entity and return the shape.
|
java.awt.geom.Rectangle2D |
view(java.lang.Object... objects)
Set the list of objects this layer should view.
|
protected void |
viewObject(java.lang.Object o)
Callback function for processing a concrete viewable object.
|
initialise
getPopupMenuItems, isVisible, processView, setLayerViewComponent, setVisible
protected java.util.List<T extends StandardEntity> entities
protected StandardEntityViewLayer(java.lang.Class<T> clazz)
clazz
- The class of entity that this layer can render.public java.awt.geom.Rectangle2D view(java.lang.Object... objects)
ViewLayer
ViewLayer.render(Graphics2D, ScreenTransform, int, int)
is called.view
in interface ViewLayer
view
in class StandardViewLayer
objects
- The objects to view.protected void viewObject(java.lang.Object o)
AbstractViewLayer
viewObject
in class StandardViewLayer
o
- The object to process.public java.util.Collection<RenderedObject> render(java.awt.Graphics2D g, ScreenTransform transform, int width, int height)
ViewLayer
g
- The graphics to render to.transform
- The ScreenTransform that will convert world coordinates to screen coordinates.width
- The width of the screen in pixels.height
- The height of the screen in pixels.public abstract java.awt.Shape render(T entity, java.awt.Graphics2D graphics, ScreenTransform transform)
entity
- The entity to render.graphics
- The graphics to render on.transform
- A helpful coordinate transformer.protected void preView()
view(java.lang.Object...)
has been called.protected void postView()
view(java.lang.Object...)
has been called.