Package com.cosylab.vdct.inspector.sheet
Class SpreadsheetViewModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.cosylab.vdct.inspector.sheet.SpreadsheetTableModel
-
- com.cosylab.vdct.inspector.sheet.SpreadsheetViewModel
-
- All Implemented Interfaces:
PropertyTableModel
,Serializable
,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
Fields Modifier and Type Field Description 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
Constructors Constructor Description SpreadsheetViewModel(Object dsId, String dataType, Vector displayData, Vector loadedData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
baseToVisibleColumn(int column)
protected int
baseToVisibleRow(int row)
void
deleteRows(int[] rows)
Class
getColumnClass(int column)
int
getColumnCount()
protected String
getColumnId(int column)
int
getHeaderDisplayType(int column)
Returns the header display type HEADERDISP_* at the given position.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()
Object
getValueAt(int rowIndex, int columnIndex)
protected boolean
internalSetValueAt(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(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
-
-
-
-
Constructor Detail
-
SpreadsheetViewModel
public SpreadsheetViewModel(Object dsId, String dataType, Vector displayData, Vector loadedData) throws IllegalArgumentException
- Parameters:
dsId
- dsIddataType
- dataTypedisplayData
- displayDataloadedData
- loadedData- Throws:
IllegalArgumentException
- foo
-
-
Method Detail
-
recallView
public void recallView()
- Overrides:
recallView
in classSpreadsheetTableModel
-
storeView
public void storeView()
- Overrides:
storeView
in classSpreadsheetTableModel
-
refreshAll
protected void refreshAll()
- Overrides:
refreshAll
in classSpreadsheetTableModel
-
baseToVisibleRow
protected final int baseToVisibleRow(int row)
- Parameters:
row
- row- Returns:
- something
-
visibleToBaseRow
protected final int visibleToBaseRow(int row)
- Parameters:
row
- row- Returns:
- something
-
baseToVisibleColumn
protected final int baseToVisibleColumn(int column)
- Parameters:
column
- column- Returns:
- something
-
visibleToBaseColumn
protected final int visibleToBaseColumn(int column)
- Parameters:
column
- column- Returns:
- something
-
isColumsDefault
protected boolean isColumsDefault()
- Returns:
- something
-
isDefaultColumnVisibility
public boolean isDefaultColumnVisibility()
- Returns:
- something
-
setDefaultColumnVisibility
public void setDefaultColumnVisibility()
-
isSolidBaseColumn
public boolean isSolidBaseColumn(int baseColumn)
- Parameters:
baseColumn
- baseColumn- Returns:
- something
-
isSolidColumn
public boolean isSolidColumn(int column)
- Parameters:
column
- column- Returns:
- something
-
getPropertyRow
public int getPropertyRow(int row)
- Parameters:
row
- row- Returns:
- something
-
getPropertyColumn
public int getPropertyColumn(int column)
- Parameters:
column
- column- Returns:
- something
-
setColumnOrder
public void setColumnOrder(String modeName)
- Overrides:
setColumnOrder
in classSpreadsheetTableModel
- Parameters:
modeName
- modeName
-
isPropertiesColumnVisible
public boolean isPropertiesColumnVisible(int column)
- Parameters:
column
- column- Returns:
- something
-
isRowVisible
public boolean isRowVisible(int row)
- Parameters:
row
- row- Returns:
- something
-
isShowAllRows
public boolean isShowAllRows()
- Returns:
- something
-
setShowAllRows
public void setShowAllRows(boolean showAllRows)
- Parameters:
showAllRows
- showAllRows
-
isGroupColumnsByGuiGroup
public boolean isGroupColumnsByGuiGroup()
- Returns:
- something
-
setGroupColumnsByGuiGroup
public void setGroupColumnsByGuiGroup(boolean groupColumnsByGuiGroup)
- Parameters:
groupColumnsByGuiGroup
- groupColumnsByGuiGroup
-
setRowsVisibility
public void setRowsVisibility(int[] rows, boolean visible)
- Parameters:
rows
- rowsvisible
- visible
-
setColumnsVisibility
public void setColumnsVisibility(int[] columns, boolean visible)
- Parameters:
columns
- columnsvisible
- visible
-
setPropertyColumnsVisibility
public void setPropertyColumnsVisibility(int[] columns, boolean visible)
- Parameters:
columns
- columnsvisible
- visible
-
repositionColumn
public void repositionColumn(int startIndex, int destIndex)
- Parameters:
startIndex
- startIndexdestIndex
- destIndex
-
sortRows
public void sortRows(int column, boolean ascending)
- Parameters:
column
- columnascending
- ascending
-
sortColumns
public void sortColumns(int row, boolean ascending)
- Parameters:
row
- rowascending
- ascending
-
sortRowsByColumn
public void sortRowsByColumn(int column)
- Parameters:
column
- column
-
deleteRows
public void deleteRows(int[] rows)
- Overrides:
deleteRows
in classSpreadsheetTableModel
- Parameters:
rows
- rows
-
getColumnClass
public Class getColumnClass(int column)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classSpreadsheetTableModel
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classSpreadsheetTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classSpreadsheetTableModel
-
getColumnId
protected String getColumnId(int column)
- Overrides:
getColumnId
in classSpreadsheetTableModel
- Parameters:
column
- column- Returns:
- something
-
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 interfacePropertyTableModel
- Overrides:
getHeaderDisplayType
in classSpreadsheetTableModel
- Parameters:
column
- column- Returns:
- something
-
getMultilineString
public String getMultilineString(int row, int column)
- Overrides:
getMultilineString
in classSpreadsheetTableModel
- Parameters:
row
- rowcolumn
- column- Returns:
- something
-
getNamesColumn
protected int getNamesColumn()
- Overrides:
getNamesColumn
in classSpreadsheetTableModel
- Returns:
- something
-
getPropertyAt
public InspectableProperty getPropertyAt(int row, int column)
- Specified by:
getPropertyAt
in interfacePropertyTableModel
- Overrides:
getPropertyAt
in classSpreadsheetTableModel
- Parameters:
row
- rowcolumn
- column- Returns:
- something
-
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 interfacePropertyTableModel
- Overrides:
getPropertyDisplayTypeAt
in classSpreadsheetTableModel
- Parameters:
row
- rowcolumn
- column- Returns:
- something
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classSpreadsheetTableModel
-
internalSetValueAt
protected boolean internalSetValueAt(Object value, int row, int column)
- Overrides:
internalSetValueAt
in classSpreadsheetTableModel
- Parameters:
value
- valuerow
- rowcolumn
- column- Returns:
- something
-
setRowOrder
protected void setRowOrder(int[] sortOrder)
- Parameters:
sortOrder
- sortOrder
-
setColumnOrder
protected void setColumnOrder(int[] sortOrder)
- Parameters:
sortOrder
- sortOrder
-
-