ec.teambots
Class ECSimulationCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended byec.teambots.ECSimulationCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class ECSimulationCanvas
extends java.awt.Canvas
implements java.lang.Runnable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int MAX_SIM_OBJS
          The maximum number of objects in a simulation.
 long seed
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ECSimulationCanvas(java.awt.Frame p, int w, int h, java.lang.String dscfile)
           
ECSimulationCanvas(java.awt.Frame p, int w, int h, java.lang.String dscfile, boolean preserveSize)
          Set up the SimulationCanvas.
 
Method Summary
 boolean descriptionLoaded()
          Provide info about whether we have successufully loaded the file.
 java.awt.Dimension getPreferredSize()
           
 EDU.gatech.cc.is.abstractrobot.Simple getRobot(int index)
          Returns a robot atached to a control system (for logging and evaluation purposes)
 java.lang.Thread getThread()
          Get the thread (for joining)
 void load(java.lang.String df)
          Handle a load request.
 void pause()
          Handle a pause event.
 void quit()
          Handle a quit event.
 void reset()
          Handle a reset event.
 void reSizeWindow()
           
 void run()
          Run the simulation.
 void setControlSystem(int index, EDU.gatech.cc.is.abstractrobot.ControlSystemS controlSystem)
          Modifies a control system
 void setDrawIcons(boolean v)
          Handle setDrawIcons
 void setDrawIDs(boolean v)
          Handle setDrawIDs
 void setDrawObjectState(boolean v)
          Handle setDrawObjectState
 void setDrawRobotState(boolean v)
          Handle setDrawRobotState
 void setDrawTrails(boolean v)
          Handle setDrawTrails
 void setGraphics(boolean v)
          Handle setGraphics
 void setSize(int w, int h)
          Resize the SimulationCanvas.
 void showRuntimeStats()
          Handle a Runtime Stats event
 void start()
          Handle a start/resume event.
 void update(java.awt.Graphics g)
          Handle a drawing request.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

seed

public long seed

MAX_SIM_OBJS

public static final int MAX_SIM_OBJS
The maximum number of objects in a simulation.

See Also:
Constant Field Values
Constructor Detail

ECSimulationCanvas

public ECSimulationCanvas(java.awt.Frame p,
                          int w,
                          int h,
                          java.lang.String dscfile)

ECSimulationCanvas

public ECSimulationCanvas(java.awt.Frame p,
                          int w,
                          int h,
                          java.lang.String dscfile,
                          boolean preserveSize)
Set up the SimulationCanvas.

Method Detail

setControlSystem

public void setControlSystem(int index,
                             EDU.gatech.cc.is.abstractrobot.ControlSystemS controlSystem)
Modifies a control system


getRobot

public EDU.gatech.cc.is.abstractrobot.Simple getRobot(int index)
Returns a robot atached to a control system (for logging and evaluation purposes)


getThread

public java.lang.Thread getThread()
Get the thread (for joining)


descriptionLoaded

public boolean descriptionLoaded()
Provide info about whether we have successufully loaded the file.

Returns:
true if a file is loaded, false otherwise.

run

public void run()
Run the simulation.

Specified by:
run in interface java.lang.Runnable

update

public void update(java.awt.Graphics g)
Handle a drawing request.


setSize

public void setSize(int w,
                    int h)
Resize the SimulationCanvas.


getPreferredSize

public java.awt.Dimension getPreferredSize()

reSizeWindow

public void reSizeWindow()

quit

public void quit()
Handle a quit event.


reset

public void reset()
Handle a reset event.


start

public void start()
Handle a start/resume event.


showRuntimeStats

public void showRuntimeStats()
Handle a Runtime Stats event


pause

public void pause()
Handle a pause event.


setDrawIDs

public void setDrawIDs(boolean v)
Handle setDrawIDs


setDrawIcons

public void setDrawIcons(boolean v)
Handle setDrawIcons


setGraphics

public void setGraphics(boolean v)
Handle setGraphics


setDrawRobotState

public void setDrawRobotState(boolean v)
Handle setDrawRobotState


setDrawObjectState

public void setDrawObjectState(boolean v)
Handle setDrawObjectState


setDrawTrails

public void setDrawTrails(boolean v)
Handle setDrawTrails


load

public void load(java.lang.String df)
Handle a load request.