jmarkov.gui

## Class MarkovGUI

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - java.awt.Window
      - - java.awt.Frame
        - - javax.swing.JFrame
          - - jmarkov.gui.MarkovGUI

- All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

      public class MarkovGUI
      extends javax.swing.JFrame
      implements javax.swing.event.ChangeListener, java.awt.event.ComponentListener, java.awt.event.ActionListener

  Author:
    Germán Riaño. Universidad de los Andes.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.awt.Window

      `java.awt.Window.Type`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.BaselineResizeBehavior`

  - ### Field Summary

    - ### Fields inherited from class javax.swing.JFrame

      `EXIT_ON_CLOSE`

    - ### 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 javax.swing.WindowConstants

      `DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE`

    - ### Fields inherited from interface java.awt.image.ImageObserver

      `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarkovGUI()` Creates a default GUI.
    `MarkovGUI(MarkovProcess mp)` Creates GUI with thr given SimpleMarkovProcess.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `actionPerformed(java.awt.event.ActionEvent e)`
    `void` | `cmdExit()` Closes the program.
    `void` | `cmdGo()` Generates the currently loaded model.
    `void` | `cmdPause()` Pauses generation of the current model.
    `void` | `cmdReLoad()` Reloads the model.
    `void` | `cmdReStart()` Re-starts the generation of the model.
    `void` | `cmdStep()` Runs one step of model generation.
    `void` | `componentHidden(java.awt.event.ComponentEvent e)`
    `void` | `componentMoved(java.awt.event.ComponentEvent e)`
    `void` | `componentResized(java.awt.event.ComponentEvent e)`
    `void` | `componentShown(java.awt.event.ComponentEvent e)`
    `DebugReporter` | `getDebugReporter()`
    `boolean` | `isAllowedToRun()`
    `void` | `loadMP(MarkovProcess<?,?> mp)` Loads the given SimpleMarkovProcess in the GUI
    `void` | `loadMP(java.lang.String[] files)` Loads a model from the given classes
    `static void` | `main(java.lang.String[] a)` Runs the user interface.
    `void` | `runModel()` Runs the model
    `void` | `setTabEnabled(javax.swing.JComponent comp, boolean enabl)` Utility Function to enable/disable the tab associated with this component
    `void` | `stateChanged(javax.swing.event.ChangeEvent e)`
    `void` | `unLoadMP()` Unload the SimpleMarkovProcess
    `void` | `updateStatus()` Called to ensure that all the GUI shows correctly according to Model status
    `void` | `updateTxtPanel(TextPanel aPanel)` Calls the appropriate function so the Panel gets updated

    - ### Methods inherited from class javax.swing.JFrame

      `getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update`

    - ### Methods inherited from class java.awt.Frame

      `addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated`

    - ### Methods inherited from class java.awt.Window

      `addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, 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, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate`

    - ### Methods inherited from class java.awt.Component

      `action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.awt.MenuContainer

      `getFont, postEvent`

- - ### Constructor Detail

    - #### MarkovGUI

          public MarkovGUI(MarkovProcess mp)

      Creates GUI with thr given SimpleMarkovProcess.
      Parameters:
        `mp` -

    - #### MarkovGUI

          public MarkovGUI()
                    throws java.awt.HeadlessException

      Creates a default GUI.
      Throws:
        `java.awt.HeadlessException`

  - ### Method Detail

    - #### isAllowedToRun

          public boolean isAllowedToRun()

      Returns:
        Returns true if allowedToRun.

    - #### updateStatus

          public void updateStatus()

      Called to ensure that all the GUI shows correctly according to Model status

    - #### cmdExit

          public void cmdExit()

      Closes the program.

    - #### cmdGo

          public void cmdGo()

      Generates the currently loaded model.

    - #### cmdPause

          public void cmdPause()

      Pauses generation of the current model.

    - #### cmdReLoad

          public void cmdReLoad()

      Reloads the model. If the model has been recompiled it loads the most recent version.

    - #### cmdReStart

          public void cmdReStart()

      Re-starts the generation of the model.

    - #### cmdStep

          public void cmdStep()

      Runs one step of model generation.

    - #### loadMP

          public void loadMP(java.lang.String[] files)

      Loads a model from the given classes
      Parameters:
        `files` - The name of Event, State and Model classes, in that order.

    - #### loadMP

          public void loadMP(MarkovProcess<?,?> mp)

      Loads the given SimpleMarkovProcess in the GUI
      Parameters:
        `mp` - the markov Process to load.

    - #### unLoadMP

          public void unLoadMP()

      Unload the SimpleMarkovProcess

    - #### updateTxtPanel

          public void updateTxtPanel(TextPanel aPanel)

      Calls the appropriate function so the Panel gets updated
      Parameters:
        `aPanel` - The States, MOPs, etc panel.

    - #### getDebugReporter

          public DebugReporter getDebugReporter()

      Returns:
        The GUI reporter for debug info.

    - #### runModel

          public void runModel()

      Runs the model

    - #### stateChanged

          public void stateChanged(javax.swing.event.ChangeEvent e)

      Specified by:
        `stateChanged` in interface `javax.swing.event.ChangeListener`

    - #### componentHidden

          public void componentHidden(java.awt.event.ComponentEvent e)

      Specified by:
        `componentHidden` in interface `java.awt.event.ComponentListener`

    - #### componentMoved

          public void componentMoved(java.awt.event.ComponentEvent e)

      Specified by:
        `componentMoved` in interface `java.awt.event.ComponentListener`

    - #### componentResized

          public void componentResized(java.awt.event.ComponentEvent e)

      Specified by:
        `componentResized` in interface `java.awt.event.ComponentListener`

    - #### componentShown

          public void componentShown(java.awt.event.ComponentEvent e)

      Specified by:
        `componentShown` in interface `java.awt.event.ComponentListener`

    - #### setTabEnabled

          public void setTabEnabled(javax.swing.JComponent comp,
                           boolean enabl)

      Utility Function to enable/disable the tab associated with this component
      Parameters:
        `comp` - The component
        `enabl` - Troe or False.

    - #### actionPerformed

          public void actionPerformed(java.awt.event.ActionEvent e)

      Specified by:
        `actionPerformed` in interface `java.awt.event.ActionListener`

    - #### main

          public static void main(java.lang.String[] a)

      Runs the user interface. If no argumentas are given it runs with no associated model
      Parameters:
        `a` -