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.AbstractTableModelCharacter 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 voidallowOnlyUnique()leave only unique characters in the data string.voidappendChar(java.lang.Character c, boolean checkUnique)Append a new character to the data.intgetColumnCount()java.lang.StringgetColumnName(int column)java.lang.StringgetData()intgetRowCount()java.lang.ObjectgetValueAt(int rowIndex, int columnIndex)java.awt.PointmodifyPoint(java.awt.Point p)Prevent the use of invalid points in the table (beyond data string length).voidremoveSelection(int row1, int col1, int row2, int col2)Remove the selected characters from the model.booleansetData(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:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein 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.
-
-