com.cosylab.vdct.inspector.sheet
Class SpreadsheetViewModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.cosylab.vdct.inspector.sheet.SpreadsheetTableModel
          extended by com.cosylab.vdct.inspector.sheet.SpreadsheetViewModel
All Implemented Interfaces:
PropertyTableModel, java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
SpreadsheetSplitViewModel

public class SpreadsheetViewModel
extends SpreadsheetTableModel

This table model supports sorting and hiding of rows and columns. The sorting can be done using field values or by setting the sort permutation.

Author:
ssah
See Also:
Serialized Form

Field Summary
protected  int sortedColumn
           
protected  boolean sortedOrderAsc
           
 
Fields inherited from class com.cosylab.vdct.inspector.sheet.SpreadsheetTableModel
dataType, dsId, propertiesCommentsColumn, propertiesNamesColumn, typeSign
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface com.cosylab.vdct.inspector.PropertyTableModel
DISP_NAME, DISP_NONE, DISP_VALUE, DISP_VISIBILITY, HEADERDISP_EYE, HEADERDISP_NONE, HEADERDISP_TEXT
 
Constructor Summary
SpreadsheetViewModel(java.lang.Object dsId, java.lang.String dataType, java.util.Vector displayData, java.util.Vector loadedData)
           
 
Method Summary
protected  int baseToVisibleColumn(int column)
           
protected  int baseToVisibleRow(int row)
           
 void deleteRows(int[] rows)
           
 java.lang.Class getColumnClass(int column)
           
 int getColumnCount()
           
protected  java.lang.String getColumnId(int column)
           
 int getHeaderDisplayType(int column)
          Returns the header display type HEADERDISP_* at the given position.
 java.lang.String getMultilineString(int row, int column)
           
protected  int getNamesColumn()
           
 InspectableProperty getPropertyAt(int row, int column)
           
 int getPropertyColumn(int column)
           
 int getPropertyDisplayTypeAt(int row, int column)
          Returns the cell display type DISP_* at the given position.
 int getPropertyRow(int row)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
protected  boolean internalSetValueAt(java.lang.Object value, int row, int column)
           
protected  boolean isColumsDefault()
           
 boolean isDefaultColumnVisibility()
           
 boolean isGroupColumnsByGuiGroup()
           
 boolean isPropertiesColumnVisible(int column)
           
 boolean isRowVisible(int row)
           
 boolean isShowAllRows()
           
 boolean isSolidBaseColumn(int baseColumn)
           
 boolean isSolidColumn(int column)
           
 void recallView()
           
protected  void refreshAll()
           
 void repositionColumn(int startIndex, int destIndex)
           
protected  void setColumnOrder(int[] sortOrder)
           
 void setColumnOrder(java.lang.String modeName)
           
 void setColumnsVisibility(int[] columns, boolean visible)
           
 void setDefaultColumnVisibility()
           
 void setGroupColumnsByGuiGroup(boolean groupColumnsByGuiGroup)
           
 void setPropertyColumnsVisibility(int[] columns, boolean visible)
           
protected  void setRowOrder(int[] sortOrder)
           
 void setRowsVisibility(int[] rows, boolean visible)
           
 void setShowAllRows(boolean showAllRows)
           
 void sortColumns(int row, boolean ascending)
           
 void sortRows(int column, boolean ascending)
           
 void sortRowsByColumn(int column)
           
 void storeView()
           
protected  int visibleToBaseColumn(int column)
           
protected  int visibleToBaseRow(int row)
           
 
Methods inherited from class com.cosylab.vdct.inspector.sheet.SpreadsheetTableModel
getColumnOrderIndex, getColumnOrderNames, getLastInspectable, getLoadedInspectablesNames, getProperties, getPropertiesColumnCount, getPropertiesColumnIndex, getPropertiesColumnNames, getPropertiesRowCount, getPropertiesRowIndex, getPropertiesRowNames, getProperty, getPropertyValue, getViewRecord, internalSetValueAtAndUpdate, refresh, setColumnOrderIndex, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sortedColumn

protected int sortedColumn

sortedOrderAsc

protected boolean sortedOrderAsc
Constructor Detail

SpreadsheetViewModel

public SpreadsheetViewModel(java.lang.Object dsId,
                            java.lang.String dataType,
                            java.util.Vector displayData,
                            java.util.Vector loadedData)
                     throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

