|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
hades.gui.MicroRomEditorCanvas
MicroRomEditorCanvas - a hex-style editor for direct editing of microprogram contents. The memory data is expected to consist of an array of long[] for the ROM data (allowing for up to 64 bits output) and an array String[] for state comments and labels.
The current data-structures support memories of n_words (that is, address range 0 .. n_words-1) of n_bits_per_word each, where n_bits_per_word may be anything between 1 .. 64 bits. However, note that integers and longs in Java are signed, so that it may a bit inconvenient to actually use 64 bit values.
The following list describes the editing functions of MicroRomEditorCanvas:
Subsequent key and mouse events are then applied to the digit at the cursor position.
Add your own objects as ActionListeners for all value changes on a MicroRomEditorCanvas by calling MicroRomEditorCanvas.addActionListener().
Note that MicroRomEditorCanvas 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...
Nested Class Summary |
Nested classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.util.Hashtable |
actionListenerTable
|
protected java.lang.String[] |
addrCache
|
protected java.awt.Color |
addrColor
|
protected java.awt.Color |
backgroundColor
|
protected int |
baseline
|
protected int |
border_height
|
protected int |
border_width
|
protected int |
char_height
|
protected int |
char_width
|
protected int |
cursor_x
|
protected int |
cursor_y
|
protected long[] |
data
|
protected java.lang.String[] |
dataCache
|
protected java.awt.Color |
dataColor
|
static boolean |
debug
|
protected int |
dx_data
|
protected int |
end_address
|
protected int |
height
|
protected int |
n_bits_per_word
|
protected int |
n_chars
|
protected int |
n_chars_per_addr
|
protected int |
n_chars_per_word
|
protected int |
n_columns
|
protected int |
n_cursor
|
protected int |
n_rows
|
protected int |
n_words
|
protected int |
n_words_per_row
|
protected int |
n_words_per_screen
|
protected java.awt.Image |
offscreenBuffer
|
protected java.awt.Graphics |
offscreenGraphics
|
protected int |
readHighlightAddress
|
protected java.awt.Color |
readHighlightColor
|
protected java.awt.Scrollbar |
scroller
|
protected boolean |
shiftMode
|
protected int |
start_address
|
protected java.awt.Font |
textFont
|
protected int |
value
|
protected int |
width
|
protected int |
writeHighlightAddress
|
protected java.awt.Color |
writeHighlightColor
|
protected int |
x0_addr
|
protected int |
x0_data
|
protected int |
y0_addr
|
protected int |
y0_data
|
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 | |
MicroRomEditorCanvas(long[] data,
int n_words,
int n_bits_per_word,
int n_rows,
int n_words_per_row)
|
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener AL)
|
void |
blitOffscreenBuffer(java.awt.Graphics g)
|
int |
clip(int currentValue,
int minValue,
int maxValue)
|
protected void |
createOffscreenBuffer()
|
void |
decrementValue()
|
void |
editStartAddress(char c)
|
java.awt.Color |
getAddrColor()
|
protected int |
getAddrFieldWidth(int n_words)
calculate the number of chars required to display an hex-address for a memory with n_words. |
int |
getAddrFromCursorPosition()
|
java.awt.Color |
getBackground()
|
int |
getCursorAddrIndex()
|
protected long |
getData(int addr)
|
java.awt.Color |
getDataColor()
|
protected int |
getDataFieldWidth(int n_bits_per_word)
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.awt.Color |
getReadHightlightColor()
|
int |
getRelativeDataCursor()
this method returns the relative cursor position for the data value value nearest to the cursor. |
java.awt.Font |
getTextFont()
|
java.awt.Color |
getWriteHightlightColor()
|
void |
incrementValue()
|
void |
insertDigitAtMousePosition(char c)
insert char c at the current cursor postion, then move the cursor to the right. |
boolean |
isCursorInAddrArea()
|
boolean |
isCursorInDataArea()
|
boolean |
isDataVisibleAtAddress(int addr)
|
static boolean |
isHexDigit(char c)
|
void |
keyPressed(java.awt.event.KeyEvent ke)
|
void |
keyReleased(java.awt.event.KeyEvent ke)
|
void |
keyTyped(java.awt.event.KeyEvent ke)
|
static void |
main(java.lang.String[] argv)
|
void |
makeDataVisibleAtAddress(int addr)
|
void |
mouseClicked(java.awt.event.MouseEvent me)
|
void |
mouseDragged(java.awt.event.MouseEvent me)
|
void |
mouseEntered(java.awt.event.MouseEvent me)
|
void |
mouseExited(java.awt.event.MouseEvent me)
|
void |
mouseMoved(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
mouseReleased(java.awt.event.MouseEvent me)
|
void |
moveCursorDown()
|
void |
moveCursorLeft()
|
void |
moveCursorRight()
|
void |
moveCursorTo(int x,
int y)
|
void |
moveCursorToDataAtAddr(int addr)
|
void |
moveCursorUp()
|
void |
moveEnd()
|
void |
moveHome()
|
void |
moveLineDown()
|
void |
moveLineUp()
|
void |
movePageDown()
|
void |
movePageUp()
|
void |
moveTabNext()
|
void |
moveTabPrev()
|
void |
moveToAddress(int addr)
|
static void |
msg(java.lang.String msg)
|
protected void |
notifyListeners(int addr,
long value)
|
void |
notifyScroller()
|
void |
paint(java.awt.Graphics systemGraphics)
|
void |
paintAllAddresses(java.awt.Graphics g)
|
void |
paintAllData(java.awt.Graphics g)
|
void |
paintBackgroundAndBorder(java.awt.Graphics g)
|
void |
paintCursor(java.awt.Graphics g)
|
void |
paintHighlighting(java.awt.Graphics g)
|
void |
paintStringAtAddr(java.awt.Graphics g,
int addr,
java.lang.String s)
|
protected void |
prepareGUI()
|
void |
removeActionListener(java.awt.event.ActionListener AL)
|
void |
setAddrColor(java.awt.Color c)
|
void |
setBackground(java.awt.Color c)
|
void |
setCursorFromMousePosition(java.awt.event.MouseEvent me)
|
protected void |
setData(int addr,
long value)
|
void |
setDataColor(java.awt.Color c)
|
void |
setDigitAtMousePosition(char c)
|
void |
setReadHighlightAddress(int addr)
set the address of the last read access to the underlying memory. |
void |
setReadHighlightColor(java.awt.Color c)
|
void |
setScroller(java.awt.Scrollbar scroller)
|
void |
setTextFont(java.awt.Font f)
|
void |
setWriteHighlightAddress(int addr)
set the address of the last write access to the underlying memory. |
void |
setWriteHighlightColor(java.awt.Color c)
|
void |
update(java.awt.Graphics g)
|
Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean debug
protected int n_words
protected int n_bits_per_word
protected long[] data
protected java.lang.String[] addrCache
protected java.lang.String[] dataCache
protected java.util.Hashtable actionListenerTable
protected java.awt.Font textFont
protected java.awt.Color backgroundColor
protected java.awt.Color dataColor
protected java.awt.Color addrColor
protected java.awt.Color readHighlightColor
protected java.awt.Color writeHighlightColor
protected java.awt.Image offscreenBuffer
protected java.awt.Graphics offscreenGraphics
protected java.awt.Scrollbar scroller
protected int n_columns
protected int n_rows
protected int n_words_per_row
protected int n_chars_per_word
protected int n_chars_per_addr
protected int n_words_per_screen
protected int char_width
protected int char_height
protected int baseline
protected int x0_addr
protected int x0_data
protected int y0_addr
protected int y0_data
protected int dx_data
protected int border_width
protected int border_height
protected int width
protected int height
protected int start_address
protected int end_address
protected int cursor_x
protected int cursor_y
protected int n_cursor
protected int n_chars
protected int value
protected boolean shiftMode
protected int readHighlightAddress
protected int writeHighlightAddress
Constructor Detail |
public MicroRomEditorCanvas(long[] data, int n_words, int n_bits_per_word, int n_rows, int n_words_per_row)
Method Detail |
public void setBackground(java.awt.Color c)
public void setDataColor(java.awt.Color c)
public void setAddrColor(java.awt.Color c)
public void setReadHighlightColor(java.awt.Color c)
public void setWriteHighlightColor(java.awt.Color c)
public java.awt.Color getBackground()
public java.awt.Color getDataColor()
public java.awt.Color getAddrColor()
public java.awt.Color getReadHightlightColor()
public java.awt.Color getWriteHightlightColor()
public void setReadHighlightAddress(int addr)
public void setWriteHighlightAddress(int addr)
protected int getAddrFieldWidth(int n_words)
protected int getDataFieldWidth(int n_bits_per_word)
protected long getData(int addr)
protected void setData(int addr, long value)
protected void notifyListeners(int addr, long value)
public void addActionListener(java.awt.event.ActionListener AL)
public void removeActionListener(java.awt.event.ActionListener AL)
protected void prepareGUI()
public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font f)
protected void createOffscreenBuffer()
public void blitOffscreenBuffer(java.awt.Graphics g)
public void paintBackgroundAndBorder(java.awt.Graphics g)
public void paintAllAddresses(java.awt.Graphics g)
public void paintAllData(java.awt.Graphics g)
public void paintStringAtAddr(java.awt.Graphics g, int addr, java.lang.String s)
public void paintHighlighting(java.awt.Graphics g)
public void paintCursor(java.awt.Graphics g)
public void update(java.awt.Graphics g)
public void paint(java.awt.Graphics systemGraphics)
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public void setCursorFromMousePosition(java.awt.event.MouseEvent me)
public boolean isCursorInDataArea()
public boolean isCursorInAddrArea()
public boolean isDataVisibleAtAddress(int addr)
public void makeDataVisibleAtAddress(int addr)
public int getRelativeDataCursor()
public int getAddrFromCursorPosition()
public int getCursorAddrIndex()
public int clip(int currentValue, int minValue, int maxValue)
public void moveCursorTo(int x, int y)
public void moveCursorRight()
public void moveCursorLeft()
public void moveCursorUp()
public void moveCursorDown()
public void movePageUp()
public void movePageDown()
public void moveLineUp()
public void moveLineDown()
public void moveHome()
public void moveEnd()
public void moveToAddress(int addr)
public void moveCursorToDataAtAddr(int addr)
public void moveTabNext()
public void moveTabPrev()
public void notifyScroller()
public void setScroller(java.awt.Scrollbar scroller)
public void incrementValue()
public void decrementValue()
public void setDigitAtMousePosition(char c)
public void editStartAddress(char c)
public void insertDigitAtMousePosition(char c)
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).
public static boolean isHexDigit(char c)
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent me)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent me)
mouseExited
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent me)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent ke)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent ke)
keyTyped
in interface java.awt.event.KeyListener
public static void msg(java.lang.String msg)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |