Package mars.venus
Class MessagesPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTabbedPane
mars.venus.MessagesPane
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,SwingConstants
Creates the message window at the bottom of the UI.
- Author:
- Team JSpim
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
static int
Fields inherited from class javax.swing.JTabbedPane
SCROLL_TAB_LAYOUT, WRAP_TAB_LAYOUT
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the class, sets up two fresh tabbed text areas for program feedback. -
Method Summary
Modifier and TypeMethodDescriptionReturns component used to display assembler messagesgetInputString(int maxLen)
Method used by the SystemIO class to get interactive user input requested by a running MIPS program (e.g. syscall #5 to read an integer).getInputString(String prompt)
Method used by the SystemIO class to get interactive user input requested by a running MIPS program (e.g. syscall #5 to read an integer).Returns component used to display runtime messagesvoid
postMarsMessage(String message)
Post a message to the assembler displayvoid
postRunMessage(String message)
Post a message to the runtime displayvoid
selectEditorTextLine(String fileName, int line, int column)
Will select the specified line in an editor tab.void
selectErrorMessage(String fileName, int line, int column)
Will select the Mars Messages tab error message that matches the given specifications, if it is found.void
Make the assembler message tab current (up front)void
Make the runtime message tab current (up front)Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
addContainerListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, getName, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, 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
-
MAXIMUM_SCROLLED_CHARACTERS
public static final int MAXIMUM_SCROLLED_CHARACTERS -
NUMBER_OF_CHARACTERS_TO_CUT
public static final int NUMBER_OF_CHARACTERS_TO_CUT
-
-
Constructor Details
-
MessagesPane
public MessagesPane()Constructor for the class, sets up two fresh tabbed text areas for program feedback.
-
-
Method Details
-
selectErrorMessage
Will select the Mars Messages tab error message that matches the given specifications, if it is found. Matching is done by constructing a string using the parameter values and searching the text area for the last occurrence of that string.- Parameters:
fileName
- A String containing the file path name.line
- Line number for error messagecolumn
- Column number for error message
-
selectEditorTextLine
Will select the specified line in an editor tab. If the file is open but not current, its tab will be made current. If the file is not open, it will be opened in a new tab and made current, however the line will not be selected (apparent apparent problem with JEditTextArea).- Parameters:
fileName
- A String containing the file path name.line
- Line number for error messagecolumn
- Column number for error message
-
getAssembleTextArea
Returns component used to display assembler messages- Returns:
- assembler message text component
-
getRunTextArea
Returns component used to display runtime messages- Returns:
- runtime message text component
-
postMarsMessage
Post a message to the assembler display- Parameters:
message
- String to append to assembler display text
-
postRunMessage
Post a message to the runtime display- Parameters:
message
- String to append to runtime display text
-
selectMarsMessageTab
public void selectMarsMessageTab()Make the assembler message tab current (up front) -
selectRunMessageTab
public void selectRunMessageTab()Make the runtime message tab current (up front) -
getInputString
Method used by the SystemIO class to get interactive user input requested by a running MIPS program (e.g. syscall #5 to read an integer). SystemIO knows whether simulator is being run at command line by the user, or by the GUI. If run at command line, it gets input from System.in rather than here. This is an overloaded method. This version, with the String parameter, is used to get input from a popup dialog.- Parameters:
prompt
- Prompt to display to the user.- Returns:
- User input.
-
getInputString
Method used by the SystemIO class to get interactive user input requested by a running MIPS program (e.g. syscall #5 to read an integer). SystemIO knows whether simulator is being run at command line by the user, or by the GUI. If run at command line, it gets input from System.in rather than here. This is an overloaded method. This version, with the int parameter, is used to get input from the MARS Run I/O window.- Parameters:
maxLen
- : maximum length of input. This method returns when maxLen characters have been read. Use -1 for no length restrictions.- Returns:
- User input.
-