Package org.omegat.gui.editor.chartable
Class CharTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.omegat.gui.editor.chartable.CharTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class CharTableModel extends javax.swing.table.AbstractTableModel
Character table table model- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CharTableModel(java.lang.String data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
setData
public boolean setData(java.lang.String data)
set the data to a selected string- Parameters:
data
- the new string- Returns:
- true if the data have been replaced.
-
getData
public java.lang.String getData()
-
allowOnlyUnique
public void allowOnlyUnique()
leave only unique characters in the data string.
-
appendChar
public void appendChar(java.lang.Character c, boolean checkUnique)
Append a new character to the data.- Parameters:
c
- the charactercheckUnique
- check for being unique or not
-
removeSelection
public void removeSelection(int row1, int col1, int row2, int col2)
Remove the selected characters from the model.- Parameters:
row1
- from rowcol1
- from columnrow2
- to rowcol2
- to column
-
getRowCount
public int getRowCount()
-
getColumnCount
public int getColumnCount()
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
-
getColumnName
public java.lang.String getColumnName(int column)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
modifyPoint
public java.awt.Point modifyPoint(java.awt.Point p)
Prevent the use of invalid points in the table (beyond data string length).- Parameters:
p
- the point in question- Returns:
- the modified point.
-
-