|
SimJava 2.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectComponent
Container
Panel
Applet
Anim_applet
public abstract class Anim_applet
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:
anim_layout
: This method must be overriden to set up the entities and
link their ports. Before setting up the entities, the sample generators' seed sequences could be modified.
anim_init
: This method may be overriden to add GUI components to the
simulation's animation. The way to do this would be to prepare the components and then add them to the
applet. The applet uses a BorderLayout
. The user in anim_init
may add to
"North", "East" and "West" (for example this.add("North", anOptionsPanel)
).
anim_completed
: This method may be overriden to add code that will be executed once the
simulation completes.
anim_output
: This method may be overriden to control the reporting information of the
animation. Since version 1.3, the simulation's report and simulation messages may be included in animated
simulations.
sim_setup
: This method may be overriden to add simulation conditions and set simulation
parameters. If a transient or termination condition is being used and if an output analysis method is selected
this method must be overriden to call these methods on Sim_system
.
More information of how to use these methods and how to add animation to simulations can be found at the SimJava Tutorial.
Sim_system
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class Applet |
---|
Applet.AccessibleApplet |
Nested classes/interfaces inherited from class Panel |
---|
Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
(package private) ScrollPane |
animScroll
|
(package private) boolean |
do_messages
|
(package private) boolean |
do_report
|
(package private) Button |
layoutBut
|
(package private) TextArea |
messagesArea
|
(package private) Button |
pauseBut
|
(package private) boolean |
paused
|
(package private) StringBuffer |
report
|
(package private) TextArea |
reportArea
|
(package private) Button |
runBut
|
(package private) Thread |
simThread
|
(package private) int |
speed
|
(package private) Label |
speedLabel
|
(package private) Scrollbar |
speedScroll
|
(package private) Button |
stopBut
|
(package private) boolean |
stopped
|
protected Sim_anim |
trace_out
|
Fields inherited from class Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface Traceable |
---|
DISPLAY, LAYOUT, PAUSE, RUN, STOP, TRACE |
Fields inherited from interface ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Anim_applet()
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Internal action handler. |
void |
add_message(String msg)
Internal method used to generate a message. |
void |
adjustmentValueChanged(AdjustmentEvent e)
Internal scrollbar event handler. |
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 |
append_report(String line)
Internal method used to add to the simulation's report. |
void |
close_report()
Internal method used to close the simulation's report. |
(package private) void |
finished()
|
void |
generate_messages(boolean do_messages)
Generate the simulation's messages. |
void |
generate_report(boolean do_report)
Generate the simulation's report. |
(package private) boolean |
get_paused()
|
(package private) int |
get_speed()
|
(package private) boolean |
get_stopped()
|
void |
init()
Internal method used to set up the default GUI components and the entities. |
void |
pause()
Internal method used to pause the animation. |
void |
run()
Internal method used to run the animation. |
void |
setup_report()
Internal method used to setup the simulation's report. |
void |
sim_setup()
Specify simulation conditions, an output analysis method and other simulation parameters. |
Methods inherited from class Applet |
---|
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
Methods inherited from class Panel |
---|
addNotify |
Methods inherited from class Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Thread simThread
protected Sim_anim trace_out
Button layoutBut
Button runBut
Button stopBut
Button pauseBut
Label speedLabel
Scrollbar speedScroll
ScrollPane animScroll
TextArea reportArea
TextArea messagesArea
int speed
boolean paused
boolean stopped
boolean do_report
boolean do_messages
StringBuffer report
Constructor Detail |
---|
public Anim_applet()
Method Detail |
---|
public abstract void anim_layout()
public void anim_init()
public void anim_completed()
public final void init()
init
in class Applet
public void sim_setup()
Sim_system
calls.
int get_speed()
boolean get_paused()
boolean get_stopped()
public void pause()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- The ActionEvent
public void adjustmentValueChanged(AdjustmentEvent e)
adjustmentValueChanged
in interface AdjustmentListener
e
- The AdjustmentEvent
public final void run()
run
in interface Runnable
public void setup_report()
setup_report
in interface Sim_reporter
public void close_report()
close_report
in interface Sim_reporter
public void append_report(String line)
append_report
in interface Sim_reporter
line
- The line of information to append to the reportpublic void anim_output()
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.
public void generate_report(boolean do_report)
anim_output
method.
do_report
- true
if the report should be generated, false
otherwise.public void generate_messages(boolean do_messages)
anim_output
method.
do_messages
- true
if the messages should be generated, false
otherwise.void finished()
public void add_message(String msg)
|
SimJava 2.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |