hades.models.mcore
Class DcoreDisassemblerOrHexCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byhades.gui.MemoryHexEditorField
                  extended byhades.models.mcore.DcoreDisassemblerOrHexCanvas
All Implemented Interfaces:
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 DcoreDisassemblerOrHexCanvas
extends MemoryHexEditorField

A canvas to display either raw D*CORE memory contents (hex format) or a list of disassembled D*CORE instructions. This class can only be used to visualize 16-bit wide memory, where all accesses are word-aligned (two-byte boundaries).

The following list describes the editing functions of MemoryHexEditorField:

Add your own objects as ActionListeners for all value changes on a MemoryHexEditorField by calling MemoryHexEditorField.addActionListener().

Note that MemoryHexEditorField currently uses class java.lang.Long to parse hexadecimal numbers, which are therefore assumed to be signed. This may lead to surprising behaviour when tried on 64-bit registers, but it should work ok with registers from 1 to 63 bits. Please complain to Javasoft that we do need unsigned integers after all...

See Also:
Serialized Form

Nested Class Summary
(package private)  class DcoreDisassemblerOrHexCanvas.SelftestAdapter
           
 
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
 
Fields inherited from class hades.gui.MemoryHexEditorField
actionListenerTable, addrColor, backgroundColor, cursor_x, cursor_y, data, dataColor, debug, initialized, memoryObject, n_bits_per_word, n_words_per_row, readHighlightAddress, readHighlightColor, shiftMode, visibleWordsPerRow, writeHighlightAddress, writeHighlightColor, 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
DcoreDisassemblerOrHexCanvas(Memory _memory, DcoreDecoder _decoder, int _words_per_row, int _words_per_instruction)
           
 
Method Summary
protected  int getAddrAreaEnd()
           
protected  int getColumns()
           
protected  int getDataAreaBegin()
           
 java.awt.Dimension getPreferredSize()
          return the Dimension of 60 chars width and 32 lines
protected  int getRows()
           
protected  int getWordsPerInstruction()
           
protected  int getWordsPerRow()
           
 void init()
           
static void main(java.lang.String[] argv)
           
 void paint(java.awt.Graphics systemGraphics)
          paint the memory contents in hex or disassembler format
 void selectDisassembledFormat()
           
 void selectHexFormat()
           
 void setTextFont(java.awt.Font f)
           
 
Methods inherited from class hades.gui.MemoryHexEditorField
addActionListener, checkInit, clip, decrementValue, editStartAddress, getAddrColor, getAddrFieldWidth, getAddrFromCursorPosition, getBackground, getCursor_x, getCursor_y, getData, getDataColor, getDataFieldWidth, getMinimumSize, getMinimumSize, getPreferredScrollableViewportSize, getReadHightlightAddress, getReadHightlightColor, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTextFont, getWriteHightlightAddress, getWriteHightlightColor, incrementValue, insertDigitAtMousePosition, isCursorInAddrArea, isCursorInDataArea, isHexDigit, isOpaque, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveCursorRight, moveCursorTo, moveTabNext, moveTabNextOLD, moveTabPrev, moveTabPrevOLD, msg, notifyListeners, paintAllAddresses, paintAllAddressesNoClip, paintBackgroundAndBorder, paintBackgroundAndBorderNoClip, paintCursor, prepareGUI, 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
 

Constructor Detail

DcoreDisassemblerOrHexCanvas

public DcoreDisassemblerOrHexCanvas(Memory _memory,
                                    DcoreDecoder _decoder,
                                    int _words_per_row,
                                    int _words_per_instruction)
Method Detail

setTextFont

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

selectHexFormat

public void selectHexFormat()

selectDisassembledFormat

public void selectDisassembledFormat()

paint

public void paint(java.awt.Graphics systemGraphics)
paint the memory contents in hex or disassembler format

Overrides:
paint in class MemoryHexEditorField

getPreferredSize

public java.awt.Dimension getPreferredSize()
return the Dimension of 60 chars width and 32 lines

Overrides:
getPreferredSize in class MemoryHexEditorField

main

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

init

public void init()
Overrides:
init in class MemoryHexEditorField

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

getDataAreaBegin

protected int getDataAreaBegin()
Overrides:
getDataAreaBegin in class MemoryHexEditorField

getWordsPerRow

protected int getWordsPerRow()
Overrides:
getWordsPerRow in class MemoryHexEditorField

getWordsPerInstruction

protected int getWordsPerInstruction()
Overrides:
getWordsPerInstruction in class MemoryHexEditorField