|
||||||||||
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.StimuliEditorCanvas
StimuliEditorCanvas - display and edit simulation stimuli.
This class provides a simple editor for simulation stimuli in the IEEE std_logic_1164 logic model realized by values of class hades.models.StdLogic1164. The canvas manages and displays a user-specified number of separate outputs, one output per row. Each row consists of a user-specified number of time steps, with one StdLogic1164 value per output per time-step.
See the (minimal) external documentation provided in /hades/doc/help/StimuliEditor.txt for the list of mouse and key commands recognized by StimuliEditor.
StimuliEditorCanvas is not resizable. The correct size is calculated during GUI construction based on the selected text font and the number of visible rows and time steps. The dimension is updated by calling setTextFont() followed by an invalidate()/layout().
Optionally, the StimuliEditorCanvas may be used together with an external Scrollbar to manage scrolling through the stimuli data when the total number of time steps is larger than the number of visible time steps. Just register the Scrollbar by calling setScroller().
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 | |
(package private) static java.awt.Color[] |
_colorTable
|
(package private) static java.awt.Color |
_darkBlue
|
protected java.util.Hashtable |
actionListenerTable
|
protected java.lang.String[] |
addrCache
|
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 java.awt.Point |
currentMousePosition
|
protected int |
cursor_x
|
protected int |
cursor_y
|
protected java.awt.Color |
cursorColor
|
protected java.lang.String[] |
dataCache
|
protected java.awt.Color |
dataColor
|
static boolean |
debug
|
protected java.awt.Point |
dragStartPosition
|
protected int |
dx_data
|
protected int |
end_address
|
protected int |
height
|
protected int |
lastDragCycle
|
protected int |
n_chars
|
protected int |
n_chars_per_addr
|
protected int |
n_chars_per_cycle
|
protected int |
n_columns
|
protected int |
n_cursor
|
protected int |
n_cycles
|
protected int |
n_cycles_per_row
|
protected int |
n_outputs
|
protected int |
n_rows
|
protected java.awt.Image |
offscreenBuffer
|
protected java.awt.Graphics |
offscreenGraphics
|
protected int |
readHighlightAddress
|
protected java.awt.Color |
readHighlightColor
|
protected java.awt.Point |
regionEndPoint
|
protected java.awt.Point |
regionStartPoint
|
protected java.awt.Scrollbar |
scroller
|
protected java.awt.Color |
signalNameColor
|
protected int |
start_cycle
|
protected Stimulus |
stimulus
|
protected java.awt.Font |
textFont
|
protected java.awt.Color |
timeColor
|
protected int |
value
|
protected int |
width
|
protected int |
writeHighlightAddress
|
protected java.awt.Color |
writeHighlightColor
|
protected int |
x0_addr
|
protected int |
x0_data
|
protected int |
x0_time
|
protected int |
y0_addr
|
protected int |
y0_data
|
protected int |
y0_time
|
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 | |
StimuliEditorCanvas(Stimulus stimulus,
int n_cycles_per_row)
|
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener AL)
|
void |
backSpace()
|
void |
blitOffscreenBuffer(java.awt.Graphics g)
|
void |
changeDataAtMousePosition(char c)
insert char c at the current cursor postion, then move the cursor to the right. |
int |
clip(int currentValue,
int minValue,
int maxValue)
|
protected void |
createOffscreenBuffer()
|
void |
decrementValue()
|
void |
deleteDataAtCursor()
|
void |
editStartAddress(char c)
|
java.awt.Color |
getAddrColor()
|
java.awt.Color |
getBackground()
|
int |
getCursorAddrIndex()
|
int |
getCursorCycle()
|
int |
getCursorRow()
|
protected int |
getCursorX(int mouse_x)
|
protected int |
getCursorY(int mouse_y)
|
int |
getCycleFromCursorPosition()
|
java.awt.Color |
getDataColor()
|
java.awt.Color |
getDataColor1164(int value)
|
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 |
getTimeColor()
|
java.awt.Color |
getWriteHightlightColor()
|
void |
incrementValue()
|
void |
incrementValueAll1164()
|
void |
insertDataAtCursor()
|
boolean |
isCursorInAddrArea()
|
boolean |
isCursorInDataArea()
the cursor is always in the data area... |
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)
mousePressed: On the first mouse click at a position, we simply position the cursor to the corresponding output and cycle, but don't modify the data value at (output,cycle) On the second and subsequent clicks at the same position, we toggle through the values X-0-1 On the second and subsequent clicks with the SHIFT-key held down, we toggle through the full StdLogic1164 values, U-X-0-1-Z-L-H-W-D When dragging the mouse, the data value at the drag start position is copied onto all intermediate cycle covered by the mouse drag. |
void |
mouseReleased(java.awt.event.MouseEvent me)
|
void |
moveCursorDown()
|
void |
moveCursorLeft()
move the cursor left, and scroll left if necessary (and possible) |
void |
moveCursorRight()
move the cursor right, and scroll right if necessary (and possible) |
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 |
moveToCycle(int start)
|
void |
moveToCycle(int start,
boolean notify)
|
static void |
msg(java.lang.String msg)
|
protected void |
notifyListeners(int addr,
long value)
|
void |
notifyScroller()
|
java.lang.String |
padToWidth(java.lang.String s,
int maxWidth)
|
void |
paint(java.awt.Graphics systemGraphics)
paint: a text-based waveform display for the stimuli data. |
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 |
paintSignalNames(java.awt.Graphics g)
|
void |
paintStringAtAddr(java.awt.Graphics g,
int addr,
java.lang.String s)
|
void |
paintTimeScale(java.awt.Graphics g)
|
protected void |
prepareGUI()
|
void |
removeActionListener(java.awt.event.ActionListener AL)
|
void |
setAddrColor(java.awt.Color c)
|
void |
setBackground(java.awt.Color c)
|
void |
setCursor(int x,
int y)
|
void |
setCursorColor(java.awt.Color c)
|
void |
setCursorFromMousePosition(java.awt.event.MouseEvent me)
|
void |
setDataColor(java.awt.Color c)
|
void |
setDigitAtMousePosition(char c)
|
void |
setReadHighlightColor(java.awt.Color c)
|
void |
setRegionEndPoint(int cycle,
int row)
|
void |
setRegionStartPoint(int cycle,
int row)
|
void |
setScroller(java.awt.Scrollbar scroller)
|
void |
setTextFont(java.awt.Font f)
|
void |
setTimeColor(java.awt.Color c)
|
void |
setWriteHighlightColor(java.awt.Color c)
|
void |
update(java.awt.Graphics g)
|
void |
updateLimits()
|
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 Stimulus stimulus
protected int n_cycles
protected int n_outputs
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 signalNameColor
protected java.awt.Color timeColor
protected java.awt.Color readHighlightColor
protected java.awt.Color writeHighlightColor
protected java.awt.Color cursorColor
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_cycles_per_row
protected int n_chars_per_cycle
protected int n_chars_per_addr
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 x0_time
protected int y0_time
protected int border_width
protected int border_height
protected int width
protected int height
protected int start_cycle
protected int end_address
protected int cursor_x
protected int cursor_y
protected int n_cursor
protected int n_chars
protected int value
protected java.awt.Point dragStartPosition
protected java.awt.Point currentMousePosition
protected int lastDragCycle
protected java.awt.Point regionStartPoint
protected java.awt.Point regionEndPoint
protected int readHighlightAddress
protected int writeHighlightAddress
static java.awt.Color[] _colorTable
static java.awt.Color _darkBlue
Constructor Detail |
public StimuliEditorCanvas(Stimulus stimulus, int n_cycles_per_row)
Method Detail |
public void updateLimits()
public void setBackground(java.awt.Color c)
public void setDataColor(java.awt.Color c)
public void setTimeColor(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 void setCursorColor(java.awt.Color c)
public java.awt.Color getBackground()
public java.awt.Color getTimeColor()
public java.awt.Color getDataColor()
public java.awt.Color getDataColor1164(int value)
public java.awt.Color getAddrColor()
public java.awt.Color getReadHightlightColor()
public java.awt.Color getWriteHightlightColor()
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 paintSignalNames(java.awt.Graphics g)
public void paintTimeScale(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.lang.String padToWidth(java.lang.String s, int maxWidth)
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getPreferredSize()
public void setCursor(int x, int y)
public int getCursorRow()
public int getCursorCycle()
protected int getCursorX(int mouse_x)
protected int getCursorY(int mouse_y)
public void setCursorFromMousePosition(java.awt.event.MouseEvent me)
public int getCycleFromCursorPosition()
public void setRegionStartPoint(int cycle, int row)
public void setRegionEndPoint(int cycle, int row)
public boolean isCursorInDataArea()
public boolean isCursorInAddrArea()
public boolean isDataVisibleAtAddress(int addr)
public void makeDataVisibleAtAddress(int addr)
public int getRelativeDataCursor()
public int getCursorAddrIndex()
public int clip(int currentValue, int minValue, int maxValue)
public void insertDataAtCursor()
public void deleteDataAtCursor()
public void backSpace()
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 moveToCycle(int start)
public void moveToCycle(int start, boolean notify)
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 incrementValueAll1164()
public void decrementValue()
public void setDigitAtMousePosition(char c)
public void editStartAddress(char c)
public void changeDataAtMousePosition(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 |