public class CharTableModel
extends javax.swing.table.AbstractTableModel
Constructor and Description |
---|
CharTableModel(java.lang.String data) |
Modifier and Type | Method and Description |
---|---|
void |
allowOnlyUnique()
leave only unique characters in the data string.
|
void |
appendChar(java.lang.Character c,
boolean checkUnique)
Append a new character to the data.
|
int |
getColumnCount() |
java.lang.String |
getColumnName(int column) |
java.lang.String |
getData() |
int |
getRowCount() |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex) |
java.awt.Point |
modifyPoint(java.awt.Point p)
Prevent the use of invalid points in the table (beyond data string length).
|
void |
removeSelection(int row1,
int col1,
int row2,
int col2)
Remove the selected characters from the model.
|
boolean |
setData(java.lang.String data)
set the data to a selected string
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
public boolean setData(java.lang.String data)
data
- the new stringpublic java.lang.String getData()
public void allowOnlyUnique()
public void appendChar(java.lang.Character c, boolean checkUnique)
c
- the charactercheckUnique
- check for being unique or notpublic void removeSelection(int row1, int col1, int row2, int col2)
row1
- from rowcol1
- from columnrow2
- to rowcol2
- to columnpublic int getRowCount()
public int getColumnCount()
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.awt.Point modifyPoint(java.awt.Point p)
p
- the point in question