|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
org.jscience.architecture.traffic.Controller
org.jscience.architecture.traffic.simulation.SimController
public class SimController
The main controller for the simulation part of the application.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected EditController |
editController
DOCUMENT ME! |
protected SimMenuBar |
menuBar
DOCUMENT ME! |
protected java.awt.Choice |
speedChoice
DOCUMENT ME! |
static int[] |
speedSettings
DOCUMENT ME! |
static java.lang.String[] |
speedTexts
DOCUMENT ME! |
protected StatisticsOverlay |
statsOverlay
DOCUMENT ME! |
| Fields inherited from class org.jscience.architecture.traffic.Controller |
|---|
configDialog, currentFilename, currentSelection, currentTool, helpViewer, mainController, model, settings, statusBar, toolBar, toolPanel, view, viewScroller |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| 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 | |
|---|---|
SimController(SimModel m,
boolean splash)
Creates the main frame. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
appName()
Returns the name of this controller extension. |
protected java.awt.MenuBar |
createMenuBar()
DOCUMENT ME! |
protected TrafficToolBar |
createToolBar()
DOCUMENT ME! |
void |
disableOverlay()
Enables the statistics overlay |
void |
doLoad(java.lang.String filename)
DOCUMENT ME! |
void |
doSave(java.lang.String filename)
DOCUMENT ME! |
void |
doStep()
Makes model do one step |
void |
enableOverlay()
Enables the statistics overlay |
java.lang.String |
getCurrentFilename()
Returns the filename of the currently loaded file |
java.awt.PopupMenu |
getPopupMenuFor(Selectable obj)
Creates a right-click popup-menu for the given object |
SimModel |
getSimModel()
Returns the current SimModel |
void |
load(XMLElement myElement,
XMLLoader loader)
Load this XMLSerializable |
void |
nextSeries()
DOCUMENT ME! |
void |
openEditor()
Opens the editor |
void |
pause()
Paues the simulation |
void |
runSeries()
Starts a series of 10 simulations |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setCycleCounterEnabled(boolean b)
Enables or disables the cycle counter. |
void |
setDrivingPolicy(int dp)
DOCUMENT ME! |
protected void |
setInfra(int nr)
Set temp debug infra |
void |
setSimModel(SimModel m)
Sets a new SimModel to be controlled |
void |
setSpeed(int speed)
Sets the speed of the simulation |
void |
setTLC(int cat,
int nr)
DOCUMENT ME! |
void |
showFilePropertiesDialog()
Shows the file properties dialog |
void |
showStatistics()
Opens the statistics viewer. |
void |
showTracker(int type)
Shows the tracking window. |
void |
stop()
Stops the simulation and resets the infrastructure |
void |
unpause()
Resumes or starts the simulation |
void |
update(java.util.Observable o,
java.lang.Object arg)
Called by observable SimModel (if view enabled). |
| Methods inherited from class org.jscience.architecture.traffic.Controller |
|---|
changeTool, getConfigDialog, getCurrentSelection, getCurrentTool, getMainController, getModel, getStatus, getToolPanel, getView, getViewScroller, getXMLName, isViewEnabled, loadAll, newFile, newInfrastructure, openFile, quit, reportError, resizeComponents, saveAll, saveFile, saveFileAs, setConfigDialog, setCurrentFilename, setCurrentSelection, setCurrentTool, setMainController, setParentName, setStatus, setToolPanel, setViewEnabled, showConfigDialog, showError, showHelp, showSaveAsDialog, showSettings, switchConfigDialog, tryLoad, trySave, validateInfra, zoomChanged, zoomIn, zoomOut, zoomTo |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.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, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final java.lang.String[] speedTexts
public static final int[] speedSettings
protected EditController editController
protected SimMenuBar menuBar
protected java.awt.Choice speedChoice
protected StatisticsOverlay statsOverlay
| Constructor Detail |
|---|
public SimController(SimModel m,
boolean splash)
m - The SimModel to be controlled.splash - DOCUMENT ME!| Method Detail |
|---|
public SimModel getSimModel()
SimModel
public void setSimModel(SimModel m)
SimModel to be controlled
m - DOCUMENT ME!public void setCycleCounterEnabled(boolean b)
b - DOCUMENT ME!
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
XMLSerializable
load in interface XMLSerializableload in class ControllermyElement - The XMLElement which represents this object in the XML
tree. It can contain attributes which hold information about the
object.loader - The XMLLoader which this XMLSerializable can use to load
child objects.
XMLTreeException - The parser can throw this exception if it is
called by the XMLSerializable. The XMLSerializable should NOT
throw this exception by itself and preferrably not catch it
too.
java.io.IOException - Thrown in case of an read error in the XML file.
XMLInvalidInputException - The XMLSerializable can throw this
exception if it cannot load itself or one of its child objects
for whatever reason.
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializablesaveSelf in class ControllerXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaveChilds in class Controllersaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
public void doSave(java.lang.String filename)
throws InvalidFilenameException,
java.lang.Exception
doSave in class Controllerfilename - DOCUMENT ME!
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!
public void doLoad(java.lang.String filename)
throws InvalidFilenameException,
java.lang.Exception
doLoad in class Controllerfilename - DOCUMENT ME!
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!
public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observero - DOCUMENT ME!arg - DOCUMENT ME!protected java.lang.String appName()
appName in class Controllerprotected java.awt.MenuBar createMenuBar()
createMenuBar in class Controllerprotected TrafficToolBar createToolBar()
createToolBar in class Controllerpublic void showStatistics()
public void showTracker(int type)
type - DOCUMENT ME!public void enableOverlay()
public void disableOverlay()
public void setDrivingPolicy(int dp)
dp - DOCUMENT ME!
public void setTLC(int cat,
int nr)
cat - DOCUMENT ME!nr - DOCUMENT ME!public void showFilePropertiesDialog()
showFilePropertiesDialog in class Controller
public java.awt.PopupMenu getPopupMenuFor(Selectable obj)
throws PopupException
getPopupMenuFor in class Controllerobj - DOCUMENT ME!
PopupException - DOCUMENT ME!public java.lang.String getCurrentFilename()
public void setSpeed(int speed)
speed - DOCUMENT ME!public void doStep()
public void pause()
public void unpause()
public void stop()
public void runSeries()
public void nextSeries()
public void openEditor()
protected void setInfra(int nr)
nr - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||