|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jfrace.view.MemoryView
Class to be used to draw the content of a memory cell inside an AWT component. The memory cell is shown bitwise by colored squares (default: green and orange for bit: 0 and 1, resp.). The value is also painted as a hexadecimal number right of the squares.
Constructor Summary | |
MemoryView(int theX,
int theY,
int aNumberOfBits)
Create an instance for the given number of bits with default values for cell size, bit colors, number distance, and number font. |
|
MemoryView(int theX,
int theY,
int aNumberOfBits,
int anXSize,
int aYSize,
java.awt.Color aColor0,
java.awt.Color aColor1,
int aNumberDistance,
java.awt.Font aNumberFont)
Create an instance with overwritten all default parameters. |
Method Summary | |
void |
draw(java.awt.Graphics g)
Draw the bit cells and the hex number. |
int |
getBitIndex(int theX,
int theY)
Return the index of the bit below the given position. |
int |
getCellWidth()
Return the with of a bit cell. |
int |
getHeight()
Return the height of a bit cell. |
int |
getWidthFor(java.awt.Component c)
Return the with of the bit cells plus hex number. |
void |
setValue(int aValue)
Set the value of the memory cell. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MemoryView(int theX, int theY, int aNumberOfBits)
theX
- The x coordinate of the upper left corner.theY
- The y coordinate of the upper left corner.aNumberOfBits
- The number of bits.public MemoryView(int theX, int theY, int aNumberOfBits, int anXSize, int aYSize, java.awt.Color aColor0, java.awt.Color aColor1, int aNumberDistance, java.awt.Font aNumberFont)
theX
- The x coordinate of the upper left corner.theY
- The y coordinate of the upper left corner.aNumberOfBits
- The number of bits.anXSize
- With of a bit cell in pixels.aYSize
- Height of a bit cell in pixels.aColor0
- Color for bit 0.aColor1
- Color for bit 1.aNumberDistance
- Distance in pixels between bit cells and
hexadecimal number.aNumberFont
- The font for the number.Method Detail |
public int getWidthFor(java.awt.Component c)
c
- An AWT component needed to calculate the
with of the number.public int getCellWidth()
public int getHeight()
public void setValue(int aValue)
public int getBitIndex(int theX, int theY)
theX
- The x coordinate of the position.theY
- The y coordinate of the position.(x, y)
.public void draw(java.awt.Graphics g)
g
- Graphics context to be drawn.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |