Class CubeStore
- All Implemented Interfaces:
PopupActivationListener
,Serializable
,Comparable
,EventListener
,ListSelectionListener
,TableModelListener
,TableModel
Principal uses of this class are to wrap an AttributeStore object
before displaying it in a TableViewer
. The TableViewer object
may independently scroll through time periods without altering the
time period view of other users of the data source.
The implementation of this class is very lightweight, with almost all functions being delegated to the original object.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class ca.spatial.table.AttributeStore
SELECT_ADD, SELECT_FROM, SELECT_NEW
-
Constructor Summary
ConstructorsConstructorDescriptionCubeStore(AttributeStore store)
Wrap an attribute store so that changes to the default period do not effect the underlying table. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCellEditors(JTable t, int offset)
This method will be called by components that want to set up custom cell editors on JTables.boolean
Query if this layer supports extended editing of features.void
buildIndex(int column)
Build an index on the column.void
close()
Close the table and release resources.int
findColumn(String field, String shortName)
Get the column number of the given field in the given table.getAttributeFormat(int field)
Get the format descriptor for a given column.Return the parent data source from within a caching layer.Return a string that uniquely identifies this table and provides information can be used to reconstruct the table.int
Get the number of columns in this storeboolean
Get the status of the extended editing mode.getFullColumnName(int column)
Return the full name of a column at a given position, including the short name of the table.int
Get the total number of periods that this store supportsint
Get the number of rows in this storeGet the short name for this table.Get the synchronizer object for this table.getValueAt(int row, int column, int period)
Get a cell valueint
getYearForPeriod(int period)
Get the ending year for a given period.void
setEditMode(boolean mode)
Enable or disable the extended editing mode.setShortName(String name)
Set the short name for this table.void
setValueAt(Object aValue, int row, int column, int period)
Set the value in a cell and notify listeners that the value has changed.void
Methods inherited from class ca.spatial.table.AttributeStore
absoluteFile, absoluteFile, absolutePath, absolutePath, addMenuItems, addPopupActivationListener, addRelate, addRelate, addTableModelListener, addToGlobalStoreList, booleanValue, booleanValue, calculate, calculateField, calculateField, canIndex, changeSelection, clearSelection, compareTo, decodeCharset, doubleValue, doubleValue, exportCSV, exportCSV, exportCSV, exportCSV, exportCSV, exportCSV, exportDBF, exportDBF, exportDBF, exportDBF, exportDBF, findColumn, findSimilarColumnNames, getCachingLayer, getCachingLayer, getColumnClass, getColumnName, getColumnNames, getContextPeriods, getCwd, getListSelectionModel, getMinMax, getMinMax, getMinMax, getMinMax, getMinMax, getOpenStore, getOpenStore, getOpenStore, getOpenStores, getPeriod, getPeriodWidth, getRowNodeRemap, getSelectedRowCount, getSelection, getSelection, getSelection, getSnapshot, getSnapshot, getStoreByShortName, getStoreByTitle, getTableName, getTableSpec, getTitle, getValueAt, hasIndex, identifyRecords, integerValue, integerValue, isCellEditable, isSelectedIndex, isSelectionEmpty, listify, listValue, listValue, lookupRow, makeLu, maybePopup, notifyPopupActivationListeners, openOrReuse, openOrReuse, queryTable, queryTable, quoteIfRequired, relativePath, removeFromGlobalStoreList, removePopupActivationListener, removeTableModelListener, select, select, selectAdd, selectFrom, selectNew, setCwd, setCwd, setListSelectionModel, setPeriod, setRowNodeRemap, setTableSpec, setTitle, setValueAt, showCube, showTable, toString, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, uniqueValues, valueChanged
Methods inherited from class javax.swing.table.AbstractTableModel
fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
-
Constructor Details
-
CubeStore
Wrap an attribute store so that changes to the default period do not effect the underlying table.- Parameters:
store
- The AttributeStore that should be wrapped.
-
-
Method Details
-
getCacheParent
Description copied from class:AttributeStore
Return the parent data source from within a caching layer. In case the data source is not being cached then this will simply return itself.- Overrides:
getCacheParent
in classAttributeStore
-
close
public void close()Description copied from class:AttributeStore
Close the table and release resources. The table should be used again after this method has been called.In many cases you do not need to call this method when you are finished using a table. Most tables will close automatically when they are no longer referenced.
It is possible that this method will be deprecated or removed in a future release.
- Overrides:
close
in classAttributeStore
-
getCanonicalName
Description copied from class:AttributeStore
Return a string that uniquely identifies this table and provides information can be used to reconstruct the table. This handle can be passed to theAttributeStore.openOrReuse(java.lang.String)
method to get an existing or new instance of the table.- Overrides:
getCanonicalName
in classAttributeStore
- Returns:
- The canonical name of this store.
-
getRowCount
public int getRowCount()Description copied from class:AttributeStore
Get the number of rows in this store- Specified by:
getRowCount
in interfaceTableModel
- Specified by:
getRowCount
in classAttributeStore
- Returns:
- the number of rows in this store
-
getColumnCount
public int getColumnCount()Description copied from class:AttributeStore
Get the number of columns in this store- Specified by:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classAttributeStore
- Returns:
- the number of columns in this store
-
getPeriodCount
public int getPeriodCount()Description copied from class:AttributeStore
Get the total number of periods that this store supports- Specified by:
getPeriodCount
in classAttributeStore
- Returns:
- The number of periods in this store
-
getYearForPeriod
public int getYearForPeriod(int period)Description copied from class:AttributeStore
Get the ending year for a given period.- Specified by:
getYearForPeriod
in classAttributeStore
- Parameters:
period
- The period of interest- Returns:
- the year for a given period
-
getSynchronizer
Description copied from class:AttributeStore
Get the synchronizer object for this table. This object can be used to suspend the scheduling task as a set of calculations are carried out. Most tables will not have a synchronizer object. The only tables that will are tables that provide simulation results.- Overrides:
getSynchronizer
in classAttributeStore
-
setValueAt
Description copied from class:AttributeStore
Set the value in a cell and notify listeners that the value has changed.Implementing classes that override must call this method to ensure that joins are properly maintained.
- Overrides:
setValueAt
in classAttributeStore
- Parameters:
aValue
- The value to be set.row
- The row containing the cellcolumn
- The column containing the cellperiod
- The period of interest
-
getValueAt
Description copied from class:AttributeStore
Get a cell value- Specified by:
getValueAt
in classAttributeStore
- Parameters:
row
- The row containing the cellcolumn
- The column containing the cellperiod
- The period of interest- Returns:
- An object containing the cell value.
-
getAttributeFormat
Description copied from class:AttributeStore
Get the format descriptor for a given column.- Overrides:
getAttributeFormat
in classAttributeStore
- Parameters:
field
- The column of interest- Returns:
- The
AttributeFormat
for this field
-
allowsEditing
public boolean allowsEditing()Description copied from class:AttributeStore
Query if this layer supports extended editing of features. Extended editing usually means that values can be written out to disk.- Overrides:
allowsEditing
in classAttributeStore
- Returns:
- true if the store allows editing
-
setEditMode
Description copied from class:AttributeStore
Enable or disable the extended editing mode.- Overrides:
setEditMode
in classAttributeStore
- Parameters:
mode
- the editing mode to use- Throws:
IOException
- if an error occurs while trying to change the edit mode.
-
getEditMode
public boolean getEditMode()Description copied from class:AttributeStore
Get the status of the extended editing mode.- Overrides:
getEditMode
in classAttributeStore
- Returns:
- the editing mode in use
-
buildIndex
public void buildIndex(int column)Description copied from class:AttributeStore
Build an index on the column. The index can then be used for speedy lookups. SeeAttributeStore.lookupRow(java.lang.Object, int)
.- Overrides:
buildIndex
in classAttributeStore
- Parameters:
column
- the column of interest
-
getShortName
Description copied from class:AttributeStore
Get the short name for this table. This value can be used in column lookups to differentiate similarly named columns from different joined tables.- Overrides:
getShortName
in classAttributeStore
-
getFullColumnName
Description copied from class:AttributeStore
Return the full name of a column at a given position, including the short name of the table.- Overrides:
getFullColumnName
in classAttributeStore
- Parameters:
column
- the column number of interest- Returns:
- the name of the column
-
setShortName
Description copied from class:AttributeStore
Set the short name for this table. This value can be used in column lookups to differentiate similarly named columns from different joined tables.- Overrides:
setShortName
in classAttributeStore
-
findColumn
Description copied from class:AttributeStore
Get the column number of the given field in the given table. If the column is not found then return -1.- Overrides:
findColumn
in classAttributeStore
- Parameters:
field
- The name of the field to look upshortName
- The short name of the table to look up the the column in. If this attribute store has related tables, the column from the related table with the matching short name will be returned. If there is no table with a matching short name an exception will be thrown.
-
addCellEditors
Description copied from class:AttributeStore
This method will be called by components that want to set up custom cell editors on JTables. If your table has custom editing behaviour then you can hook it in using this method.- Overrides:
addCellEditors
in classAttributeStore
- Parameters:
t
- AJTable
offset
- the column number in the store that will have a custom cell editor
-
tableChanged
- Specified by:
tableChanged
in interfaceTableModelListener
-