Revision 1034 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/StrategyManager.java
StrategyManager.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
2 |
|
|
3 | 1 |
package com.iver.cit.gvsig.fmap.operations.strategies; |
4 | 2 |
|
5 | 3 |
import com.iver.cit.gvsig.fmap.drivers.BoundedShapes; |
... | ... | |
8 | 6 |
import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer; |
9 | 7 |
|
10 | 8 |
|
9 |
/** |
|
10 |
* Clase con m?todos est?ticos para crear la estategia. |
|
11 |
* |
|
12 |
* @author Vicente Caballero Navarro |
|
13 |
*/ |
|
11 | 14 |
public class StrategyManager { |
12 |
/** |
|
13 |
* Se encarga de, dada una clase que implementa el interfaz vectorial, seleccionar la estrategia ?ptima de acceso a las capas, devolviendo el objeto Strategy con la capa vectorial asociada. |
|
14 |
*/ |
|
15 |
public static Strategy getStrategy(SingleLayer v) { |
|
16 |
if (v.getSource().getDriver() instanceof BoundedShapes){ |
|
17 |
return new ShpStrategy((FLayer)v); |
|
18 |
}else{ |
|
19 |
return new DefaultStrategy((FLayer)v); |
|
20 |
} |
|
21 |
} |
|
15 |
/** |
|
16 |
* Se encarga de, dada una clase que implementa el interfaz vectorial, |
|
17 |
* seleccionar la estrategia ?ptima de acceso a las capas, devolviendo el |
|
18 |
* objeto Strategy con la capa vectorial asociada. |
|
19 |
* |
|
20 |
* @param v SingleLayer. |
|
21 |
* |
|
22 |
* @return Estrategia. |
|
23 |
*/ |
|
24 |
public static Strategy getStrategy(SingleLayer v) { |
|
25 |
if (v.getSource().getDriver() instanceof BoundedShapes) { |
|
26 |
return new ShpStrategy((FLayer) v); |
|
27 |
} else { |
|
28 |
return new DefaultStrategy((FLayer) v); |
|
29 |
} |
|
30 |
} |
|
22 | 31 |
|
23 |
/** |
|
24 |
* Crea un ShapeInfo en memoria o en disco en funci?n de la memoria disponible |
|
25 |
*/ |
|
26 |
public static ShapeInfo createShapeInfo(VectorialAdapter adapter) { |
|
27 |
//TODO falta que implementar el DiskShapeInfo. |
|
28 |
return new MemoryShapeInfo(); |
|
29 |
} |
|
32 |
/** |
|
33 |
* Crea un ShapeInfo en memoria o en disco en funci?n de la memoria |
|
34 |
* disponible |
|
35 |
* |
|
36 |
* @param adapter VectorialAdapter. |
|
37 |
* |
|
38 |
* @return ShapeInfo. |
|
39 |
*/ |
|
40 |
public static ShapeInfo createShapeInfo(VectorialAdapter adapter) { |
|
41 |
//TODO falta que implementar el DiskShapeInfo. |
|
42 |
return new MemoryShapeInfo(); |
|
43 |
} |
|
30 | 44 |
} |
Also available in: Unified diff