| java.lang.Object javax.swing.table.AbstractTableModel snow.sortabletable.FineGrainTableModel
All known Subclasses: tide.editor.linemessages.CategoriesTable, tide.profiler.JMapReader, snow.files.JFilesTableModel, snow.sortabletable.RowHeaderExtractorWrapperTableModel, snow.sortabletable.TestModel,
FineGrainTableModel | abstract public class FineGrainTableModel extends AbstractTableModel (Code) | | This table model define a new TableModelChangeListener
this model should be used with the SortableTableModel to allow
keeping the selection when table model changes.
HOWTO use:
+ by each modification of this model (i.e. in SetValue())
First call before change : fireModelWillChange()
After change : fireTableDataChanged() and fireModelHasChanged()
|
Method Summary | |
public void | addModelChangeListener(TableModelChangeListener listener) | public void | clearRowSelection() | public static int | compareBooleans(boolean b1, boolean b2) | public static int | compareDoubles(double i1, double i2) same as Double.valueOf(i1).compareTo(i2), but 5 times quicker if one has not the Double class already available. | public int | compareForColumnSort(int pos1, int pos2, int col) To sort columns... | public static int | compareInts(int i1, int i2) | public void | fireTableModelHasChanged() | public void | fireTableModelWillChange() | public int | getColumnAlignment(int column) | public Class | getColumnClass(int column) | public int | getPreferredColumnWidth(int column) overwrite this is you want to specify a default width... | public int[] | getSelectedRows() overwrite only if you want to boost. | public String | getValueAsStringAt(int row, int col) returns the value of a cell as a String
for the multi search.
this method may be overwritten if the normal
toString() of a value is not suitable for a search (e.g. | boolean | hitForTextSearch(int row, int column, String txt, Query query) | final public boolean | hitForTextSearch(int row, Query[] queries) | public boolean | isRowSelected(int row) | public static void | main(String[] arguments) | public void | removeModelChangeListener(TableModelChangeListener listener) | public void | setRowSelection(int row, boolean isSelected) used to select/deselect a given row.
this method doesn't fire any events
overwrite this AND THE TWO OTHERS selection method to provide your
selection mechanism. | public void | terminate() |
FineGrainTableModel | public FineGrainTableModel()(Code) | | |
clearRowSelection | public void clearRowSelection()(Code) | | |
compareBooleans | public static int compareBooleans(boolean b1, boolean b2)(Code) | | equivalent to Boolean.valueOf(b1).compareTo(b2) but 3 times quicker
|
compareDoubles | public static int compareDoubles(double i1, double i2)(Code) | | same as Double.valueOf(i1).compareTo(i2), but 5 times quicker if one has not the Double class already available.
Use this also for ints...
|
compareForColumnSort | public int compareForColumnSort(int pos1, int pos2, int col)(Code) | | To sort columns... owerwrite if you need a better (or faster) sorting
|
compareInts | public static int compareInts(int i1, int i2)(Code) | | |
fireTableModelHasChanged | public void fireTableModelHasChanged()(Code) | | |
fireTableModelWillChange | public void fireTableModelWillChange()(Code) | | |
getColumnAlignment | public int getColumnAlignment(int column)(Code) | | |
getColumnClass | public Class getColumnClass(int column)(Code) | | Important, this allow the table to determine which renderer to use
(checkbox for Boolean, ...)
|
getPreferredColumnWidth | public int getPreferredColumnWidth(int column)(Code) | | overwrite this is you want to specify a default width... (measured in Label.font size).
-1 do nothing. Any positive value will be used as preferred width.
To be effective, the table must be set in
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
before call installGUI()
|
getSelectedRows | public int[] getSelectedRows()(Code) | | overwrite only if you want to boost.
This method use isRowSelected(row) to detect which rows are selected.
|
getValueAsStringAt | public String getValueAsStringAt(int row, int col)(Code) | | returns the value of a cell as a String
for the multi search.
this method may be overwritten if the normal
toString() of a value is not suitable for a search (e.g. dates)
|
hitForTextSearch | boolean hitForTextSearch(int row, int column, String txt, Query query)(Code) | | true if the txt appears in the given row and columnif column is -1, searches in all cols |
hitForTextSearch | final public boolean hitForTextSearch(int row, Query[] queries)(Code) | | for the multi search (can be boosted)
|
isRowSelected | public boolean isRowSelected(int row)(Code) | | tells if the row is selected
|
setRowSelection | public void setRowSelection(int row, boolean isSelected)(Code) | | used to select/deselect a given row.
this method doesn't fire any events
overwrite this AND THE TWO OTHERS selection method to provide your
selection mechanism. (maybe storing it in the model items)
public void setRowSelection(int row, boolean isSelected)
public boolean isRowSelected(int row)
public void clearRowSelection()
EACH model row deletion will destroy sense of this selection.
=> MUST NORMALLY BY OVERWRITTEN
+ for bosting big tables: public int[] getSelectedRows()
|
terminate | public void terminate()(Code) | | |
|
|