public class FeatureTableModel extends AbstractTableModel implements ComplexObserver
listenerList
Modifier | Constructor and Description |
---|---|
protected |
FeatureTableModel(FeaturePagingHelper helper)
Constructs a TableModel from a FeatureCollection and a Paging helper.
|
|
FeatureTableModel(FeatureStore featureStore,
FeatureQuery featureQuery)
Constructs a TableModel from the features of a FeatureStore, with the
default page size.
|
|
FeatureTableModel(FeatureStore featureStore,
FeatureQuery featureQuery,
int pageSize)
Constructs a TableModel from the features of a FeatureStore, with the
default page size.
|
Modifier and Type | Method and Description |
---|---|
Class<?> |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
String |
getColumnName(int column) |
FeatureAttributeDescriptor |
getDescriptorForColumn(int columnIndex)
Returns the descriptor of a Feature attribute for a table column.
|
Feature |
getFeatureAt(int rowIndex)
Returns the value for a row position.
|
FeatureQuery |
getFeatureQuery()
Returns the FeatureQuery used to get the Features.
|
FeatureStore |
getFeatureStore()
Returns the FeatureStore of the Collection.
|
protected FeatureType |
getFeatureType()
Returns the type of the features.
|
protected Object |
getFeatureValue(Feature feature,
int columnIndex)
Returns the value of a Feature attribute, at the given position.
|
FeaturePagingHelper |
getHelper()
Returns a reference to the Paging Helper used to load the data from the
DataStore.
|
protected String[] |
getHiddenColumnNames() |
int |
getRowCount() |
Object |
getValueAt(int rowIndex,
int columnIndex) |
protected void |
initialize()
Initialize the TableModel
|
protected FeatureAttributeDescriptor |
internalGetFeatureDescriptorForColumn(int columnIndex) |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
boolean |
isSelectionLocked()
Returns true if selection must not be changed.
|
void |
setFeatureType(FeatureType featureType)
Sets the FeatureType to show in the table.
|
protected EditableFeature |
setFeatureValue(Feature feature,
int columnIndex,
Object value)
Sets the value of an Feature attribute at the given position.
|
void |
setSelectionUp(boolean selectionUp)
Sets that the selected Features get returned first.
|
void |
setValueAt(Object value,
int rowIndex,
int columnIndex) |
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
protected void |
updatePaginHelperWithHiddenColums() |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public FeatureTableModel(FeatureStore featureStore, FeatureQuery featureQuery) throws BaseException
featureStore
- to extract the features fromfeatureQuery
- the query to get the features from the storeBaseException
- if there is an error reading data from the FeatureStorepublic FeatureTableModel(FeatureStore featureStore, FeatureQuery featureQuery, int pageSize) throws BaseException
featureStore
- to extract the features fromfeatureQuery
- the query to get the features from the storepageSize
- the number of elements per page dataBaseException
- if there is an error reading data from the FeatureStoreprotected FeatureTableModel(FeaturePagingHelper helper)
featureCollection
- to extract data fromhelper
- the paging helperDataException
- if there is an error reading data from the FeatureStorepublic int getColumnCount()
getColumnCount
in interface TableModel
public int getRowCount()
getRowCount
in interface TableModel
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
public Feature getFeatureAt(int rowIndex)
rowIndex
- the row positionpublic Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public void setValueAt(Object value, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public FeaturePagingHelper getHelper()
public void setFeatureType(FeatureType featureType)
featureType
- the FeatureType of the FeaturesDataException
- if there is an error loading the datapublic void setSelectionUp(boolean selectionUp)
public void update(Observable observable, Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
protected void updatePaginHelperWithHiddenColums()
protected String[] getHiddenColumnNames()
public FeatureStore getFeatureStore()
public FeatureAttributeDescriptor getDescriptorForColumn(int columnIndex)
columnIndex
- the column indexprotected FeatureAttributeDescriptor internalGetFeatureDescriptorForColumn(int columnIndex)
columnIndex
- protected void initialize()
protected Object getFeatureValue(Feature feature, int columnIndex)
feature
- the feature to get the value fromcolumnIndex
- the Feature attribute positionprotected EditableFeature setFeatureValue(Feature feature, int columnIndex, Object value)
feature
- the feature to updatecolumnIndex
- the attribute positionvalue
- the value to setIsNotFeatureSettingException
- if there is an error setting the valuepublic FeatureQuery getFeatureQuery()
protected FeatureType getFeatureType()
public boolean isSelectionLocked()