JIMSwingGUI
Class TopLevelWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--JIMSwingGUI.TopLevelWindow
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.InternalFrameListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants, java.awt.event.WindowListener

public class TopLevelWindow
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ComponentListener, javax.swing.event.InternalFrameListener

A class representing the main window container for the application.

Author:
Fred Williams
See Also:
Serialized Form

Inner Class Summary
private  class TopLevelWindow.runThread
           
private  class TopLevelWindow.sourceLink
           
 
Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
private  javax.swing.JMenuItem about
           
private  int applicationHeight
          The application window's height.
private  int applicationWidth
          The application window's width.
private  int applicationX
          The application's X coordinate.
private  int applicationY
          The application's Y coordinate.
private  javax.swing.JMenuItem breakpoints
           
private  javax.swing.JMenuItem commandConsole
           
private  CommandProcessor commandProcessor
           
private  CommandResultBuffer commandResultBuffer
           
private  int consoleHeight
          The console window's height.
private  javax.swing.JScrollPane consolePane
           
private  javax.swing.JTextArea consoleText
           
private  int consoleWidth
          The console window's width.
private  javax.swing.JInternalFrame consoleWindow
           
private  boolean consoleWindowIsIcon
           
private  int consoleX
          The console window's X coordinate.
private  int consoleY
          The console window's Y coordinate.
private  javax.swing.JPanel contentPane
           
private  java.awt.Insets desktopInsets
           
private  javax.swing.JDesktopPane desktopPane
           
private  int desktopPaneHeight
           
private  int desktopPaneWidth
           
private  boolean DFPHex
          Defines if the Double Precision Floating Point Registers should be displayed in hexadecimal.
private  javax.swing.JMenuItem exit
           
private  boolean fileLoaded
           
private  javax.swing.JMenu fileMenu
           
private  javax.swing.JButton goBButton
           
private  javax.swing.JButton goFButton
           
private  boolean GPRHex
          Defines if the General Purpose Registers should be displayed in hexadecimal.
private  javax.swing.JMenuItem helpContents
           
private  javax.swing.JMenu helpMenu
           
private  boolean ignoreInvalidAT
          Defines if invalid use of the $at register should be ignored.
private  int memoryHeight
          The memory window's height.
private  javax.swing.JList memoryList
           
private  javax.swing.JMenuItem memoryModify
           
private  javax.swing.JScrollPane memoryPane
           
private  int memoryWidth
          The memory window's width.
private  javax.swing.JInternalFrame memoryWindow
           
private  boolean memoryWindowIsIcon
           
private  int memoryX
          The memory window's X coordinate.
private  int memoryY
          The memory window's Y coordinate.
private  javax.swing.JMenuBar menuBar
           
private  javax.swing.JMenuItem multipleStepB
           
private  javax.swing.JMenuItem multipleStepF
           
private  javax.swing.JButton multiStepBackButton
           
private  javax.swing.JButton multiStepForwardButton
           
private  javax.swing.JMenuItem open
           
private  javax.swing.JButton openButton
           
private  java.lang.String openDir
          Directory from which a file was last opened.
private  javax.swing.JList registerList
           
private  javax.swing.JMenuItem registerModify
           
private  javax.swing.JScrollPane registerPane
           
private  java.lang.StringBuffer registersContent
           
private  int registersHeight
          The register window's height.
private  int registersWidth
          The register window's width.
private  int registersX
          The register window's X coordinate.
private  int registersY
          The register window's Y coordinate.
private  javax.swing.JInternalFrame registerWindow
           
private  boolean registerWindowIsIcon
           
private  javax.swing.JMenuItem reset
           
private  javax.swing.JMenuItem resetAllWindows
           
private  javax.swing.JMenuItem runB
           
private  javax.swing.JMenuItem runF
           
private  javax.swing.JMenuItem settings
           
private  javax.swing.JButton settingsButton
           
private  boolean SFPHex
          Defines if the Single Precision Floating Point Registers should be displayed in hexadecimal.
private  boolean shouldRun
           
private  javax.swing.JCheckBoxMenuItem showConsoleWindow
           
private  javax.swing.JCheckBoxMenuItem showMemoryWindow
           
private  boolean showMoreErrors
           
private  javax.swing.JCheckBoxMenuItem showRegisterWindow
           
private  javax.swing.JCheckBoxMenuItem showSourceWindow
           
private  TopLevelWindow.runThread simExecutionThread
           
private  javax.swing.JMenu simulatorMenu
           
private  javax.swing.JMenuItem singleStepB
           
private  javax.swing.JMenuItem singleStepF
           
private  java.util.Vector sourceCode
           
private  int sourceHeight
          The source window's height.
