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

public class ConfigurableFeatureTableModel extends FeatureTableModel
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:
  • 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:
      getColumnCount in interface TableModel
      Overrides:
      getColumnCount in class FeatureTableModel
    • getOriginalColumnCount

      public int getOriginalColumnCount()
    • getColumnName

      public String getColumnName(int column)
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class FeatureTableModel
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class FeatureTableModel
    • getDescriptorForColumn

      public org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor getDescriptorForColumn(int columnIndex)
      Description copied from class: FeatureTableModel
      Returns the descriptor of a Feature attribute for a table column.
      Overrides:
      getDescriptorForColumn in class FeatureTableModel
      Parameters:
      columnIndex - , the column index
      Returns:
    • getOriginalColumnName

      public String getOriginalColumnName(int column)
      Returns the original name of the column, ignoring the alias.
      Parameters:
      column - the original index of the column
      Returns:
      the original column name
    • setVisible

      public void setVisible(String name, boolean visible)
      Sets the visibility of a table column.
      Parameters:
      visible - if the column will be visible or not
      columnIndex - the index of the column to update
    • setFeatureType

      public void setFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType)
      Description copied from class: FeatureTableModel
      Sets the FeatureType to show in the table. Used for FeatureStores with many simultaneous FeatureTypes supported. Will cause a reload of the current data.
      Overrides:
      setFeatureType in class FeatureTableModel
      Parameters:
      featureType - the FeatureType of the Features
    • setVisibleColumns

      public void setVisibleColumns(List<String> names)
      Sets the current visible columns list, in the original order.
      Parameters:
      names - the names of the columns to set as visible
    • getHiddenColumnNames

      protected String[] getHiddenColumnNames()
      Overrides:
      getHiddenColumnNames in class FeatureTableModel
    • setAllVisible

      public void setAllVisible()
      Changes all columns to be visible.
    • setAlias

      public void setAlias(String name, String alias)
      Sets the alias for a column.
      Parameters:
      name - the name of the column
      alias - 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: FeatureTableModel
      Initialize the TableModel
      Overrides:
      initialize in class FeatureTableModel
    • isVisible

      public boolean isVisible(String name)
      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

      protected String getAliasForColumn(String name)
      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

      protected Object getFeatureValue(org.gvsig.fmap.dal.feature.Feature feature, int columnIndex)
      Description copied from class: FeatureTableModel
      Returns the value of a Feature attribute, at the given position.
      Overrides:
      getFeatureValue in class FeatureTableModel
      Parameters:
      feature - the feature to get the value from
      columnIndex - 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: FeatureTableModel
      Sets the value of an Feature attribute at the given position.
      Overrides:
      setFeatureValue in class FeatureTableModel
      Parameters:
      feature - the feature to update
      columnIndex - the attribute position
      value - 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

      protected void initializeFormattingPattern(String columnName)
    • getFormattingPattern

      public String getFormattingPattern(int column)
    • getFormattingPattern

      public String getFormattingPattern(String columnName)
    • setFormattingPattern

      public void setFormattingPattern(String columnName, String pattern)
    • getLocaleOfData

      public Locale getLocaleOfData()
    • setLocaleOfData

      public void setLocaleOfData(Locale locale)