recallView

public void recallView()
Overrides:
recallView in class SpreadsheetTableModel

storeView

public void storeView()
Overrides:
storeView in class SpreadsheetTableModel

refreshAll

protected void refreshAll()
Overrides:
refreshAll in class SpreadsheetTableModel

baseToVisibleRow

protected final int baseToVisibleRow(int row)

visibleToBaseRow

protected final int visibleToBaseRow(int row)

baseToVisibleColumn

protected final int baseToVisibleColumn(int column)

visibleToBaseColumn

protected final int visibleToBaseColumn(int column)

isColumsDefault

protected boolean isColumsDefault()

isDefaultColumnVisibility

public boolean isDefaultColumnVisibility()

setDefaultColumnVisibility

public void setDefaultColumnVisibility()

isSolidBaseColumn

public boolean isSolidBaseColumn(int baseColumn)

isSolidColumn

public boolean isSolidColumn(int column)

getPropertyRow

public int getPropertyRow(int row)

getPropertyColumn

public int getPropertyColumn(int column)

setColumnOrder

public void setColumnOrder(java.lang.String modeName)
Overrides:
setColumnOrder in class SpreadsheetTableModel

isPropertiesColumnVisible

public boolean isPropertiesColumnVisible(int column)

isRowVisible

public boolean isRowVisible(int row)

isShowAllRows

public boolean isShowAllRows()

setShowAllRows

public void setShowAllRows(boolean showAllRows)

isGroupColumnsByGuiGroup

public boolean isGroupColumnsByGuiGroup()

setGroupColumnsByGuiGroup

public void setGroupColumnsByGuiGroup(boolean groupColumnsByGuiGroup)

setRowsVisibility

public void setRowsVisibility(int[] rows,
                              boolean visible)

setColumnsVisibility

public void setColumnsVisibility(int[] columns,
                                 boolean visible)

setPropertyColumnsVisibility

public void setPropertyColumnsVisibility(int[] columns,
                                         boolean visible)

repositionColumn

public void repositionColumn(int startIndex,
                             int destIndex)

sortRows

public void sortRows(int column,
                     boolean ascending)

sortColumns

public void sortColumns(int row,
                        boolean ascending)

sortRowsByColumn

public void sortRowsByColumn(int column)

deleteRows

public void deleteRows(int[] rows)
Overrides:
deleteRows in class SpreadsheetTableModel

getColumnClass

public java.lang.Class getColumnClass(int column)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class SpreadsheetTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel
Overrides:
getRowCount in class SpreadsheetTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class SpreadsheetTableModel

getColumnId

protected java.lang.String getColumnId(int column)
Overrides:
getColumnId in class SpreadsheetTableModel

getHeaderDisplayType

public int getHeaderDisplayType(int column)
Description copied from interface: PropertyTableModel
Returns the header display type HEADERDISP_* at the given position.

Specified by:
getHeaderDisplayType in interface PropertyTableModel
Overrides:
getHeaderDisplayType in class SpreadsheetTableModel

getMultilineString

public java.lang.String getMultilineString(int row,
                                           int column)
Overrides:
getMultilineString in class SpreadsheetTableModel

getNamesColumn

protected int getNamesColumn()
Overrides:
getNamesColumn in class SpreadsheetTableModel

getPropertyAt

public InspectableProperty getPropertyAt(int row,
                                         int column)
Specified by:
getPropertyAt in interface PropertyTableModel
Overrides:
getPropertyAt in class SpreadsheetTableModel

getPropertyDisplayTypeAt

public int getPropertyDisplayTypeAt(int row,
                                    int column)
Description copied from interface: PropertyTableModel
Returns the cell display type DISP_* at the given position.

Specified by:
getPropertyDisplayTypeAt in interface PropertyTableModel
Overrides:
getPropertyDisplayTypeAt in class SpreadsheetTableModel

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class SpreadsheetTableModel

internalSetValueAt

protected boolean internalSetValueAt(java.lang.Object value,
                                     int row,
                                     int column)
Overrides:
internalSetValueAt in class SpreadsheetTableModel

setRowOrder

protected void setRowOrder(int[] sortOrder)

setColumnOrder

protected void setColumnOrder(int[] sortOrder)