Revision 35334 branches/dal_time_support/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java

View differences:

FLyrVect.java
120 120
 */
121 121

  
122 122
public class FLyrVect extends FLyrDefault implements VectorLayer,
123
    LegendContentsChangedListener, Observer {
123
LegendContentsChangedListener, Observer {
124 124

  
125 125
    final static private org.slf4j.Logger logger =
126 126
        LoggerFactory.getLogger(FLyrVect.class);
......
266 266
        featureStore = (FeatureStore) dataStore;
267 267

  
268 268
        IVectorLegend legend =
269
        	(IVectorLegend) MapContextLocator.getMapContextManager().getLegend(dataStore);
269
            (IVectorLegend) MapContextLocator.getMapContextManager().getLegend(dataStore);
270 270

  
271 271
        if (legend == null) {
272 272
            throw new LegendLayerException(this.getName());
......
291 291
            labeler.setLayer(this);
292 292
            this.setLabelingStrategy(labeler);
293 293
            this.setIsLabeled(true); // TODO: ac? no s'hauria de detectar si t?
294
                                     // etiquetes?????
294
            // etiquetes?????
295 295
        }
296 296

  
297 297
        this.delegate(dataStore);
......
385 385
            legend.addDrawingObserver(this);
386 386
        }
387 387

  
388
        FeatureQuery featureQuery = null;
388 389
        try {
390
            FeatureAttributeDescriptor featureAttributeDescriptor =
391
                getFeatureStore().getDefaultFeatureType().getDefaultTimelAttribute();
392

  
393
            if ((viewPort.getTime() != null) && (featureAttributeDescriptor != null)){
394
                featureQuery = getFeatureStore().createFeatureQuery();
395
                IntersectsTimeEvaluator intersectsTimeEvaluator =
396
                    new IntersectsTimeEvaluator(viewPort.getTime(), featureAttributeDescriptor.getName());
397
                featureQuery.addFilter(intersectsTimeEvaluator);
398
            }
399
        } catch (DataException e1) {
400
            logger.error("Impossible to get the temporal filter", e1);
401
        }
402

  
403
        try {
389 404
            legend.draw(image,
390 405
                g,
391 406
                viewPort,
......
394 409
                null,
395 410
                getCoordTrans(),
396 411
                getFeatureStore(),
397
                null);
412
                featureQuery);
398 413

  
399 414
        } catch (LegendException e) {
400 415
            this.setVisible(false);
......
1086 1101
        Geometry geom,
1087 1102
        int[] xyCoords) {
1088 1103
        return isOnePoint(graphicsTransform, viewPort, geom, xyCoords)
1089
            && csSym.getCartographicSize(viewPort, dpi, geom) <= 1;
1104
        && csSym.getCartographicSize(viewPort, dpi, geom) <= 1;
1090 1105
    }
1091 1106

  
1092 1107
    private boolean isOnePoint(AffineTransform graphicsTransform,
......
1260 1275
        FeatureQuery featureQuery = featureStore.createFeatureQuery();
1261 1276
        String geomName =
1262 1277
            featureStore.getDefaultFeatureType()
1263
                .getDefaultGeometryAttributeName();
1278
            .getDefaultGeometryAttributeName();
1264 1279
        featureQuery.setFeatureType(featureType);
1265 1280
        IntersectsGeometryEvaluator iee =
1266 1281
            new IntersectsGeometryEvaluator(geom,
......
1288 1303
        }
1289 1304
        String geomName =
1290 1305
            featureStore.getDefaultFeatureType()
1291
                .getDefaultGeometryAttributeName();
1306
            .getDefaultGeometryAttributeName();
1292 1307
        ContainsEnvelopeEvaluator iee =
1293 1308
            new ContainsEnvelopeEvaluator(envelope,
1294 1309
                getMapContext().getViewPort().getProjection(),
......
1300 1315
    }
1301 1316

  
1302 1317
    public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel) throws LoadLayerException,
1303
        DataException {
1318
    DataException {
1304 1319

  
1305 1320
        return getInfo(p, tolerance, cancel, true);
1306 1321
    }
......
1393 1408
     */
1394 1409
    public Object getMetadataID() throws MetadataException {
1395 1410
        return "Layer(" + this.getName() + "):"
1396
            + this.featureStore.getMetadataID();
1411
        + this.featureStore.getMetadataID();
1397 1412
    }
1398 1413

  
1399
    
1400 1414

  
1415

  
1401 1416
    public GeometryType getTypeVectorLayer() throws DataException,
1402
        LocatorException,
1403
        GeometryTypeNotSupportedException,
1404
        GeometryTypeNotValidException {
1417
    LocatorException,
1418
    GeometryTypeNotSupportedException,
1419
    GeometryTypeNotValidException {
1405 1420
        // FIXME Esto deberia de pedirse a FType!!!!
1406 1421
        FeatureStore fs = this.getFeatureStore();
1407 1422
        FeatureType fType = fs.getDefaultFeatureType();
......
1409 1424
            fType.getAttributeDescriptor(fType.getDefaultGeometryAttributeIndex());
1410 1425
        GeometryType geomType =
1411 1426
            GeometryLocator.getGeometryManager()
1412
                .getGeometryType(attr.getGeometryType(),
1413
                    attr.getGeometrySubType());
1427
            .getGeometryType(attr.getGeometryType(),
1428
                attr.getGeometrySubType());
1414 1429
        return geomType;
1415 1430
    }
1416 1431

  
......
1426 1441
                null,
1427 1442
                null);
1428 1443
        definition.extend(PersistenceManager.PERSISTENCE_NAMESPACE,
1429
            "FLyrDefault");
1444
        "FLyrDefault");
1430 1445

  
1431 1446
        definition.addDynFieldObject("legend")
1432
            .setClassOfValue(IVectorLegend.class)
1433
            .setMandatory(true);
1447
        .setClassOfValue(IVectorLegend.class)
1448
        .setMandatory(true);
1434 1449
        definition.addDynFieldObject("featureStore")
1435
            .setClassOfValue(FeatureStore.class)
1436
            .setMandatory(true);
1450
        .setClassOfValue(FeatureStore.class)
1451
        .setMandatory(true);
1437 1452
        definition.addDynFieldBoolean("isLabeled").setMandatory(true);
1438 1453
        definition.addDynFieldInt("typeShape").setMandatory(true);
1439 1454
        definition.addDynFieldObject("labelingStrategy")
1440
            .setClassOfValue(ILabelingStrategy.class)
1441
            .setMandatory(false);
1455
        .setClassOfValue(ILabelingStrategy.class)
1456
        .setMandatory(false);
1442 1457

  
1443 1458
    }
1444 1459

  

Also available in: Unified diff