JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Interface SortableDataViewModel

All Superinterfaces:
DataViewModel, EventListener, JCTableDataListener, JCTableDataModel, TableDataModel
All Known Implementing Classes:
TableDataView

public interface SortableDataViewModel
extends DataViewModel

The SortableDataViewModel adds methods to sort, drag and swap rows and columns in the view.


Method Summary
 boolean dragColumn(int column1, int column2)
          Drags a column to a new position.
 boolean dragRow(int row1, int row2)
          Drags a row to a new position.
 int[] getColumnMap()
          Returns an array of column numbers that map view to data.
 int getDataColumn(int column)
          Returns the data column mapped to the view column.
 int getDataRow(int row)
          Returns the data row mapped to the view row.
 int[] getRowMap()
          Returns an array of row numbers that map view to data.
 int getViewColumn(int column)
          Returns the column in the view for the data column.
 int getViewRow(int row)
          Returns the row in the view for the data row.
 void resetColumnMap()
          Reset the mapped columns array to a one-to-one mapping.
 void resetRowMap()
          Reset the mapped rows array to a one-to-one mapping.
 boolean setColumnMap(int[] new_map)
          Sets a new column map array.
 boolean setRowMap(int[] new_map)
          Sets a new row map array.
 boolean swapColumns(int column1, int column2)
          Swaps two columns.
 boolean swapRows(int row1, int row2)
          Swaps two rows.
 
Methods inherited from interface com.klg.jclass.table.DataViewModel
getCellEditor, getCellEditor, getCellRenderer, getCellRenderer, getCellRenderer, getDataSource, getEditorsTable, getObject, getRenderersTable, getTable, isEditable, setDataSource, setEditorsTable, setRenderersTable, setTable, setTableDataItem
 
Methods inherited from interface com.klg.jclass.table.TableDataModel
addTableDataListener, removeTableDataListener
 
Methods inherited from interface com.klg.jclass.util.JCTableDataModel
getNumColumns, getNumRows, getTableColumnLabel, getTableDataItem, getTableRowLabel
 
Methods inherited from interface com.klg.jclass.table.JCTableDataListener
dataChanged
 

Method Detail

getColumnMap

public int[] getColumnMap()
Returns an array of column numbers that map view to data. For example, columnMap[1] = 3 indicates that column 1 is column 3 in the data source.


getRowMap

public int[] getRowMap()
Returns an array of row numbers that map view to data. For example, rowMap[1] = 3 indicates that row 1 is row 3 in the data source.


getDataColumn

public int getDataColumn(int column)
Returns the data column mapped to the view column.


getDataRow

public int getDataRow(int row)
Returns the data row mapped to the view row.


getViewColumn

public int getViewColumn(int column)
Returns the column in the view for the data column.


getViewRow

public int getViewRow(int row)
Returns the row in the view for the data row.


resetColumnMap

public void resetColumnMap()
Reset the mapped columns array to a one-to-one mapping.


resetRowMap

public void resetRowMap()
Reset the mapped rows array to a one-to-one mapping.


swapColumns

public boolean swapColumns(int column1,
                           int column2)
Swaps two columns. Returns true if the columns are valid and the swap occurs.


swapRows

public boolean swapRows(int row1,
                        int row2)
Swaps two rows. Returns true if the rows are valid and the swap occurs.


setColumnMap

public boolean setColumnMap(int[] new_map)
Sets a new column map array.


setRowMap

public boolean setRowMap(int[] new_map)
Sets a new row map array.


dragColumn

public boolean dragColumn(int column1,
                          int column2)
Drags a column to a new position. Use JCTableEnum.MAXINT for the destination if the first column should be at the end.


dragRow

public boolean dragRow(int row1,
                       int row2)
Drags a row to a new position. Use JCTableEnum.MAXINT for the destination if the first row should be at the end.


Copyright © 2004 Quest Software Inc..
All rights reserved.