gov.nih.nlm.swing
Interface CutandPasteDNDTableModel

All Superinterfaces:
TableModel
All Known Implementing Classes:
PrecedenceTableModel

public interface CutandPasteDNDTableModel
extends TableModel

Model for use with CutandPasteDNDTable. It is recommeded that when using this interface you subclass a rich implementation of TableModel such as DefaultTableModel and merely implement the three methods defined here.

Author:
Deborah Shapiro

Method Summary
 void cutRow(int[] rows_to_cut)
          Removes rows at the specified indices from the table.
 void moveRow(int[] drag_row_index, int drop_row_index)
          Moves the rows at the specified drag indexes to the specified drop index.
 void pasteRow(int paste_location)
          Indicates the location where previously cut row should be pasted.
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Method Detail

moveRow

public void moveRow(int[] drag_row_index,
                    int drop_row_index)
Moves the rows at the specified drag indexes to the specified drop index. All rows are inserted in the order in which they previously appeared in the table. For example, if rows 3,4, and 6 were dragged and dropped at index 2, then row 3 would get index 2, row 4 would get index 3, and row 6 would get index 4.

Parameters:
drag_row_index - an int[] of indexes from the table that were dragged to a new location and dropped
drop_row_index - the index of the table where the drop operation took place

cutRow

public void cutRow(int[] rows_to_cut)
Removes rows at the specified indices from the table.

Parameters:
rows_to_cut - an int[] of table indexes

pasteRow

public void pasteRow(int paste_location)
Indicates the location where previously cut row should be pasted. The implementor of this interface is required to keep track of the rows cut during a cutRow(int[]) operation so that they can be properly pasted in here.

Parameters:
paste_location - the index where previously cut rows should now be pasted


Copyright ©2005