|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--javax.swing.JApplet | +--haifa.shopsim.UI.MainGUI
This class is one of the several usuable products of the JobShopSimualtion Project. It is the Algorithm testing/educational tool. It is the class that should be run as the main class when running this tool as a stand alone application. It may also be run as an applet.
When run as an applet, job shop files may be loaded only from the host at which the applet is sitting. This should suffice for demonstration purpuses. see the init() method.
Applet code should be:
... param name = "SHOP_DATA1" value = "shop1.jbs*A three machine problem" param name = "SHOP_DATA2" value = "10x10.jbs*The famous 10 by 10 problem" ...
This GUI features the following states of execution:
Inner classes inherited from class javax.swing.JApplet |
javax.swing.JApplet.AccessibleJApplet |
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, java.awt.Component.AWTTreeLock |
Field Summary | |
protected int |
ALG_SELECTED_STATE
This state implies that an algorithm is selected and also a shop is loaded. |
protected java.util.Vector |
algButtunsVector
|
protected javax.swing.ButtonGroup |
algGroup
|
protected javax.swing.JMenu |
algorithmMenu
|
protected javax.swing.JPanel |
algPanel
Location in which the GUI algorithm appears. |
protected javax.swing.JPanel |
animArea
For animation. |
protected javax.swing.JSplitPane |
bottomSplitPane
Vertical split between shopdata and gantt. |
protected javax.swing.JPanel |
centerBottomPanel
|
protected javax.swing.JSplitPane |
centerSplitPane
Splits between the upper splitPane and the shopData,gantt. |
protected javax.swing.JPanel |
centerTopPanel
|
protected static int |
CLOSE_ITEM_POS
|
protected javax.swing.JLabel |
commandLabel
|
protected GUIAlgorithm |
currentAlgorithm
A refrence to the currently selected shopAlgorithm, may be null. |
protected javax.swing.AbstractButton |
defaultRV
A reference to the default random variable button. |
protected static int |
EXIT_ITEM_POS
|
protected javax.swing.JMenu |
fileMenu
|
(package private) javax.swing.Action[] |
fileMenuActions
Action events of the file menu. |
protected int |
FINISHED_STATE
This state implies that a simulation run was running and is now finished. |
protected static javax.swing.JFrame |
frame
|
protected javax.swing.JPanel |
ganttArea
For gantt chart. |
protected GeneralProblemSizeChooser |
generalProblemSizeChooser
The size chooser used to determine how many jobs are on each route. |
protected javax.swing.JMenu |
helpMenu
|
(package private) javax.swing.Action[] |
helpMenuActions
Action events of the Help menu. |
protected static java.lang.String |
HOME_PAGE
If the user chooses exit during an applet, it is brought to this page. |
protected static boolean |
isApplication
False if applet true if application |
protected JobShopGraphics |
jobShopGraphics
The Graphics information (to be read from .jbs file). |
protected java.awt.event.ActionEvent |
lastAe
|
protected AlgorithmSelectionAction |
lastAsa
|
protected int |
LOADED_STATE
This state implies that a shop is loaded but not running and an algorithm is still not selected. |
protected LogWindow |
logWindow
Results from the kernel, algorithms and stat collector are printed to this window. |
protected javax.swing.JPanel |
mainPanel
|
protected static int |
MAX_JOBS
The highest multiplicty that the GUI enviornment allows. |
protected javax.swing.JMenuBar |
menuBar
|
protected static int |
OPEN_ITEM_POS
|
protected javax.swing.JPanel |
patchPanel
|
protected RandomTimeMaker |
randomTimeMaker
The random variable generator. |
protected int |
RESET_STATE
This is the state immidiently after opening or after closing a shop. |
protected javax.swing.JRootPane |
rootPane
Used when working with a JFrame and setting a menu. |
protected int |
RUNNING_STATE
This state implies that a shop is currently running. |
protected javax.swing.ButtonGroup |
rvGroup
|
protected javax.swing.JMenu |
rvMenu
|
protected static int |
SET_NR_ITEM_POS
|
protected ShopAnim |
shopAnim
The animation. |
protected ShopData |
shopData
A reference to the data regarding the current job shop, may be null if no shop data is set. |
protected javax.swing.JTextArea |
shopDataTextArea
The text area in which the shop data is displayed. |
protected javax.swing.JPanel |
shopStateArea
For shopState table. |
protected ShopTraceMaker |
shopTraceMaker
Listens to shop events and transaltes them to trace events as seen by the gantt chart in the simJava package. |
protected ShopViewUpdater |
shopViewUpdater
Gets events from ShopSimulation and updates listeners according to speed control. |
protected javax.swing.JMenu |
simulationMenu
|
(package private) javax.swing.Action[] |
simulationMenuActions
Action events of the simulation menu. |
protected static int |
SPEED_ITEM_POS
|
protected SpeedControlAction |
speedControlAction
|
protected javax.swing.JSlider |
speedSlider
Slider used by speed control. |
protected static int |
START_ITEM_POS
|
protected StatisticsCollector |
stat
The statistics Collector. |
protected int |
state
The variable that states the state in which the MainGUI is found. |
protected javax.swing.JComponent |
stateTable
A reference to the stateTable |
protected static int |
STOP_ITEM_POS
|
protected ThreadFastShopRun |
threadFastShopRun
A reference to the ShopSimulation object (the object that runs the simulation). |
protected TimingDiagram |
timingDiagram
Used to display Gantt Chart. |
protected javax.swing.JSplitPane |
upperSplitPane
Splits between Algorithm and animation/stateTable. |
protected java.util.Map |
urlFilesMap
|
protected static int |
VIEW_ITEM_POS
|
Fields inherited from class javax.swing.JApplet |
accessibleContext, rootPaneCheckingEnabled |
Fields inherited from class java.applet.Applet |
serialVersionUID, stub |
Fields inherited from class java.awt.Panel |
base, nameCounter |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
MainGUI()
|
Method Summary | |
void |
destory()
|
protected void |
exitApplet()
Kills the applet and goes to HOME_PAGE with the browser. |
protected static void |
exitApplication()
Called to exit. |
protected void |
fixAlgSelectedState()
|
protected void |
fixFinishedState()
|
protected void |
fixLoadedState()
|
protected void |
fixResetState()
|
protected void |
fixRunningState()
|
protected void |
fullyEnableMenu(javax.swing.JMenu menu)
|
void |
init()
Reads parameters, sets up, etc... |
protected void |
loadShopData(java.io.Reader reader)
Loads and allocates shopData. |
protected void |
loadShopGraphics(java.io.Reader reader)
Loads and allocates jobShopGraphics. |
static void |
main(java.lang.String[] a)
|
protected void |
notifyAboutSpeed()
|
void |
setCommandLabel(java.lang.String cmd)
Changes the command label |
MainGUI |
setUp(javax.swing.JRootPane rootPane_)
Sets up GUI. |
private void |
setUpAlgorithmsMenu()
|
protected void |
setUpDataFilesMenuForApplet()
|
void |
start()
|
void |
stop()
|
Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, createRootPaneException, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
|
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, transferFocus, validate, validateTree, writeObject |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, 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, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, 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, registerNatives, wait, wait, wait |
Field Detail |
protected final int RESET_STATE
protected final int LOADED_STATE
protected final int ALG_SELECTED_STATE
protected final int RUNNING_STATE
protected final int FINISHED_STATE
protected int state
protected static final java.lang.String HOME_PAGE
protected static final int MAX_JOBS
protected static boolean isApplication
protected javax.swing.JRootPane rootPane
protected javax.swing.JPanel algPanel
protected javax.swing.JPanel shopStateArea
protected javax.swing.JPanel ganttArea
protected javax.swing.JPanel animArea
protected javax.swing.JPanel mainPanel
protected javax.swing.JLabel commandLabel
protected javax.swing.JPanel centerTopPanel
protected javax.swing.JPanel centerBottomPanel
protected javax.swing.JSplitPane upperSplitPane
protected javax.swing.JSplitPane centerSplitPane
protected javax.swing.JSplitPane bottomSplitPane
protected javax.swing.JMenuBar menuBar
protected javax.swing.JMenu fileMenu
protected javax.swing.JMenu simulationMenu
protected javax.swing.JMenu algorithmMenu
protected javax.swing.JMenu helpMenu
protected javax.swing.JMenu rvMenu
protected javax.swing.ButtonGroup rvGroup
protected javax.swing.ButtonGroup algGroup
javax.swing.Action[] fileMenuActions
protected static final int OPEN_ITEM_POS
protected static final int CLOSE_ITEM_POS
protected static final int EXIT_ITEM_POS
protected SpeedControlAction speedControlAction
javax.swing.Action[] simulationMenuActions
protected static final int START_ITEM_POS
protected static final int STOP_ITEM_POS
protected static final int SPEED_ITEM_POS
protected static final int VIEW_ITEM_POS
protected static final int SET_NR_ITEM_POS
javax.swing.Action[] helpMenuActions
protected ShopAnim shopAnim
protected JobShopGraphics jobShopGraphics
protected javax.swing.JComponent stateTable
protected LogWindow logWindow
protected ShopTraceMaker shopTraceMaker
protected ShopViewUpdater shopViewUpdater
protected TimingDiagram timingDiagram
protected javax.swing.JTextArea shopDataTextArea
protected javax.swing.JSlider speedSlider
protected ThreadFastShopRun threadFastShopRun
protected GUIAlgorithm currentAlgorithm
protected ShopData shopData
protected StatisticsCollector stat
protected RandomTimeMaker randomTimeMaker
protected GeneralProblemSizeChooser generalProblemSizeChooser
protected javax.swing.AbstractButton defaultRV
protected java.util.Vector algButtunsVector
protected AlgorithmSelectionAction lastAsa
protected java.awt.event.ActionEvent lastAe
protected javax.swing.JPanel patchPanel
protected java.util.Map urlFilesMap
protected static javax.swing.JFrame frame
Constructor Detail |
public MainGUI()
Method Detail |
public MainGUI setUp(javax.swing.JRootPane rootPane_)
private void setUpAlgorithmsMenu()
protected void fixResetState()
protected void fixLoadedState()
protected void fixAlgSelectedState()
protected void fixRunningState()
protected void fixFinishedState()
protected void loadShopData(java.io.Reader reader) throws java.lang.Exception
protected void loadShopGraphics(java.io.Reader reader) throws java.lang.Exception
public void setCommandLabel(java.lang.String cmd)
protected void fullyEnableMenu(javax.swing.JMenu menu)
protected void notifyAboutSpeed()
public void init()
init
in class java.applet.Applet
protected void setUpDataFilesMenuForApplet()
public void start()
start
in class java.applet.Applet
public void stop()
stop
in class java.applet.Applet
public void destory()
protected void exitApplet()
public static void main(java.lang.String[] a)
protected static void exitApplication()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |