hades.models.rtlib.memory
Class MRCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byhades.gui.MemoryHexEditorField
                  extended byhades.models.rtlib.memory.MRCanvas
All Implemented Interfaces:
ContextToolTip, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, javax.swing.Scrollable, java.io.Serializable

public class MRCanvas
extends MemoryHexEditorField
implements java.awt.event.KeyListener, java.awt.event.MouseListener, ContextToolTip

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
protected  int[] field_x
           
protected  int label_x
           
protected  int n_fields
           
protected  java.awt.Font textFont
           
 
Fields inherited from class hades.gui.MemoryHexEditorField
actionListenerTable, addrColor, backgroundColor, baseline, border_height, border_width, char_height, char_width, cursor_x, cursor_y, data, dataColor, debug, dx_data, height, initialized, memoryObject, n_bits_per_word, n_chars_per_addr, n_chars_per_word, n_columns, n_rows, n_words, n_words_per_row, readHighlightAddress, readHighlightColor, shiftMode, visibleWordsPerRow, width, writeHighlightAddress, writeHighlightColor, x0_addr, x0_data, y0_addr, y0_data
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MRCanvas(MR _microRom, int n_words_per_row)
           
 
Method Summary
protected  void decrementValue()
           
protected  int getAddrAreaEnd()
           
protected  int getColumns()
           
(package private)  int getFieldStartPixelX(int j)
          calculate the x pixel coordinate for the first char of field j of the microprogram data
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
protected  int getRows()
           
 java.lang.String getToolTip(java.awt.Point p, long millis)
          get the message to display as a tool tip, depending on the current position of the cursor, and the elapsed idle time in milliseconds.
protected  void incrementValue()
           
 void init()
           
protected  void insertDigitAtMousePosition(char c)
          insert char c at the current cursor postion, then move the cursor to the right.
protected  boolean isCursorInDataArea()
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
static void main(java.lang.String[] argv)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
protected  void moveTabNext()
           
protected  void moveTabPrev()
           
static void msg(java.lang.String s)
           
 void paint(java.awt.Graphics systemGraphics)
           
 void paintAllAddresses(java.awt.Graphics g)
           
 void paintAllData(java.awt.Graphics g)
           
protected  void prepareGUI()
           
 void setTextFont(java.awt.Font f)
           
 
Methods inherited from class hades.gui.MemoryHexEditorField
addActionListener, checkInit, clip, editStartAddress, getAddrColor, getAddrFieldWidth, getAddrFromCursorPosition, getBackground, getCursor_x, getCursor_y, getData, getDataAreaBegin, getDataColor, getDataFieldWidth, getMinimumSize, getPreferredScrollableViewportSize, getReadHightlightAddress, getReadHightlightColor, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTextFont, getWordsPerInstruction, getWordsPerRow, getWriteHightlightAddress, getWriteHightlightColor, isCursorInAddrArea, isHexDigit, isOpaque, keyPressed, keyReleased, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, moveCursorRight, moveCursorTo, moveTabNextOLD, moveTabPrevOLD, notifyListeners, paintAllAddressesNoClip, paintBackgroundAndBorder, paintBackgroundAndBorderNoClip, paintCursor, removeActionListener, setAddrColor, setBackground, setCursorFromMousePosition, setData, setDataColor, setReadHighlightAddress, setReadHighlightColor, setWriteHighlightAddress, setWriteHighlightColor, update
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mouseReleased
 

Field Detail

n_fields

protected int n_fields

label_x

protected int label_x

field_x

protected int[] field_x

textFont

protected java.awt.Font textFont
Constructor Detail

MRCanvas

public MRCanvas(MR _microRom,
                int n_words_per_row)
Method Detail

getFieldStartPixelX

int getFieldStartPixelX(int j)
calculate the x pixel coordinate for the first char of field j of the microprogram data


prepareGUI

protected void prepareGUI()
Overrides:
prepareGUI in class MemoryHexEditorField

init

public void init()
Overrides:
init in class MemoryHexEditorField

setTextFont

public void setTextFont(java.awt.Font f)
Overrides:
setTextFont in class MemoryHexEditorField

paintAllAddresses

public void paintAllAddresses(java.awt.Graphics g)
Overrides:
paintAllAddresses in class MemoryHexEditorField

paintAllData

public void paintAllData(java.awt.Graphics g)

paint

public void paint(java.awt.Graphics systemGraphics)
Overrides:
paint in class MemoryHexEditorField

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class MemoryHexEditorField

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class MemoryHexEditorField

isCursorInDataArea

protected boolean isCursorInDataArea()
Overrides:
isCursorInDataArea in class MemoryHexEditorField

moveTabNext

protected void moveTabNext()
Overrides:
moveTabNext in class MemoryHexEditorField

moveTabPrev

protected void moveTabPrev()
Overrides:
moveTabPrev in class MemoryHexEditorField

incrementValue

protected void incrementValue()
Overrides:
incrementValue in class MemoryHexEditorField

decrementValue

protected void decrementValue()
Overrides:
decrementValue in class MemoryHexEditorField

insertDigitAtMousePosition

protected void insertDigitAtMousePosition(char c)
insert char c at the current cursor postion, then move the cursor to the right. If the cursor is at the rightmost position, we begin to shift the current value to the left.

If the cursor is in the address field instead of the data field, we jump to the corresponding address (that is, display the corres- ponding area of the memory).

Overrides:
insertDigitAtMousePosition in class MemoryHexEditorField

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class MemoryHexEditorField

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener
Overrides:
keyTyped in class MemoryHexEditorField

getToolTip

public java.lang.String getToolTip(java.awt.Point p,
                                   long millis)
Description copied from interface: ContextToolTip
get the message to display as a tool tip, depending on the current position of the cursor, and the elapsed idle time in milliseconds.

Naturally, both the position and millis parameters simply may be ignored by classes implementing this interface.

Specified by:
getToolTip in interface ContextToolTip

msg

public static void msg(java.lang.String s)

main

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

getColumns

protected int getColumns()
Overrides:
getColumns in class MemoryHexEditorField

getRows

protected int getRows()
Overrides:
getRows in class MemoryHexEditorField

getAddrAreaEnd

protected int getAddrAreaEnd()
Overrides:
getAddrAreaEnd in class MemoryHexEditorField