private  java.util.Vector sourceLinks
           
private  javax.swing.JList sourceList
           
private  javax.swing.JScrollPane sourcePane
           
private  int sourceWidth
          The source window's width.
private  javax.swing.JInternalFrame sourceWindow
           
private  boolean sourceWindowIsIcon
           
private  int sourceX
          The source window's X coordinate.
private  int sourceY
          The source window's Y coordinate.
private  javax.swing.JMenuItem status
           
private  javax.swing.JButton stepBackButton
           
private  javax.swing.JButton stepForwardButton
           
private  javax.swing.JMenuItem stop
           
private  javax.swing.JButton stopButton
           
private  javax.swing.JToolBar toolBar
           
private  java.awt.Insets topInsets
           
private  javax.swing.JMenu windowMenu
           
private  int xCorrection
           
private  int yCorrection
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, 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 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
TopLevelWindow()
          Constructs a new application window.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Handles ActionEvents generated by menu items and buttons.
private  int assemblyPhase1(java.lang.String fullFileName, java.lang.String fileDir, java.lang.String fileName, boolean ignoreUseAT)
           
private  int assemblyPhase1Processing(Assembler assembler, java.util.Enumeration e)
          Performs the assembly process.
private  int assemblyPhase2(java.lang.String fullFileName, java.lang.String fileDir, java.lang.String fileName, boolean ignoreUseAT)
           
 void componentHidden(java.awt.event.ComponentEvent ce)
           
 void componentMoved(java.awt.event.ComponentEvent ce)
           
 void componentResized(java.awt.event.ComponentEvent ce)
           
 void componentShown(java.awt.event.ComponentEvent ce)
           
 void displayUpdate()
          Updates the application display - register contents, memory contents, source view and i/o console.
private  java.lang.String getDoubleFPRegisterValue(java.lang.String regSet, java.lang.String reg1, java.lang.String reg2)
          Gets the Double Precision Floating Point value stored in registers reg1 and reg2.
private  java.lang.String getFPRegisterValue(java.lang.String regSet, java.lang.String reg)
          Gets the single precision floating point value stored in register reg.
private  java.lang.String getRegisterValue(java.lang.String regSet, java.lang.String reg)
          Gets the value stored in register reg.
private  void highlightSourceLine(java.lang.String programCounter)
          Highlights the source code instruction specified by programCounter.
 void internalFrameActivated(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameClosed(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameClosing(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameIconified(javax.swing.event.InternalFrameEvent ife)
           
 void internalFrameOpened(javax.swing.event.InternalFrameEvent ife)
           
private  void loadConfig()
          Loads configuration settings from the file jimswing.cfg.
private  void performBackStep(boolean updateDisplay)
          Steps backward by one instruction.
private  void performExit()
          Cleans up and exits the application.
private  void performForwardStep(boolean updateDisplay)
          Steps forward by one instruction.
private  boolean performReset()
          Resets the simulator and the display windows.
private  void restoreConfigFile()
           
private  void restoreWindows()
          Restore the main application window and all subwindows to their default orientation.
 void setUpMenuItems()
          Sets up the application menu items.
private  void setUpMenus()
          Sets up the application menus.
 void setUpToolBar()
          Sets up the application toolbar.
private  void updateConsole()
           
private  void updateMemory()
           
private  void updateRegisters()
           
 void updateSettings(boolean GPR, boolean SFP, boolean DFP, boolean ignoreInvalidATUse)
          Updates the application settings.
 void windowActivated(java.awt.event.WindowEvent we)
           
 void windowClosed(java.awt.event.WindowEvent we)
           
 void windowClosing(java.awt.event.WindowEvent we)
           
 void windowDeactivated(java.awt.event.WindowEvent we)
           
 void windowDeiconified(java.awt.event.WindowEvent we)
           
 void windowIconified(java.awt.event.WindowEvent we)
           
 void windowOpened(java.awt.event.WindowEvent we)
           
private  void writeConfig(java.io.RandomAccessFile raf)
          Writes the configuration settings to the file jimswing.cfg.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
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, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

menuBar

private javax.swing.JMenuBar menuBar

fileMenu

private javax.swing.JMenu fileMenu

open

private javax.swing.JMenuItem open

exit

private javax.swing.JMenuItem exit

simulatorMenu

private javax.swing.JMenu simulatorMenu

singleStepF

private javax.swing.JMenuItem singleStepF

singleStepB

private javax.swing.JMenuItem singleStepB

multipleStepF

private javax.swing.JMenuItem multipleStepF

multipleStepB

private javax.swing.JMenuItem multipleStepB

stop

private javax.swing.JMenuItem stop

runF

private javax.swing.JMenuItem runF

runB

private javax.swing.JMenuItem runB

reset

private javax.swing.JMenuItem reset

breakpoints

private javax.swing.JMenuItem breakpoints

registerModify

private javax.swing.JMenuItem registerModify

memoryModify

private javax.swing.JMenuItem memoryModify

status

private javax.swing.JMenuItem status

commandConsole

private javax.swing.JMenuItem commandConsole

settings

private javax.swing.JMenuItem settings

windowMenu

private javax.swing.JMenu windowMenu

showRegisterWindow

private javax.swing.JCheckBoxMenuItem showRegisterWindow

showMemoryWindow

private javax.swing.JCheckBoxMenuItem showMemoryWindow

showSourceWindow

private javax.swing.JCheckBoxMenuItem showSourceWindow

showConsoleWindow

private javax.swing.JCheckBoxMenuItem showConsoleWindow

resetAllWindows

private javax.swing.JMenuItem resetAllWindows

helpMenu

private javax.swing.JMenu helpMenu

helpContents

private javax.swing.JMenuItem helpContents

about

private javax.swing.JMenuItem about

registerWindow

private javax.swing.JInternalFrame registerWindow

registerList

private javax.swing.JList registerList

registerPane

private javax.swing.JScrollPane registerPane

memoryWindow

private javax.swing.JInternalFrame memoryWindow

memoryPane

private javax.swing.JScrollPane memoryPane

memoryList

private javax.swing.JList memoryList

sourceWindow

private javax.swing.JInternalFrame sourceWindow

sourceList

private javax.swing.JList sourceList

sourcePane

private javax.swing.JScrollPane sourcePane

consoleWindow

private javax.swing.JInternalFrame consoleWindow

consolePane

private javax.swing.JScrollPane consolePane

consoleText

private javax.swing.JTextArea consoleText

topInsets

private java.awt.Insets topInsets

desktopInsets

private java.awt.Insets desktopInsets

toolBar

private javax.swing.JToolBar toolBar

openButton

private javax.swing.JButton openButton

goFButton

private javax.swing.JButton goFButton

goBButton

private javax.swing.JButton goBButton

stopButton

private javax.swing.JButton stopButton

stepForwardButton

private javax.swing.JButton stepForwardButton

multiStepForwardButton

private javax.swing.JButton multiStepForwardButton

stepBackButton

private javax.swing.JButton stepBackButton

multiStepBackButton

private javax.swing.JButton multiStepBackButton

settingsButton

private javax.swing.JButton settingsButton

contentPane

private javax.swing.JPanel contentPane

desktopPane

private javax.swing.JDesktopPane desktopPane

registersContent

private java.lang.StringBuffer registersContent

openDir

private java.lang.String openDir
Directory from which a file was last opened.

applicationX

private int applicationX
The application's X coordinate.

applicationY

private int applicationY
The application's Y coordinate.

applicationWidth

private int applicationWidth
The application window's width.

applicationHeight

private int applicationHeight
The application window's height.

registersX

private int registersX
The register window's X coordinate.

registersY

private int registersY
The register window's Y coordinate.

registersWidth

private int registersWidth
The register window's width.

registersHeight

private int registersHeight
The register window's height.

memoryX

private int memoryX
The memory window's X coordinate.

memoryY

private int memoryY
The memory window's Y coordinate.

memoryWidth

private int memoryWidth
The memory window's width.

memoryHeight

private int memoryHeight
The memory window's height.

sourceX

private int sourceX
The source window's X coordinate.

sourceY

private int sourceY
The source window's Y coordinate.

sourceWidth

private int sourceWidth
The source window's width.

sourceHeight

private int sourceHeight
The source window's height.

consoleX

private int consoleX
The console window's X coordinate.

consoleY

private int consoleY
The console window's Y coordinate.

consoleWidth

private int consoleWidth
The console window's width.

consoleHeight

private int consoleHeight
The console window's height.

desktopPaneWidth

private int desktopPaneWidth

desktopPaneHeight

private int desktopPaneHeight

sourceCode

private java.util.Vector sourceCode

sourceLinks

private java.util.Vector sourceLinks

commandProcessor

private CommandProcessor commandProcessor

commandResultBuffer

private CommandResultBuffer commandResultBuffer

simExecutionThread

private TopLevelWindow.runThread simExecutionThread

shouldRun

private boolean shouldRun

fileLoaded

private boolean fileLoaded

showMoreErrors

private boolean showMoreErrors

GPRHex

private boolean GPRHex
Defines if the General Purpose Registers should be displayed in hexadecimal.

SFPHex

private boolean SFPHex
Defines if the Single Precision Floating Point Registers should be displayed in hexadecimal.

DFPHex

private boolean DFPHex
Defines if the Double Precision Floating Point Registers should be displayed in hexadecimal.

ignoreInvalidAT

private boolean ignoreInvalidAT
Defines if invalid use of the $at register should be ignored.

registerWindowIsIcon

private boolean registerWindowIsIcon

memoryWindowIsIcon

private boolean memoryWindowIsIcon

sourceWindowIsIcon

private boolean sourceWindowIsIcon

consoleWindowIsIcon

private boolean consoleWindowIsIcon

xCorrection

private int xCorrection

yCorrection

private int yCorrection
Constructor Detail

TopLevelWindow

public TopLevelWindow()
Constructs a new application window.
Method Detail

performBackStep

private void performBackStep(boolean updateDisplay)
Steps backward by one instruction.
Parameters:
updateDisplay - Defines whether the display should be updated after the step.

performForwardStep

private void performForwardStep(boolean updateDisplay)
Steps forward by one instruction.
Parameters:
updateDisplay - Defines whether the display should be updated after the step.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Handles ActionEvents generated by menu items and buttons.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - The ActionEvent object generated by a menu item or button.

setUpMenus

private void setUpMenus()
Sets up the application menus.

setUpMenuItems

public void setUpMenuItems()
Sets up the application menu items.

setUpToolBar

public void setUpToolBar()
Sets up the application toolbar.

windowOpened

public void windowOpened(java.awt.event.WindowEvent we)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent we)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent we)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent we)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent we)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent we)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent we)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent ce)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent ce)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent ce)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent ce)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent ife)
Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener

updateSettings

public void updateSettings(boolean GPR,
                           boolean SFP,
                           boolean DFP,
                           boolean ignoreInvalidATUse)
Updates the application settings.
Parameters:
GPR - Defines whether the General Purpose Registers should be displayed in hexadecimal.
SFP - Defines whether the Single Precision Floating Point registers should be displayed in hexadecimal.
DFP - Defines whether the Double Precision Floating Point registers should be displayed in hexadecimal.
ignoreInvalidATUse - Defines whether invalid use of the $at register should be ignored.

loadConfig

private void loadConfig()
Loads configuration settings from the file jimswing.cfg.

performReset

private boolean performReset()
Resets the simulator and the display windows.

performExit

private void performExit()
Cleans up and exits the application.

restoreWindows

private void restoreWindows()
Restore the main application window and all subwindows to their default orientation.

restoreConfigFile

private void restoreConfigFile()

writeConfig

private void writeConfig(java.io.RandomAccessFile raf)
Writes the configuration settings to the file jimswing.cfg.

updateConsole

private void updateConsole()

updateMemory

private void updateMemory()

updateRegisters

private void updateRegisters()

assemblyPhase1

private int assemblyPhase1(java.lang.String fullFileName,
                           java.lang.String fileDir,
                           java.lang.String fileName,
                           boolean ignoreUseAT)

assemblyPhase2

private int assemblyPhase2(java.lang.String fullFileName,
                           java.lang.String fileDir,
                           java.lang.String fileName,
                           boolean ignoreUseAT)

assemblyPhase1Processing

private int assemblyPhase1Processing(Assembler assembler,
                                     java.util.Enumeration e)
Performs the assembly process.
Parameters:
assembler - The Assembler object to use for processing.
e - The source code the process

getRegisterValue

private java.lang.String getRegisterValue(java.lang.String regSet,
                                          java.lang.String reg)
Gets the value stored in register reg.
Parameters:
regSet - The register set containing register reg.
reg - The name of the register to read.

getFPRegisterValue

private java.lang.String getFPRegisterValue(java.lang.String regSet,
                                            java.lang.String reg)
Gets the single precision floating point value stored in register reg.
Parameters:
regSet - The register set containing register reg.
reg - The name of the register to read.

getDoubleFPRegisterValue

private java.lang.String getDoubleFPRegisterValue(java.lang.String regSet,
                                                  java.lang.String reg1,
                                                  java.lang.String reg2)
Gets the Double Precision Floating Point value stored in registers reg1 and reg2.
Parameters:
regSet - The register set containing reg1 and reg2: for floating point registers should be "CP1".
reg1 - The register containing the lower 32-bits of the double precision floating point value.
reg2 - The register containing the upper 32-bits of the double precision floating point value.

highlightSourceLine

private void highlightSourceLine(java.lang.String programCounter)
Highlights the source code instruction specified by programCounter.
Parameters:
programCounter - address of the instruction to be highlighted

displayUpdate

public void displayUpdate()
Updates the application display - register contents, memory contents, source view and i/o console.