Revision 10626 trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCADTool.java
ScaleCADTool.java | ||
---|---|---|
48 | 48 |
import java.awt.geom.Point2D; |
49 | 49 |
import java.awt.geom.Point2D.Double; |
50 | 50 |
import java.awt.image.ImagingOpException; |
51 |
import java.io.IOException; |
|
52 | 51 |
import java.util.ArrayList; |
53 | 52 |
|
53 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
54 | 54 |
import com.iver.andami.PluginServices; |
55 | 55 |
import com.iver.cit.gvsig.CADExtension; |
56 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
57 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileWriteException; |
|
58 |
import com.iver.cit.gvsig.exceptions.validate.ValidateRowException; |
|
56 | 59 |
import com.iver.cit.gvsig.fmap.ViewPort; |
57 | 60 |
import com.iver.cit.gvsig.fmap.core.DefaultFeature; |
58 | 61 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
59 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
|
60 | 62 |
import com.iver.cit.gvsig.fmap.edition.DefaultRowEdited; |
61 | 63 |
import com.iver.cit.gvsig.fmap.edition.EditionEvent; |
62 | 64 |
import com.iver.cit.gvsig.fmap.edition.IRowEdited; |
... | ... | |
160 | 162 |
try { |
161 | 163 |
double size=getCadToolAdapter().getMapControl().getViewPort().toMapDistance(getCadToolAdapter().getMapControl().getWidth()); |
162 | 164 |
scale(firstPoint.distance(lastPoint)/(size/40)); |
163 |
} catch (DriverIOException e) { |
|
165 |
} catch (ValidateRowException e) { |
|
166 |
// TODO Auto-generated catch block |
|
164 | 167 |
e.printStackTrace(); |
165 |
} catch (IOException e1) { |
|
166 |
e1.printStackTrace(); |
|
168 |
} catch (ExpansionFileWriteException e) { |
|
169 |
// TODO Auto-generated catch block |
|
170 |
e.printStackTrace(); |
|
171 |
} catch (ReadDriverException e) { |
|
172 |
// TODO Auto-generated catch block |
|
173 |
e.printStackTrace(); |
|
174 |
} catch (ExpansionFileReadException e) { |
|
175 |
// TODO Auto-generated catch block |
|
176 |
e.printStackTrace(); |
|
167 | 177 |
} |
168 | 178 |
|
169 | 179 |
PluginServices.getMDIManager().restoreCursor(); |
... | ... | |
183 | 193 |
|
184 | 194 |
try { |
185 | 195 |
scale(escalado); |
186 |
} catch (DriverIOException e) { |
|
196 |
} catch (ValidateRowException e) { |
|
197 |
// TODO Auto-generated catch block |
|
187 | 198 |
e.printStackTrace(); |
188 |
} catch (IOException e) { |
|
199 |
} catch (ExpansionFileWriteException e) { |
|
200 |
// TODO Auto-generated catch block |
|
189 | 201 |
e.printStackTrace(); |
202 |
} catch (ReadDriverException e) { |
|
203 |
// TODO Auto-generated catch block |
|
204 |
e.printStackTrace(); |
|
205 |
} catch (ExpansionFileReadException e) { |
|
206 |
// TODO Auto-generated catch block |
|
207 |
e.printStackTrace(); |
|
190 | 208 |
} |
191 | 209 |
} |
192 | 210 |
|
... | ... | |
310 | 328 |
if (status.equals("Scale.ScaleFactorOrReference")) { |
311 | 329 |
try { |
312 | 330 |
scale(d); |
313 |
} catch (DriverIOException e) { |
|
314 |
e.printStackTrace(); |
|
315 |
} catch (IOException e1) { |
|
316 |
e1.printStackTrace(); |
|
317 |
} |
|
331 |
} catch (ValidateRowException e) { |
|
332 |
// TODO Auto-generated catch block |
|
333 |
e.printStackTrace(); |
|
334 |
} catch (ExpansionFileWriteException e) { |
|
335 |
// TODO Auto-generated catch block |
|
336 |
e.printStackTrace(); |
|
337 |
} catch (ReadDriverException e) { |
|
338 |
// TODO Auto-generated catch block |
|
339 |
e.printStackTrace(); |
|
340 |
} catch (ExpansionFileReadException e) { |
|
341 |
// TODO Auto-generated catch block |
|
342 |
e.printStackTrace(); |
|
343 |
} |
|
318 | 344 |
|
319 | 345 |
} |
320 | 346 |
} |
321 |
private void scale(double scaleFactor) throws DriverIOException, IOException {
|
|
347 |
private void scale(double scaleFactor) throws ValidateRowException, ExpansionFileWriteException, ReadDriverException, ExpansionFileReadException{
|
|
322 | 348 |
VectorialLayerEdited vle=getVLE(); |
323 | 349 |
VectorialEditableAdapter vea=vle.getVEA(); |
324 | 350 |
vea.startComplexRow(); |
Also available in: Unified diff