[Schmitzm-commits] r334 - branches/1.0-gt2-2.6/src/schmitzm/geotools/feature
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Aug 26 19:39:10 CEST 2009
Author: alfonx
Date: 2009-08-26 19:39:09 +0200 (Wed, 26 Aug 2009)
New Revision: 334
Modified:
branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java
branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
Log:
Migrating to GT2.6...
Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java 2009-08-26 17:34:01 UTC (rev 333)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureTableModel.java 2009-08-26 17:39:09 UTC (rev 334)
@@ -150,10 +150,10 @@
* @param columnIndex Spalten-Index (beginnend bei 0)
*/
public Object getValueAt(int rowIndex, int columnIndex) {
- AttributeDescriptor aType = featureType.getAttributeType(rowIndex);
+ AttributeDescriptor aType = featureType.getAttributeDescriptors().get(rowIndex);
switch ( columnIndex ) {
case 0: return aType.getLocalName();
- case 1: return aType.getBinding().getSimpleName();
+ case 1: return aType.getType().getBinding().getSimpleName();
case 2: return feature.getAttribute(rowIndex);
}
return null;
@@ -166,13 +166,14 @@
*/
@Override
public void setValueAt(Object value, int rowIndex, int columnIndex) {
- AttributeDescriptor aType = featureType.getAttributeType(rowIndex);
+ AttributeDescriptor aType = featureType.getAttributeDescriptors().get(rowIndex);
if ( "".equals(value) )
value = null;
- if ( value != null && Number.class.isAssignableFrom(aType.getBinding()) )
- value = BaseTypeUtil.convertFromString(value.toString(), aType.getBinding());
+ final Class<?> bindingClass = aType.getType().getBinding();
+ if ( value != null && Number.class.isAssignableFrom(bindingClass) )
+ value = BaseTypeUtil.convertFromString(value.toString(), bindingClass);
if ( value == null && !aType.isNillable() )
- value = FeatureUtil.getDefaultAttributeValue(aType.getBinding());
+ value = FeatureUtil.getDefaultAttributeValue(bindingClass);
try {
switch ( columnIndex ) {
@@ -190,7 +191,7 @@
*/
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
- Class aClass = featureType.getAttributeType(rowIndex).getBinding();
+ Class aClass = featureType.getAttributeDescriptors().get(rowIndex).getType().getBinding();
return columnIndex == 2 && BaseTypeUtil.isBaseType( aClass );
}
Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java 2009-08-26 17:34:01 UTC (rev 333)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java 2009-08-26 17:39:09 UTC (rev 334)
@@ -166,10 +166,10 @@
* @param fType a feature type
*/
public static GeometryForm getGeometryForm(SimpleFeatureType fType) {
- if ( fType.getDefaultGeometry() == null )
+ if ( fType.getGeometryDescriptor() == null )
return null;
- GeometryAttributeType geometryType = fType.getDefaultGeometry();
+ GeometryDescriptor geometryType = fType.getGeometryDescriptor();
return getGeometryForm(geometryType);
}
More information about the Schmitzm-commits
mailing list