Revision 37331 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/impl/DefaultGeometryManager.java

View differences:

DefaultGeometryManager.java
457 457
        return geometryType.getGeometryOperation(opCode);
458 458
    }
459 459

  
460
    public GeometryOperation getGeometryOperation(int opCode)
461
        throws GeometryOperationNotSupportedException {
462
        if (opCode < 0) {
463
            throw new GeometryOperationNotSupportedException(opCode);
464
        }
465
        GeometryType type =
466
            (GeometryType) geometryTypeName.get(DefaultNullGeometry.class
467
                .getName());
468
        if (type == null) {
469
            throw new GeometryOperationNotSupportedException(opCode);
470
        }
471
        return type.getGeometryOperation(opCode);
472
    }
473

  
460 474
    public Object invokeOperation(int opCode, Geometry geom,
461 475
        GeometryOperationContext ctx)
462 476
    throws GeometryOperationNotSupportedException,
......
485 499

  
486 500
    public Object invokeOperation(String geomOpName,
487 501
        GeometryOperationContext ctx)
488
    throws GeometryOperationNotSupportedException,
489
    GeometryOperationException {
502
        throws GeometryOperationNotSupportedException,
503
        GeometryOperationException {
490 504
        int index = geometryOperations.indexOf(geomOpName);
491
        if (index == -1)
492
            throw new GeometryOperationNotSupportedException(-1);
493
        DefaultGeometryType type =
494
            (DefaultGeometryType) geometryTypeName
495
            .get(DefaultNullGeometry.class.getName());
496
        if (type != null) {
497
            GeometryOperation geomOp = type.getGeometryOperation(index);
498
            return geomOp.invoke(null, ctx);
499
        }
500
        return null;
505
        GeometryOperation geomOp = getGeometryOperation(index);
506
        return geomOp.invoke(null, ctx);
501 507
    }
502 508

  
503 509
    public GeometryType unregisterGeometryType(Class geomClass) {

Also available in: Unified diff