Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/SelectedShapeVisitor.java
SelectedShapeVisitor.java | ||
---|---|---|
43 | 43 |
import java.util.ArrayList; |
44 | 44 |
import java.util.BitSet; |
45 | 45 |
|
46 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
46 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
47 |
import com.iver.cit.gvsig.exceptions.visitors.ProcessVisitorException; |
|
48 |
import com.iver.cit.gvsig.exceptions.visitors.StartVisitorException; |
|
49 |
import com.iver.cit.gvsig.exceptions.visitors.VisitorException; |
|
47 | 50 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
48 | 51 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
49 | 52 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
... | ... | |
62 | 65 |
/** |
63 | 66 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#visit(com.iver.cit.gvsig.fmap.core.IGeometry, int) |
64 | 67 |
*/ |
65 |
public void visit(IGeometry g, int index) throws VisitException { |
|
68 |
public void visit(IGeometry g, int index) throws VisitorException, ProcessVisitorException {
|
|
66 | 69 |
if (bitset.get(index)){ |
67 | 70 |
fgs.add(g); |
68 | 71 |
} |
... | ... | |
71 | 74 |
/** |
72 | 75 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#stop(com.iver.cit.gvsig.fmap.layers.FLayer) |
73 | 76 |
*/ |
74 |
public void stop(FLayer layer) { |
|
77 |
public void stop(FLayer layer) throws VisitorException {
|
|
75 | 78 |
} |
76 | 79 |
|
77 | 80 |
/** |
78 | 81 |
* @see com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor#start(com.iver.cit.gvsig.fmap.layers.FLayer) |
79 | 82 |
*/ |
80 |
public boolean start(FLayer layer) { |
|
83 |
public boolean start(FLayer layer) throws StartVisitorException {
|
|
81 | 84 |
if (layer instanceof AlphanumericData) { |
82 | 85 |
try { |
83 | 86 |
sds = ((AlphanumericData) layer).getRecordset(); |
84 |
} catch (DriverException e) { |
|
87 |
} catch (ReadDriverException e) {
|
|
85 | 88 |
e.printStackTrace(); |
86 | 89 |
} |
87 | 90 |
try { |
88 | 91 |
bitset = ((AlphanumericData) layer).getRecordset().getSelection(); |
89 |
} catch (DriverException e) { |
|
92 |
} catch (ReadDriverException e) {
|
|
90 | 93 |
e.printStackTrace(); |
91 | 94 |
} |
92 | 95 |
|
... | ... | |
104 | 107 |
public BitSet getBitSet(){ |
105 | 108 |
return bitset; |
106 | 109 |
} |
107 |
|
|
110 |
|
|
108 | 111 |
public String getProcessDescription() { |
109 | 112 |
return "Adding selected geometries to a memory structure"; |
110 | 113 |
} |
Also available in: Unified diff