SimJava
v2.0

eduni.simanim
Class Anim_applet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--eduni.simanim.Anim_applet
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable, Sim_reporter, Traceable

public abstract class Anim_applet
extends java.applet.Applet
implements java.lang.Runnable, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, Traceable, Sim_reporter

The superclass for all animated simulations.

Users that want to add animation to their simulations need to subclass Anim_applet. Following this they should override some or all of the following methods:

More information of how to use these methods and how to add animation to simulations can be found at the SimJava Tutorial.

See Also:
Sim_system, Serialized Form

Inner classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
protected  eduni.simanim.Sim_anim trace_out
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface eduni.simdiag.Traceable
DISPLAY, LAYOUT, PAUSE, RUN, STOP, TRACE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Anim_applet()
           
 
Method Summary
 void anim_completed()
          Define code to be execute upon simulation completion.
 void anim_init()
          Set up additional GUI components.
abstract  void anim_layout()
          Setup the simulation.
 void anim_output()
          Specify the level of reporting the animation should provide.
 void generate_messages(boolean do_messages)
          Generate the simulation's messages.
 void generate_report(boolean do_report)
          Generate the simulation's report.
 void sim_setup()
          Specify simulation conditions, an output analysis method and other simulation parameters.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface java.awt.event.AdjustmentListener
adjustmentValueChanged
 
Methods inherited from interface eduni.simjava.Sim_reporter
append_report, close_report, setup_report
 

Field Detail

trace_out

protected eduni.simanim.Sim_anim trace_out
Constructor Detail

Anim_applet

public Anim_applet()
Method Detail

anim_layout

public abstract void anim_layout()
Setup the simulation. This method must be overriden in the subclass and completed to add the simulation's entities and to link their ports.

anim_init

public void anim_init()
Set up additional GUI components. This method may be overriden to specify additional GUI components in the simulation's applet. This method is called once the applet starts up.

anim_completed

public void anim_completed()
Define code to be execute upon simulation completion. This method is called when the simulation completes.

sim_setup

public void sim_setup()
Specify simulation conditions, an output analysis method and other simulation parameters. If any of these are used in the simulation this method must be overriden to make the relevant Sim_system calls.

anim_output

public void anim_output()
Specify the level of reporting the animation should provide. This method may be overriden to specify that the simulation's report and messages should be displayed on the applet.

The only code that should be included here are a call to generate_report and a call to generate_messages.

The default, if this method is not overriden, is to add only the simulation's messages.


generate_report

public void generate_report(boolean do_report)
Generate the simulation's report. This method should be called within the overriden anim_output method.
Parameters:
do_report - true if the report should be generated, false otherwise.

generate_messages

public void generate_messages(boolean do_messages)
Generate the simulation's messages. This method should be called within the overriden anim_output method.
Parameters:
do_messages - true if the messages should be generated, false otherwise.

SimJava
v2.0

The University of Edinburgh, 2002