public class HexTableModel
extends javax.swing.table.AbstractTableModel
JTable in the hex editor.| Constructor and Description |
|---|
HexTableModel(HexEditorComponent editor)
Creates the model.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
getByte(int offset)
Gets the byte at the specified offset in the document.
|
int |
getByteCount()
Returns the number of bytes in the document.
|
byte[] |
getBytes() |
int |
getBytesPerRow()
Returns the number of bytes to display in a row.
|
int |
getColumnCount()
Returns the number of columns to display in the hex editor.
|
java.lang.String |
getColumnName(int col) |
int |
getRowCount()
Gets the number of rows to display in the hex editor.
|
java.lang.Object |
getValueAt(int row,
int col)
Returns the value to display at the specified cell in the table, as
a
String. |
boolean |
redo()
Redoes the last undoable edit undone.
|
void |
removeBytes(int offset,
int len)
Removes bytes from the document.
|
void |
replaceBytes(int offset,
int len,
byte[] bytes)
Replaces bytes in the document.
|
void |
setBytes(java.io.InputStream in)
Sets the bytes displayed to those from an input stream.
|
void |
setBytes(java.lang.String fileName)
Sets the bytes displayed to those in the given file.
|
void |
setValueAt(java.lang.Object value,
int row,
int col)
Sets the value of a cell in the table.
|
boolean |
undo()
Undoes the previous undoable edit.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListenerpublic HexTableModel(HexEditorComponent editor)
editor - The parent hex editor.public byte getByte(int offset)
offset - The offset.public int getByteCount()
public byte[] getBytes()
public int getBytesPerRow()
public int getColumnCount()
public java.lang.String getColumnName(int col)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelpublic int getRowCount()
public java.lang.Object getValueAt(int row,
int col)
String.row - The row of the cell.col - The column of the cell.public boolean redo()
undo()public void removeBytes(int offset,
int len)
offset - The offset at which to remove.len - The number of bytes to remove. If this value is
<= 0, nothing happens.replaceBytes(int, int, byte[])public void replaceBytes(int offset,
int len,
byte[] bytes)
offset - The offset of the range of bytes to replace.len - The number of bytes to replace.bytes - The bytes to replace with. If this is null
or an empty array, then this method call will be equivalent to
removeBytes(offset, len).removeBytes(int, int)public void setBytes(java.lang.String fileName)
throws java.io.IOException
fileName - The name of a file.java.io.IOException - If an IO error occurs reading the file.setBytes(InputStream)public void setBytes(java.io.InputStream in)
throws java.io.IOException
in - The input stream to read from.java.io.IOException - If an IO error occurs.setBytes(String)public void setValueAt(java.lang.Object value,
int row,
int col)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelvalue - The new value for the cell. This should be a String
representing an unsigned byte in hexadecimal, i.e.
"00" to "ff".row - The row of the cell to change.col - The column of the cell to change.public boolean undo()
redo()