edu.ou.mlfw.gui
Interface Drawer


public interface Drawer

This interface is intended to be optionally implemented by a Client. If a Client implements Drawer, and a GUI is being displayed for the World instance that Client is working in, then at each gui update, the Drawer will be given an opportunity to draw graphics in the gui, or to register or unregister Shadow2D instances. In the course of the simulator loop, the call will take place after the state has been updated and after each Client's endAction method has been called.


Method Summary
 java.util.Set<Shadow2D> registerShadows()
          If there are any shadows to register at a given timestep, return those shadows on this call.
 java.util.Set<Shadow2D> unregisterShadows()
          If you need to unregister a shadow for any reason, return the shadows to be unregistered in this call.
 void updateGraphics(java.awt.Graphics g)
          Draw freely on the given graphics object.
 

Method Detail

updateGraphics

void updateGraphics(java.awt.Graphics g)
Draw freely on the given graphics object.

Parameters:
g - The graphics object to draw on.

registerShadows

java.util.Set<Shadow2D> registerShadows()
If there are any shadows to register at a given timestep, return those shadows on this call. You should retain a reference to any shadows that need to be managed beyond their initial registration. If you do not have any shadows to register, you may return null.


unregisterShadows

java.util.Set<Shadow2D> unregisterShadows()
If you need to unregister a shadow for any reason, return the shadows to be unregistered in this call. If you do not have any shadows to unregister, you may return null.