Class AnimationPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmt.framework.gui.wizard.WizardPanel
jmt.jmch.wizard.panels.JMCHWizardPanel
jmt.jmch.wizard.panels.AnimationPanel
- All Implemented Interfaces:
GuiInterface, ImageObserver, MenuContainer, Serializable, Accessible
Panel for JTeach models.
It is the same class for all types of Queueing Network.
- Author:
- Lorenzo Torri Date: 30-mar-2024 Time: 14.40
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class JMCHWizardPanel
parentFields inherited from class WizardPanel
parentWizardFields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidchangeSimActionsState(boolean start, boolean pause, boolean stop) Changes simulation action status.protected voidUpdate the menuBar for the Scheduling Windowprotected voidUpdate the toolbar for the Scheduling WindowvoidHalve the animation's velocityvoidenableButtons(boolean str, boolean ps, boolean rl, boolean nxtSt, boolean decVel, boolean incVel) Enable or disable the buttonsvoidexit()Go back to the main menudoublegetLastMeasure(MeasureDefinition md, int index) getName()voidShows a panel with caught exceptionvoidDouble the animation's velocitybooleanUsed to discover if the instance can display simulation animationvoidcalled by the Wizard before when switching to another panelvoidUpdates the animation to the next stepvoidPauses the animationvoidReloads the animationvoidSet all the buttons correclty when the Step simulation is complete (called by AnimationClass)voidsetAnimationHolder(Thread thread) voidvoidsetResultsWindow(JFrame rsw) Sets resultWindow to be shown.voidvoidshowErrorMessage(String message) Shows a panel with an error messagevoidshowRelatedPanel(int problemType, int problemSubType, Object relatedStation, Object relatedCLass) Shows the panel to solve a problemvoidShows results window.voidCalled by dispatcher when the simulation with JSIM Engine is finished.voidStarts the animationvoidStops the simulation, used in Markov Chain, but also in the Simulation Models in reverse mode (it's the simulation that decides when the animation has to be stopped and all the UI changes must be done)voidvoidupdateAnimResults(int genereatedJobs, double[] measures) Methods inherited from class JMCHWizardPanel
aboutMethods inherited from class WizardPanel
canFinish, canGoForward, getParentWizard, gotFocus, help, redraw, setParentWizardMethods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
editArrivalDistrAction
-
editServiceDistrAction
-
-
Constructor Details
-
AnimationPanel
-
-
Method Details
-
createMenu
protected void createMenu()Update the menuBar for the Scheduling Window -
createToolbar
protected void createToolbar()Update the toolbar for the Scheduling Window -
canGoBack
public boolean canGoBack()- Overrides:
canGoBackin classWizardPanel- Returns:
- true if it is ok for the wizard to go back. It is ok for the queried panel to pop up a message box explaining why it cannot go back.
-
getName
- Overrides:
getNamein classJMCHWizardPanel- Returns:
- the panel's name
-
getSimulationType
-
startAnimation
public void startAnimation()Description copied from class:JMCHWizardPanelStarts the animation- Overrides:
startAnimationin classJMCHWizardPanel
-
setUpAnimation
public void setUpAnimation() -
pauseAnimation
public void pauseAnimation()Description copied from class:JMCHWizardPanelPauses the animation- Overrides:
pauseAnimationin classJMCHWizardPanel
-
reloadAnimation
public void reloadAnimation()Description copied from class:JMCHWizardPanelReloads the animation- Overrides:
reloadAnimationin classJMCHWizardPanel
-
nextStepAnimation
public void nextStepAnimation()Description copied from class:JMCHWizardPanelUpdates the animation to the next step- Overrides:
nextStepAnimationin classJMCHWizardPanel
-
resetNextStepAnimation
public void resetNextStepAnimation()Set all the buttons correclty when the Step simulation is complete (called by AnimationClass) -
increaseVelocity
public void increaseVelocity()Description copied from class:JMCHWizardPanelDouble the animation's velocity- Overrides:
increaseVelocityin classJMCHWizardPanel
-
decreaseVelocity
public void decreaseVelocity()Description copied from class:JMCHWizardPanelHalve the animation's velocity- Overrides:
decreaseVelocityin classJMCHWizardPanel
-
stopAnimation
public void stopAnimation()Description copied from class:JMCHWizardPanelStops the simulation, used in Markov Chain, but also in the Simulation Models in reverse mode (it's the simulation that decides when the animation has to be stopped and all the UI changes must be done)- Overrides:
stopAnimationin classJMCHWizardPanel
-
setLastPanel
public void setLastPanel()- Overrides:
setLastPanelin classJMCHWizardPanel
-
lostFocus
public void lostFocus()Description copied from class:WizardPanelcalled by the Wizard before when switching to another panel- Overrides:
lostFocusin classWizardPanel
-
enableButtons
public void enableButtons(boolean str, boolean ps, boolean rl, boolean nxtSt, boolean decVel, boolean incVel) Enable or disable the buttons- Parameters:
str- start buttonps- pause buttonrl- reload buttonnxtSt- nextStep buttondecVel- decreseVelocity buttonincVel- increaseVelocity button
-
showErrorMessage
Description copied from interface:GuiInterfaceShows a panel with an error message- Specified by:
showErrorMessagein interfaceGuiInterface- Parameters:
message- specified error message
-
handleException
Description copied from interface:GuiInterfaceShows a panel with caught exception- Specified by:
handleExceptionin interfaceGuiInterface- Parameters:
e- exception to be shown
-
changeSimActionsState
public void changeSimActionsState(boolean start, boolean pause, boolean stop) Description copied from interface:GuiInterfaceChanges simulation action status. This method is called by DispatcherThread.- Specified by:
changeSimActionsStatein interfaceGuiInterface- Parameters:
start- state for start actionpause- state for pause actionstop- state for stop action
-
setResultsWindow
Description copied from interface:GuiInterfaceSets resultWindow to be shown. This method is used by pollerThread.- Specified by:
setResultsWindowin interfaceGuiInterface- Parameters:
rsw- window to be set as current ResultsWindow
-
showResultsWindow
public void showResultsWindow()Description copied from interface:GuiInterfaceShows results window. This method is used by pollerThread.- Specified by:
showResultsWindowin interfaceGuiInterface
-
isAnimationDisplayable
public boolean isAnimationDisplayable()Description copied from interface:GuiInterfaceUsed to discover if the instance can display simulation animation- Specified by:
isAnimationDisplayablein interfaceGuiInterface- Returns:
- true if the instance can display simulation animation
-
showRelatedPanel
public void showRelatedPanel(int problemType, int problemSubType, Object relatedStation, Object relatedCLass) Description copied from interface:GuiInterfaceShows the panel to solve a problem- Specified by:
showRelatedPanelin interfaceGuiInterface
-
setAnimationHolder
- Specified by:
setAnimationHolderin interfaceGuiInterface
-
getFileName
- Specified by:
getFileNamein interfaceGuiInterface
-
simulationFinished
public void simulationFinished()Called by dispatcher when the simulation with JSIM Engine is finished. I opted for this solution since the progressionListener is not very well synchronized with the available data, it happened most of the times that the progression was 100% but there was no available data- Specified by:
simulationFinishedin interfaceGuiInterface
-
getLastMeasure
-
updateAnimResults
public void updateAnimResults(int genereatedJobs, double[] measures) -
terminateThreads
public void terminateThreads() -
exit
public void exit()Description copied from class:JMCHWizardPanelGo back to the main menu- Overrides:
exitin classJMCHWizardPanel
-