public class HexTableModel extends TableModel
TableModel.CellControl, TableModel.ControlProxy
Modifier and Type | Field and Description |
---|---|
protected int |
numBytes
The number of bytes.
|
RandomStream |
stream |
activeCellControl, allColumnsSameSize, allRowsSameSize, canHScroll, canMoveColumnHeaders, canVScroll, cellInsets, charHeight, charWidth, clipData, colAdjustments, controlProxy, cursorSize, fillToEqualHeights, fillToEqualWidths, gap, hasColumnHeaders, hasPreferredSize, hasRowHeaders, hasSpanningColumns, hasSpanningRows, horizontalScrollUnit, keepSIP, mouseIsOverCell, numCols, numRows, preferredCols, preferredRows, selectRowWhenEditing, shadeAlternateRows, shadeColor, table, verticalScrollUnit
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
Constructor and Description |
---|
HexTableModel() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateTextCharsInColumn(int col)
This is called by calculateColWidth().
|
protected int |
calculateTextLinesInRow(int row)
This is called by calculateColWidth().
|
void |
closeStream() |
boolean |
getCellText(int row,
int col,
StringList dest)
Override this to provide text data to display in a cell.
|
Form |
getTableForm(Form destination) |
static Form |
getViewOf(byte[] f,
int offset,
int length,
Form destination) |
static Form |
getViewOf(File f,
int maxSizeForFullRead,
Form destination) |
void |
gotoAddress(long address) |
static void |
main(String[] args) |
void |
onEvent(Event ev) |
boolean |
onKeyEvent(KeyEvent ev)
This is called by the TableControl before it processes the event.
|
protected boolean |
readIn16(int location,
byte[] dest)
Override this if you are not using a RandomStream.
|
protected void |
reset()
Reset the number of rows to zero
and clear any internal cache.
|
protected void |
setNumberOfBytes(int numBytes) |
void |
setStream(ByteArray data) |
void |
setStream(RandomStream stream) |
String |
toAscii(byte[] got,
int num) |
String |
toHex(int value,
int digits) |
void |
update()
Update the display if you have made changes to the stream.
|
acceptColumnMoved, calculateColWidth, calculatePreferredColWidth, calculatePreferredRowHeight, calculatePreferredSize, calculateRowHeight, calculateSizes, canScreenScroll, canSelect, checkControlFor, clearCellAdjustments, clearColumnWidthAdjustments, clearSelectionOnClick, closeActiveControl, columnMoved, deferPaintTableCell, doHotKey, editNow, editNow, endEditing, findCellsInArea, fixBorder, freezeUpdate, getCellAttributes, getCellControlFor, getCellData, getCellInsets, getCellPreferredSize, getCellRect, getCellText, getColWidth, getColXPointInTable, getControlFor, getLock, getMaxColWidth, getMaxRowHeight, getMenuFor, getMenuOutsideCells, getMinColWidth, getMinRowHeight, getPreferredSize, getRowHeight, getRowYPointInTable, getTable, getToolTip, handleEvent, hasActiveControls, hasCellControlFor, inset, isActiveCellControl, made, makeActiveControlVisible, mouseMoving, mouseOverChanged, notifyDataChange, paintTableCell, paintTableCell, paintTableCellData, paintTableCellText, penClicked, penPressed, popupMenuEvent, positionCellControl, remapColumns, resized, restoreColumnWidthAdjustments, saveColumnWidthAdjustments, scrolled, scrollTo, select, setColAdjust, setColWidth, show, showingMenuFor, sizeColumnToFitData, startedEditing, updateControls
protected int numBytes
public RandomStream stream
protected int calculateTextCharsInColumn(int col)
TableModel
calculateTextCharsInColumn
in class TableModel
protected int calculateTextLinesInRow(int row)
TableModel
calculateTextLinesInRow
in class TableModel
protected boolean readIn16(int location, byte[] dest)
location
- the offset of the data - which will be less than numBytes.dest
- a destination byte array for the data.public void closeStream() throws IOException
IOException
public void update()
protected void setNumberOfBytes(int numBytes)
protected void reset()
public void setStream(RandomStream stream) throws IOException
IOException
public void setStream(ByteArray data) throws IOException
IOException
public String toAscii(byte[] got, int num)
public String toHex(int value, int digits)
public boolean getCellText(int row, int col, StringList dest)
TableModel
getCellText
in class TableModel
row
- the table row.col
- the table column.dest
- a non-null StringList - use one of the add() methods
to add your text.public void gotoAddress(long address)
public boolean onKeyEvent(KeyEvent ev)
TableModel
onKeyEvent
in class TableModel
public void onEvent(Event ev)
onEvent
in class TableModel
public static Form getViewOf(File f, int maxSizeForFullRead, Form destination) throws IOException
IOException
public static Form getViewOf(byte[] f, int offset, int length, Form destination) throws IOException
IOException
public static void main(String[] args) throws IOException
IOException