|
||||||||||
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
javax.swing.JFrame
fi.hu.cs.titokone.GUI
Class GUI is namely the class that implements the Graphical User Interface. It uses methods in GUIBrain to fire certain actions, such as compiling and running the programs. If GUIBrain wants to inform GUI about something, like new register values or about a new symbol in symbol table, then an Event of some kind if fired. Various ActionListeners are added here to catch those events. This GUI has three views hardcoded, one for the state when no file has been opened, one for the state when a symbolic code file has been opened and one one for the state when a binary code file has been opened. The view can be changed with setView(int) method and once it is launched, the GUI's view is changed into the selected view's basic state. A basic state for a view means which of the buttons are enabled and which of the menuselections are enabled for a certain view.
Nested Class Summary | |
private class |
GUI.SetMemSizeActionListener
|
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
(package private) javax.swing.JMenuItem |
about
|
private java.awt.event.ActionListener |
aboutActionListener
|
private GUIHTMLDialog |
aboutDialog
|
private int |
activeView
|
(package private) Animator |
animator
|
static int |
ANIMATOR_SPEED_MAX
|
static int |
ANIMATOR_SPEED_MIN
|
(package private) javax.swing.JButton |
animatorContinueButton
|
(package private) javax.swing.JFrame |
animatorFrame
|
(package private) javax.swing.JSlider |
animatorSpeedSlider
|
private javax.swing.filechooser.FileFilter |
B91FileFilter
|
private javax.swing.border.Border |
blacklined
|
private static int |
cellMargin
|
private javax.swing.filechooser.FileFilter |
classFileFilter
|
static short |
CODE_TABLE
Code table - used in centerToLine(), selectRow() and setGUIView() methods |
static short |
CODE_TABLE_EDITING
|
(package private) JTableX |
codeTable
This table is used to visualize the K91 source code. |
(package private) java.lang.Object[] |
codeTableIdentifiers
|
(package private) javax.swing.JScrollPane |
codeTableScrollPane
This holds (@link codeTable codeTable). |
private static int |
COMMENT_LIST_SIZE
|
(package private) javax.swing.JList |
commentList
The comments are shown here. |
(package private) javax.swing.JScrollPane |
commentListScrollPane
This holds (@link commentList commentList). |
static short |
COMPILE_COMMAND
|
(package private) javax.swing.JButton |
compileButton
|
private java.awt.event.ActionListener |
compileCommandActionListener
|
(package private) javax.swing.JMenuItem |
compileMenuItem
|
(package private) javax.swing.JMenu |
configureFileSystem
|
static short |
CONTINUE_COMMAND
|
static short |
CONTINUE_WITHOUT_PAUSES_COMMAND
|
(package private) javax.swing.JButton |
continueButton
|
private java.awt.event.ActionListener |
continueCommandActionListener
|
(package private) javax.swing.JMenuItem |
continueMenuItem
|
(package private) javax.swing.JButton |
continueToEndButton
|
private java.awt.event.ActionListener |
continueToEndCommandActionListener
|
(package private) javax.swing.JMenuItem |
continueToEndMenuItem
|
(package private) javax.swing.JSplitPane |
dataAndInstructionsTableSplitPane
This holds (@link instructionsTableScrollPane instructionsTableScrollPane) and (@link dataTableScrollPane dataTableScrollPane). |
(package private) JTableX |
dataTable
This table is used to visualize the data side of Titokone's memory by showing its numeric contents and their symbolic equivalencies. |
(package private) java.lang.Object[] |
dataTableIdentifiers
|
(package private) javax.swing.JPopupMenu |
dataTablePopupMenu
|
(package private) javax.swing.JScrollPane |
dataTableScrollPane
This holds (@link dataTable dataTable). |
(package private) javax.swing.JButton |
enterNumberButton
This sends the number to GUIBrain, which checks if it's valid and then sends it to Titokone. |
private java.awt.event.ActionListener |
enterNumberButtonActionListener
|
(package private) javax.swing.JLabel |
enterNumberLabel
This is used to show for example errors, when an invalid number is given etc. |
(package private) javax.swing.JMenuItem |
eraseMem
|
private java.awt.event.ActionListener |
eraseMemoryActionListener
|
(package private) javax.swing.JMenu |
fileMenu
|
static short |
FP
|
private javax.swing.JFileChooser |
generalFileDialog
|
(package private) GUIBrain |
guibrain
|
(package private) javax.swing.JMenu |
helpMenu
|
static short |
INPUT_FIELD
|
(package private) javax.swing.JTextField |
inputField
The number that will be sent to Titokone as KBD data is given here. |
(package private) javax.swing.JPanel |
inputPanel
This holds (@link enterNumberLabel enterNumberLabel), (@link inputField inputField) and (@link enterNumberButton enterNumberButton). |
static short |
INSTRUCTIONS_AND_DATA_TABLE
Instructions and data table - used in centerToLine(), selectRow() and setGUIView() methods |
(package private) JTableX |
instructionsTable
This table is used to visualize the instructions side of Titokone's memory by showing its numeric contents and their symbolic equivalencies. |
(package private) java.lang.Object[] |
instructionsTableIdentifiers
|
(package private) javax.swing.JScrollPane |
instructionsTableScrollPane
This holds (@link instructionsTable instructionsTable) |
(package private) javax.swing.JPanel |
ioPanel
This holds (@link inputPanel) and (@link outputPanel). |
private javax.swing.filechooser.FileFilter |
K91FileFilter
|
(package private) javax.swing.JPanel |
leftPanel
What this holds, depends on the view of this gui. |
(package private) javax.swing.JToggleButton |
lineByLineToggleButton
|
private static int |
lineColumnSize
|
private java.util.logging.Logger |
logger
|
(package private) javax.swing.JSplitPane |
mainSplitPane
This holds (@link rightSplitPane rightSplitPane) and (@link leftPane leftPane). |
(package private) javax.swing.JMenuItem |
manual
|
private java.awt.event.ActionListener |
manualActionListener
|
private GUIHTMLDialog |
manualDialog
|
static short |
NONE
No table - used in setGUIView() method |
private static int |
numericValueColumnSize
|
static short |
OPEN_FILE_COMMAND
|
private java.awt.event.ActionListener |
openCommandActionListener
|
(package private) javax.swing.JMenuItem |
openFile
|
(package private) javax.swing.JButton |
openFileButton
|
static short |
OPTION_COMPILING_COMMENTED
commented compiling - used in setSelected() method |
static short |
OPTION_COMPILING_PAUSED
paused compiling - used in setSelected() method |
static short |
OPTION_RUNNING_ANIMATED
animated running - used in setSelected() method |
static short |
OPTION_RUNNING_COMMENTED
commented running - used in setSelected() method |
static short |
OPTION_RUNNING_PAUSED
paused running - used in setSelected() method |
(package private) javax.swing.JMenu |
optionsMenu
|
(package private) javax.swing.JPanel |
outputPanel
This holds (@link outputScrollPane). |
(package private) javax.swing.JScrollPane |
outputScrollPane
This holds (@link outputTextArea). |
(package private) javax.swing.JTextArea |
outputTextArea
This text area is used to visualize the output data that Titokone sends to CRT. |
static short |
PC
|
(package private) javax.swing.JMenuItem |
quit
|
private java.awt.event.ActionListener |
quitActionListener
|
static short |
R0
|
static short |
R1
|
static short |
R2
|
static short |
R3
|
static short |
R4
|
static short |
R5
|
static short |
R6
|
static short |
R7
|
(package private) JTableX |
registersTable
This table is used to visualize the contents of Titokone's registers. |
(package private) java.lang.Object[] |
registersTableIdentifiers
|
(package private) javax.swing.JScrollPane |
registersTableScrollPane
This holds @link registersTable. |
static java.lang.String |
resourceHomeDir
|
(package private) javax.swing.JSplitPane |
rightSplitPane
This holds (@link upperRightPanel upperRightPanel) and (@link commentListScrollPane commentListScrollPane). |
static short |
RUN_COMMAND
|
(package private) javax.swing.JButton |
runButton
|
private java.awt.event.ActionListener |
runCommandActionListener
|
(package private) javax.swing.JMenuItem |
runMenuItem
|
(package private) javax.swing.JMenuItem |
selectDefaultStdinFile
|
(package private) javax.swing.JMenuItem |
selectDefaultStdoutFile
|
(package private) javax.swing.JMenuItem |
selectLanguageFromFile
|
private java.awt.event.ActionListener |
selectLanguageFromFileActionListener
|
private java.awt.event.ActionListener |
selectStdinFileActionListener
|
private java.awt.event.ActionListener |
selectStdoutFileActionListener
|
(package private) javax.swing.JMenuItem |
setCompilingOptions
|
private java.awt.event.ActionListener |
setCompilingOptionsCommandActionListener
|
private GUICompileSettingsDialog |
setCompilingOptionsDialog
|
(package private) javax.swing.JMenu |
setLanguage
|
private java.awt.event.ActionListener |
setLanguageActionListener
|
(package private) javax.swing.JMenu |
setMemSize
|
(package private) javax.swing.JMenuItem |
setRunningOptions
|
private java.awt.event.ActionListener |
setRunningOptionsCommandActionListener
|
private GUIRunSettingsDialog |
setRunningOptionsDialog
|
(package private) javax.swing.JToggleButton |
showAnimationToggleButton
|
(package private) javax.swing.JToggleButton |
showCommentsToggleButton
|
static short |
SP
|
(package private) javax.swing.JLabel |
statusBar
|
static short |
STOP_COMMAND
|
(package private) javax.swing.JButton |
stopButton
|
private java.awt.event.ActionListener |
stopCommandActionListener
|
(package private) javax.swing.JMenuItem |
stopMenuItem
|
(package private) java.util.HashMap |
symbolsHashMap
This has symbol name as key and its row in the symbolTable as value. |
(package private) JTableX |
symbolTable
This table is used to visualize the symbols that are declared in source code, and their values. |
(package private) java.lang.Object[] |
symbolTableIdentifiers
|
(package private) javax.swing.JScrollPane |
symbolTableScrollPane
This holds (@link symbolTable symbolTable). |
private java.awt.Font |
tableFont
|
(package private) GUI |
thisGUI
|
(package private) javax.swing.JPanel |
upperRightPanel
This holds (@link registersTableScrollPane registersTableScrollPane), (@link symbolTableScrollPane symbolTableScrollPane) and (@link ioPanel ioPanel). |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
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.Window |
|
Fields inherited from class java.awt.Container |
|
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 | |
GUI()
|
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This is called when ActionEvent of some kind is fired. |
void |
addComment(java.lang.String comment)
Adds a comment into the comment list. |
void |
addOutputData(int outputValue)
Adds a number into the text area on the right side of the screen. |
boolean |
centerToLine(int line,
short table)
Sets the viewport of a certain table so that the given line is visible. |
void |
changeTextInEnterNumberLabel(java.lang.String newText)
Changes the text which is shown in KBD-frame above the text field. |
void |
disable(short command)
Disables a command. |
void |
enable(short command)
Enables a command. |
private void |
enterInput()
|
java.lang.String[] |
getCodeTableContents()
|
void |
hideAnimator()
|
private void |
initAnimator()
|
private void |
initGUI()
This is just a private assistance method for the creator. |
private void |
insertMenuBar(javax.swing.JFrame destFrame)
Inserts the menu into main window. |
boolean |
insertSymbolTable(java.lang.String[][] symbolsAndValues)
Inserts symbols and their values into symbol table. |
void |
insertToCodeTable(java.lang.String[] src)
Inserts data into code table. |
void |
insertToDataTable(int[] data,
java.lang.String[] symbolic)
Functionally this is exactly similar to insertToDataTable(String[]), but this just takes int[] as parameter. |
void |
insertToDataTable(java.lang.String[] dataContents)
Inserts data into data table. |
boolean |
insertToInstructionsTable(int[] binaryCommand,
java.lang.String[] symbolicCommand)
Functionality of this method is exactly similar to insertToInstructionsTable(String[],String[]), but here the first parameter's type is int[]. |
boolean |
insertToInstructionsTable(java.lang.String[] symbolicCommand)
Functionality of this method is exactly similar to insertToInstructionsTable(String[],String[]), but here the first parameter would be an array of empty Strings. |
boolean |
insertToInstructionsTable(java.lang.String[] binaryCommand,
java.lang.String[] symbolicCommand)
Inserts data to instructionsTable. |
private javax.swing.JToolBar |
makeToolBar()
This creates the toolbar of this program and returns it. |
private void |
print(java.lang.String message)
This method prints out startup messages. |
void |
resetAll()
GUIBrain can call this method to reset GUI, which means that all tables (except registers table) are emptied and all their rows are unselected. |
void |
selectLine(int line,
short table)
Selects a row from code table or from instructions and data table. |
void |
setEnabled(short command,
boolean b)
Enables or disables a given command. |
void |
setGUIView(int view)
|
void |
setSelected(short option,
boolean b)
Sets a certain option selected or unselected in GUI. |
void |
showAnimator()
|
void |
showError(java.lang.String errorMsg)
Shows an error in a message dialog. |
private int |
showOpenFileDialog()
This method uses the generalFileDialog as a k91/b91 file opening dialog. |
private int |
showSelectLanguageFileDialog()
This method uses the generalFileDialog as a language file choosing dialog. |
private int |
showSelectStdinDialog()
This method uses the generalFileDialog as a default stdin file choosing dialog. |
private int |
showSelectStdoutDialog()
This method uses the generalFileDialog as a default stdout file choosing dialog. |
void |
unselectAll()
Unselects all selected rows in every table. |
void |
updateAllTexts()
Updates all texts that are shown in GUI to be shown in current language. |
boolean |
updateInstructionsAndDataTableLine(int lineNumber,
int binaryCommand)
Functionality of this method is otherwise similar to updateInstructionsAndDataTableLine(int,int,String), but this one doesn't change the third column. |
boolean |
updateInstructionsAndDataTableLine(int lineNumber,
int binaryCommand,
java.lang.String symbolicCommand)
Updates contents of a line in either instructions table or data table. |
void |
updateReg(short reg,
int newValue)
Updates a value of a register in registersTable. |
void |
updateReg(short reg,
java.lang.Integer newValue)
Updates a register value. |
void |
updateRowInSymbolTable(java.lang.String symbolName,
java.lang.Integer symbolValue)
Updates the value of a symbol if it already exists, or adds a new row and inserts the symbol and its value there. |
void |
updateStatusBar(java.lang.String str)
Inserts a text into status bar at the bottom of the screen. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, 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, getBackground, 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, 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, isOpaque, 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, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
GUI thisGUI
GUIBrain guibrain
javax.swing.JSplitPane mainSplitPane
javax.swing.JPanel leftPanel
javax.swing.JSplitPane rightSplitPane
javax.swing.JPanel upperRightPanel
javax.swing.JScrollPane codeTableScrollPane
JTableX codeTable
java.lang.Object[] codeTableIdentifiers
javax.swing.JScrollPane instructionsTableScrollPane
JTableX instructionsTable
java.lang.Object[] instructionsTableIdentifiers
javax.swing.JScrollPane dataTableScrollPane
JTableX dataTable
java.lang.Object[] dataTableIdentifiers
javax.swing.JSplitPane dataAndInstructionsTableSplitPane
javax.swing.JScrollPane registersTableScrollPane
JTableX registersTable
java.lang.Object[] registersTableIdentifiers
javax.swing.JScrollPane symbolTableScrollPane
JTableX symbolTable
java.lang.Object[] symbolTableIdentifiers
java.util.HashMap symbolsHashMap
javax.swing.JPanel ioPanel
javax.swing.JPanel outputPanel
javax.swing.JScrollPane outputScrollPane
javax.swing.JTextArea outputTextArea
javax.swing.JPanel inputPanel
javax.swing.JLabel enterNumberLabel
javax.swing.JTextField inputField
javax.swing.JButton enterNumberButton
javax.swing.JScrollPane commentListScrollPane
javax.swing.JList commentList
javax.swing.JButton openFileButton
javax.swing.JButton compileButton
javax.swing.JButton runButton
javax.swing.JButton continueButton
javax.swing.JButton continueToEndButton
javax.swing.JButton stopButton
javax.swing.JToggleButton lineByLineToggleButton
javax.swing.JToggleButton showCommentsToggleButton
javax.swing.JToggleButton showAnimationToggleButton
javax.swing.JLabel statusBar
javax.swing.JPopupMenu dataTablePopupMenu
javax.swing.JMenu fileMenu
javax.swing.JMenuItem openFile
javax.swing.JMenuItem compileMenuItem
javax.swing.JMenuItem runMenuItem
javax.swing.JMenuItem continueMenuItem
javax.swing.JMenuItem continueToEndMenuItem
javax.swing.JMenuItem stopMenuItem
javax.swing.JMenuItem eraseMem
javax.swing.JMenuItem quit
javax.swing.JMenu optionsMenu
javax.swing.JMenu setMemSize
javax.swing.JMenu configureFileSystem
javax.swing.JMenuItem selectDefaultStdinFile
javax.swing.JMenuItem selectDefaultStdoutFile
javax.swing.JMenuItem setCompilingOptions
javax.swing.JMenuItem setRunningOptions
javax.swing.JMenuItem selectLanguageFromFile
javax.swing.JMenu setLanguage
javax.swing.JMenu helpMenu
javax.swing.JMenuItem manual
javax.swing.JMenuItem about
javax.swing.JFrame animatorFrame
Animator animator
javax.swing.JSlider animatorSpeedSlider
javax.swing.JButton animatorContinueButton
public static final int ANIMATOR_SPEED_MIN
public static final int ANIMATOR_SPEED_MAX
public static final short R0
public static final short R1
public static final short R2
public static final short R3
public static final short R4
public static final short R5
public static final short R6
public static final short R7
public static final short SP
public static final short FP
public static final short PC
public static final short COMPILE_COMMAND
public static final short RUN_COMMAND
public static final short STOP_COMMAND
public static final short CONTINUE_COMMAND
public static final short CONTINUE_WITHOUT_PAUSES_COMMAND
public static final short INPUT_FIELD
public static final short CODE_TABLE_EDITING
public static final short OPEN_FILE_COMMAND
private int activeView
private javax.swing.JFileChooser generalFileDialog
private GUIRunSettingsDialog setRunningOptionsDialog
private GUICompileSettingsDialog setCompilingOptionsDialog
private GUIHTMLDialog aboutDialog
private GUIHTMLDialog manualDialog
private java.awt.Font tableFont
private javax.swing.border.Border blacklined
private static final int COMMENT_LIST_SIZE
private java.util.logging.Logger logger
public static final java.lang.String resourceHomeDir
private static final int lineColumnSize
private static final int numericValueColumnSize
private static final int cellMargin
public static final short OPTION_COMPILING_PAUSED
public static final short OPTION_COMPILING_COMMENTED
public static final short OPTION_RUNNING_PAUSED
public static final short OPTION_RUNNING_COMMENTED
public static final short OPTION_RUNNING_ANIMATED
public static final short NONE
public static final short CODE_TABLE
public static final short INSTRUCTIONS_AND_DATA_TABLE
private java.awt.event.ActionListener openCommandActionListener
private java.awt.event.ActionListener selectStdinFileActionListener
private java.awt.event.ActionListener selectStdoutFileActionListener
private java.awt.event.ActionListener compileCommandActionListener
private java.awt.event.ActionListener runCommandActionListener
private java.awt.event.ActionListener continueCommandActionListener
private java.awt.event.ActionListener continueToEndCommandActionListener
private java.awt.event.ActionListener setRunningOptionsCommandActionListener
private java.awt.event.ActionListener setCompilingOptionsCommandActionListener
private java.awt.event.ActionListener stopCommandActionListener
private java.awt.event.ActionListener eraseMemoryActionListener
private java.awt.event.ActionListener setLanguageActionListener
private java.awt.event.ActionListener selectLanguageFromFileActionListener
private java.awt.event.ActionListener aboutActionListener
private java.awt.event.ActionListener manualActionListener
private java.awt.event.ActionListener enterNumberButtonActionListener
private java.awt.event.ActionListener quitActionListener
private javax.swing.filechooser.FileFilter B91FileFilter
private javax.swing.filechooser.FileFilter K91FileFilter
private javax.swing.filechooser.FileFilter classFileFilter
Constructor Detail |
public GUI()
Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void setGUIView(int view)
public void resetAll()
public void unselectAll()
public void updateStatusBar(java.lang.String str)
str
- The text to be inserted.public void updateReg(short reg, int newValue)
reg
- The register to be updated. Valid values are R1, R2, R3, R3, R4,
R5, R6, R7, SP and FP. (R6==SP and R7==FP).newValue
- The new value.public void updateReg(short reg, java.lang.Integer newValue)
reg
- The register to be updated.newValue
- The new value.public void insertToCodeTable(java.lang.String[] src)
src
- The data to be shown and one element corresponds to one line.public boolean insertToInstructionsTable(java.lang.String[] binaryCommand, java.lang.String[] symbolicCommand)
binaryCommand
- Contents of the second column.symbolicCommand
- Contents of the third column.
public boolean insertToInstructionsTable(int[] binaryCommand, java.lang.String[] symbolicCommand)
binaryCommand
- Contents of the second column.symbolicCommand
- Contents of the third column.
public boolean insertToInstructionsTable(java.lang.String[] symbolicCommand)
symbolicCommand
- Contents of the third column.
public boolean updateInstructionsAndDataTableLine(int lineNumber, int binaryCommand, java.lang.String symbolicCommand)
lineNumber
- The line number of the row to update. Lines 0...N are rows in instructionsTable
and lines N+1...N+P are rows in dataTable, where N is the row count of
instructionsTable and P is the row count of dataTable.binaryCommand
- The content of the node in the second column.symbolicCommand
- The content of the node in the third column.public boolean updateInstructionsAndDataTableLine(int lineNumber, int binaryCommand)
lineNumber
- The line number of the row to update. Lines 0...N are rows in instructionsTable
and lines N+1...N+P are rows in dataTable, where N is the row count of
instructionsTable and P is the row count of dataTable.binaryCommand
- The content of the node in the second column.
public void insertToDataTable(java.lang.String[] dataContents)
dataContents
- Contents of the second column.public void insertToDataTable(int[] data, java.lang.String[] symbolic)
data
- Contents of the second column.public boolean insertSymbolTable(java.lang.String[][] symbolsAndValues)
symbolsAndValues
- A symbol's name is given in symbolsAndValues[x][0] and
its value in symbolsAndValues[x][1].
This can be null, in which case symbol table will be
set empty.
public void updateRowInSymbolTable(java.lang.String symbolName, java.lang.Integer symbolValue)
public void addComment(java.lang.String comment)
public void addOutputData(int outputValue)
public void setEnabled(short command, boolean b)
command
- The command to be set. It can be RUN_COMMAND, STOP_COMMAND,
COMPILE_COMMAND, CONTINUE_COMMAND, CONTINUE_WITHOUT_PAUSES_COMMAND
INPUT_FIELD.b
- 'True' to enable the command. 'False' to disable it.public void enable(short command)
command
- The command to be enabled. It can be RUN_COMMAND, STOP_COMMAND,
COMPILE_COMMAND, CONTINUE_COMMAND, CONTINUE_WITHOUT_PAUSES_COMMAND
INPUT_FIELD.public void disable(short command)
command
- The command to be Disabled. It can be RUN_COMMAND, STOP_COMMAND,
COMPILE_COMMAND, CONTINUE_COMMAND, CONTINUE_WITHOUT_PAUSES_COMMAND
INPUT_FIELD.public void setSelected(short option, boolean b)
public boolean centerToLine(int line, short table)
line
- Number of the line, that is wanted to be visible.table
- The table. Valid values for this parameter are CODE_TABLE
and INSTRUCTIONS_AND_DATA_TABLE
public void selectLine(int line, short table)
table
- The desired table. Proper values are CODE_TABLE and
INSTRUCTIONS_AND_DATA_TABLE.line
- Line to be selected.public void showAnimator()
public void hideAnimator()
public void changeTextInEnterNumberLabel(java.lang.String newText)
newText
- The new text to be shown. If this is empty, then the label
will disappear.public void updateAllTexts()
public void showError(java.lang.String errorMsg)
errorMsg
- The message to be shown.public java.lang.String[] getCodeTableContents()
private void initGUI()
private void enterInput()
private void initAnimator()
private void insertMenuBar(javax.swing.JFrame destFrame)
destFrame
- The frame the menu bar will be inserted.private javax.swing.JToolBar makeToolBar()
private int showOpenFileDialog()
private int showSelectStdinDialog()
private int showSelectStdoutDialog()
private int showSelectLanguageFileDialog()
private void print(java.lang.String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |