Class ConfigurableFeatureTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.gvsig.fmap.mapcontrol.dal.feature.swing.table.FeatureTableModel
org.gvsig.fmap.mapcontrol.dal.feature.swing.table.ConfigurableFeatureTableModel
- All Implemented Interfaces:
Serializable,TableModel,org.gvsig.tools.dispose.Disposable,org.gvsig.tools.dispose.SupportDisposable,org.gvsig.tools.observer.ComplexObserver,org.gvsig.tools.observer.Observer
Extends the FeatureTableModel to add more configurable options, like the
visible columns, column name aliases and row order.
TODO: añadir la persistencia.
- Author:
- Cèsar Ordiñana
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gvsig.fmap.mapcontrol.dal.feature.swing.table.FeatureTableModel
FeatureTableModel.Bitmask -
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionConfigurableFeatureTableModel(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) ConfigurableFeatureTableModel(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, int pageSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidMake current changes in configuration (visible columns and aliases) as definitive.voidCancel current changes in configuration (visible columns and aliases) and return to previous status.protected StringgetAliasForColumn(String name) Returns the alias for the name of a column.Class<?> getColumnClass(int columnIndex) intgetColumnName(int column) org.gvsig.fmap.dal.feature.FeatureAttributeDescriptorgetDescriptorForColumn(int columnIndex) Returns the descriptor of a Feature attribute for a table column.protected ObjectgetFeatureValue(org.gvsig.fmap.dal.feature.Feature feature, int columnIndex) Returns the value of a Feature attribute, at the given position.getFormattingPattern(int column) getFormattingPattern(String columnName) protected String[]intintgetOriginalColumnIndex(int columnIndex) Returns the original position of a column.getOriginalColumnName(int column) Returns the original name of the column, ignoring the alias.protected voidInitialize the TableModelprotected voidinitializeFormattingPattern(String columnName) protected voidprotected voidInitializes the table visible columns.booleanReturns if a column is visible.voidorderByColumn(String name, boolean ascending) voidSets the alias for a column.voidChanges all columns to be visible.voidsetFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType) Sets the FeatureType to show in the table.protected org.gvsig.fmap.dal.feature.EditableFeaturesetFeatureValue(org.gvsig.fmap.dal.feature.Feature feature, int columnIndex, Object value) Sets the value of an Feature attribute at the given position.voidsetFormattingPattern(String columnName, String pattern) voidsetLocaleOfData(Locale locale) voidsetVisible(String name, boolean visible) Sets the visibility of a table column.voidsetVisibleColumns(List<String> names) Sets the current visible columns list, in the original order.Methods inherited from class org.gvsig.fmap.mapcontrol.dal.feature.swing.table.FeatureTableModel
dispose, doDispose, fireTableChanged, getFeatureAt, getFeatureQuery, getFeatureStore, getFeatureType, getHelper, getRowCount, getValueAt, internalGetFeatureDescriptorForColumn, isCellEditable, isSelectionLocked, setSelectionUp, setValueAt, update, updatePaginHelperWithHiddenColumsMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
ConfigurableFeatureTableModel
public ConfigurableFeatureTableModel(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) throws org.gvsig.tools.exception.BaseException - Throws:
org.gvsig.tools.exception.BaseException- See Also:
-
ConfigurableFeatureTableModel
public ConfigurableFeatureTableModel(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, int pageSize) throws org.gvsig.tools.exception.BaseException - Throws:
org.gvsig.tools.exception.BaseException- See Also:
-
-
Method Details
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classFeatureTableModel
-
getOriginalColumnCount
public int getOriginalColumnCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classFeatureTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classFeatureTableModel
-
getDescriptorForColumn
public org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor getDescriptorForColumn(int columnIndex) Description copied from class:FeatureTableModelReturns the descriptor of a Feature attribute for a table column.- Overrides:
getDescriptorForColumnin classFeatureTableModel- Parameters:
columnIndex- , the column index- Returns:
-
getOriginalColumnName
Returns the original name of the column, ignoring the alias.- Parameters:
column- the original index of the column- Returns:
- the original column name
-
setVisible
Sets the visibility of a table column.- Parameters:
visible- if the column will be visible or notcolumnIndex- the index of the column to update
-
setFeatureType
public void setFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType) Description copied from class:FeatureTableModelSets the FeatureType to show in the table. Used for FeatureStores with many simultaneous FeatureTypes supported. Will cause a reload of the current data.- Overrides:
setFeatureTypein classFeatureTableModel- Parameters:
featureType- the FeatureType of the Features
-
setVisibleColumns
Sets the current visible columns list, in the original order.- Parameters:
names- the names of the columns to set as visible
-
getHiddenColumnNames
- Overrides:
getHiddenColumnNamesin classFeatureTableModel
-
setAllVisible
public void setAllVisible()Changes all columns to be visible. -
setAlias
Sets the alias for a column.- Parameters:
name- the name of the columnalias- the alias for the column
-
orderByColumn
public void orderByColumn(String name, boolean ascending) throws org.gvsig.tools.exception.BaseException - Throws:
org.gvsig.tools.exception.BaseException
-
initialize
protected void initialize()Description copied from class:FeatureTableModelInitialize the TableModel- Overrides:
initializein classFeatureTableModel
-
isVisible
Returns if a column is visible.- Parameters:
name- the name of the column- Returns:
- if the column is visible
-
initializeVisibleColumns
protected void initializeVisibleColumns()Initializes the table visible columns. -
getAliasForColumn
Returns the alias for the name of a column.- Parameters:
name- of the column- Returns:
- the alias
-
getOriginalColumnIndex
public int getOriginalColumnIndex(int columnIndex) Returns the original position of a column.- Parameters:
columnIndex- the current visible column index- Returns:
- the original column index
-
getFeatureValue
Description copied from class:FeatureTableModelReturns the value of a Feature attribute, at the given position.- Overrides:
getFeatureValuein classFeatureTableModel- Parameters:
feature- the feature to get the value fromcolumnIndex- the Feature attribute position- Returns:
- the value
-
setFeatureValue
protected org.gvsig.fmap.dal.feature.EditableFeature setFeatureValue(org.gvsig.fmap.dal.feature.Feature feature, int columnIndex, Object value) Description copied from class:FeatureTableModelSets the value of an Feature attribute at the given position.- Overrides:
setFeatureValuein classFeatureTableModel- Parameters:
feature- the feature to updatecolumnIndex- the attribute positionvalue- the value to set- Returns:
-
acceptChanges
public void acceptChanges()Make current changes in configuration (visible columns and aliases) as definitive. -
cancelChanges
public void cancelChanges()Cancel current changes in configuration (visible columns and aliases) and return to previous status. -
initializeFormattingPatterns
protected void initializeFormattingPatterns() -
initializeFormattingPattern
-
getFormattingPattern
-
getFormattingPattern
-
setFormattingPattern
-
getLocaleOfData
-
setLocaleOfData
-