|
||||||||||
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.HexTextField
HexTextField - an interactive TextField to display and edit hexadecimal numbers, like register-contents.
The following list describes the editing functions of HexTextField:
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 HexTextField by calling HexTextField.addActionListener(). The ActionEvents generated by HexTextField contain a String with the current value as their argument. Call getValue() and setValue() to retrieve and set the numerical value managed by HexTextField directly.
Note that HexTextField 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.awt.Color |
backgroundColor
|
protected int |
baseline
|
protected int |
border_height
|
protected int |
border_width
|
protected int |
char_height
|
protected int |
char_width
|
protected int |
height
|
protected java.awt.Color |
highlightColor
|
protected int |
n_chars
|
protected int |
n_cursor
|
protected java.awt.Image |
offscreenBuffer
|
protected boolean |
shiftMode
|
protected java.lang.String |
svalue
|
protected java.awt.Color |
textColor
|
protected java.awt.Font |
textFont
|
protected long |
value
|
protected int |
width
|
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 | |
HexTextField(int n_chars)
|
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener AL)
|
protected void |
createOffscreenBuffer()
|
void |
decrementValue()
|
protected java.lang.String |
getHexString()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.awt.Font |
getTextFont()
|
protected long |
getValue()
|
void |
incrementValue()
|
void |
insertDigitAtMousePosition(char c)
insert char c at the current cursor postion, then move the cursor to the right. |
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 |
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 |
moveCursorLeft()
|
void |
moveCursorRight()
|
static void |
msg(java.lang.String msg)
|
protected void |
notifyListeners()
|
void |
paint(java.awt.Graphics g)
|
protected void |
prepareGUI()
|
void |
removeActionListener(java.awt.event.ActionListener AL)
|
void |
setCursorFromMousePosition(java.awt.event.MouseEvent me)
|
void |
setDigitAtMousePosition(char c)
|
void |
setTextFont(java.awt.Font f)
|
protected void |
setValue(long value)
|
Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
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, getBackground, 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, setBackground, 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 |
protected long value
protected java.lang.String svalue
protected java.util.Hashtable actionListenerTable
protected java.awt.Font textFont
protected java.awt.Color backgroundColor
protected java.awt.Color textColor
protected java.awt.Color highlightColor
protected java.awt.Image offscreenBuffer
protected int n_chars
protected int n_cursor
protected int char_width
protected int char_height
protected int baseline
protected int border_width
protected int border_height
protected int width
protected int height
protected boolean shiftMode
Constructor Detail |
public HexTextField(int n_chars)
Method Detail |
protected long getValue()
protected void setValue(long value)
protected void notifyListeners()
public void addActionListener(java.awt.event.ActionListener AL)
public void removeActionListener(java.awt.event.ActionListener AL)
protected java.lang.String getHexString()
protected void prepareGUI()
public void setTextFont(java.awt.Font f)
public java.awt.Font getTextFont()
protected void createOffscreenBuffer()
public void paint(java.awt.Graphics g)
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public void setCursorFromMousePosition(java.awt.event.MouseEvent me)
public void moveCursorRight()
public void moveCursorLeft()
public void incrementValue()
public void decrementValue()
public void setDigitAtMousePosition(char c)
public void insertDigitAtMousePosition(char c)
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 |