ArtificialTermites
Class WorldApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--ArtificialTermites.WorldApplet

public final class WorldApplet
extends java.applet.Applet
implements java.lang.Runnable

World is the main class of the simulation for artificial life for anthill. Seconde line of documentation for World.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.lang.Thread animationThread
           
private static java.awt.Color backgroundColor
           
private  int block
           
private  int blockSize
           
private  int cheese
           
(package private) static java.lang.String country
           
(package private)  java.util.Locale currentLocale
           
(package private) static int defaultBlockSize
           
private  World engineWorld
           
 java.awt.Image forbidden
           
private  java.awt.Graphics graphicsWorld
           
 java.awt.Image grass
           
 java.awt.Image grassAnt
           
 java.awt.Image grassAntCheese
           
 java.awt.Image grassAntWheat
           
 java.awt.Image grassAntWood
           
 java.awt.Image grassCheese
           
 java.awt.Image grassWheat
           
 java.awt.Image grassWood
           
private  int height
           
(package private) static int heightGraphicElemFactor
           
private  java.awt.MediaTracker imageTracker
           
(package private) static java.lang.String language
           
(package private) static java.util.ResourceBundle messages
           
private  java.awt.Image offScreenImage
           
private  int screenHeight
           
private  int screenWidth
           
private  int termites
           
private  int wheat
           
private  int width
           
(package private) static int widthGraphicElemFactor
           
private  int wood
           
private static java.awt.Color woodColor
           
private  int worldHeight
           
private  int worldWidth
           
 
Fields inherited from class java.applet.Applet
serialVersionUID, stub
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
WorldApplet()
           
 
Method Summary
 void finalize()
           
 java.lang.String getAppletInfo()
           
 java.lang.String[][] getParameterInfo()
           
 void init()
           
 boolean mouseDown(java.awt.Event e, int x, int y)
           
 void paint()
           
 void paint(java.awt.Graphics g)
           
private  void paintBGAndUnanimated()
           
(package private)  void paintBlock(int x, int y)
           
(package private)  void paintBlock(int x, int y, java.awt.Color c)
           
(package private)  void paintBlock(int x, int y, java.awt.Image i)
           
private  void paintTermites()
           
 void run()
           
 void start()
           
 void start(int iWidth, int iHeight, int iWood, int iWheat, int iCheese, int iTermites)
           
 void stop()
           
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printOneComponent, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

engineWorld

private World engineWorld

worldWidth

private int worldWidth

worldHeight

private int worldHeight

screenWidth

private int screenWidth

screenHeight

private int screenHeight

blockSize

private int blockSize

animationThread

private java.lang.Thread animationThread

graphicsWorld

private java.awt.Graphics graphicsWorld

forbidden

public java.awt.Image forbidden

grass

public java.awt.Image grass

grassWood

public java.awt.Image grassWood

grassAnt

public java.awt.Image grassAnt

grassCheese

public java.awt.Image grassCheese

grassWheat

public java.awt.Image grassWheat

grassAntWood

public java.awt.Image grassAntWood

grassAntWheat

public java.awt.Image grassAntWheat

grassAntCheese

public java.awt.Image grassAntCheese

imageTracker

private java.awt.MediaTracker imageTracker

offScreenImage

private java.awt.Image offScreenImage

backgroundColor

private static java.awt.Color backgroundColor

woodColor

private static java.awt.Color woodColor

widthGraphicElemFactor

static int widthGraphicElemFactor

heightGraphicElemFactor

static int heightGraphicElemFactor

defaultBlockSize

static int defaultBlockSize

language

static java.lang.String language

country

static java.lang.String country

currentLocale

java.util.Locale currentLocale

messages

static java.util.ResourceBundle messages

width

private int width

height

private int height

block

private int block

wood

private int wood

wheat

private int wheat

cheese

private int cheese

termites

private int termites
Constructor Detail

WorldApplet

public WorldApplet()
Method Detail

init

public void init()
Overrides:
init in class java.applet.Applet

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

start

public void start(int iWidth,
                  int iHeight,
                  int iWood,
                  int iWheat,
                  int iCheese,
                  int iTermites)

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

run

public void run()
Specified by:
run in interface java.lang.Runnable

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

paint

public void paint()

mouseDown

public boolean mouseDown(java.awt.Event e,
                         int x,
                         int y)
Overrides:
mouseDown in class java.awt.Component

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

paintBGAndUnanimated

private void paintBGAndUnanimated()

paintTermites

private void paintTermites()

paintBlock

void paintBlock(int x,
                int y,
                java.awt.Color c)

paintBlock

void paintBlock(int x,
                int y,
                java.awt.Image i)

paintBlock

void paintBlock(int x,
                int y)