Revision 13904
trunk/libraries/libFMap/src-test/com/iver/cit/gvsig/fmap/featureiterators/DBFeatureIteratorTest.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.1 2007-05-29 19:11:03 azabala |
|
48 |
* Revision 1.2 2007-09-20 08:08:29 jaume |
|
49 |
* ReadExpansionFileException removed from this context |
|
50 |
* |
|
51 |
* Revision 1.1 2007/05/29 19:11:03 azabala |
|
49 | 52 |
* *** empty log message *** |
50 | 53 |
* |
51 | 54 |
* |
... | ... | |
54 | 57 |
|
55 | 58 |
import java.awt.geom.Rectangle2D; |
56 | 59 |
|
60 |
import junit.framework.TestCase; |
|
61 |
|
|
57 | 62 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
58 | 63 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
59 | 64 |
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException; |
60 | 65 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
61 | 66 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
62 | 67 |
|
63 |
import junit.framework.TestCase; |
|
64 |
|
|
65 | 68 |
public class DBFeatureIteratorTest extends TestCase { |
66 | 69 |
|
67 | 70 |
// test with mysql jdbc driver |
... | ... | |
94 | 97 |
e.printStackTrace(); |
95 | 98 |
} catch (ReadDriverException e) { |
96 | 99 |
e.printStackTrace(); |
97 |
} catch (ExpansionFileReadException e) { |
|
98 |
e.printStackTrace(); |
|
99 |
}catch(Exception e){ |
|
100 |
} catch(Exception e){ |
|
100 | 101 |
//Si se trata de ejecutar el test sin tener MySQL |
101 | 102 |
e.printStackTrace(); |
102 | 103 |
} |
trunk/libraries/libFMap/src-test/com/iver/cit/gvsig/fmap/featureiterators/FeatureIteratorTest.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.10 2007-06-29 13:07:01 jaume |
|
48 |
* Revision 1.11 2007-09-20 08:08:29 jaume |
|
49 |
* ReadExpansionFileException removed from this context |
|
50 |
* |
|
51 |
* Revision 1.10 2007/06/29 13:07:01 jaume |
|
49 | 52 |
* +PictureLineSymbol |
50 | 53 |
* |
51 | 54 |
* Revision 1.9 2007/06/27 20:18:35 azabala |
... | ... | |
82 | 85 |
import java.awt.image.BufferedImage; |
83 | 86 |
import java.io.File; |
84 | 87 |
import java.net.URL; |
85 |
import java.sql.Connection; |
|
86 |
import java.sql.DriverManager; |
|
87 | 88 |
import java.util.prefs.Preferences; |
88 | 89 |
|
89 | 90 |
import junit.framework.TestCase; |
... | ... | |
104 | 105 |
import com.iver.cit.gvsig.fmap.drivers.ConnectionJDBC; |
105 | 106 |
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition; |
106 | 107 |
import com.iver.cit.gvsig.fmap.drivers.DefaultJDBCDriver; |
107 |
import com.iver.cit.gvsig.fmap.drivers.IConnection; |
|
108 | 108 |
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; |
109 | 109 |
import com.iver.cit.gvsig.fmap.drivers.IVectorialJDBCDriver; |
110 | 110 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
... | ... | |
389 | 389 |
} catch (ReadDriverException e) { |
390 | 390 |
// TODO Auto-generated catch block |
391 | 391 |
e.printStackTrace(); |
392 |
} catch (ExpansionFileReadException e) { |
|
393 |
// TODO Auto-generated catch block |
|
394 |
e.printStackTrace(); |
|
395 |
} |
|
392 |
} |
|
396 | 393 |
} |
397 | 394 |
|
398 | 395 |
|
... | ... | |
448 | 445 |
} catch (ReadDriverException e) { |
449 | 446 |
// TODO Auto-generated catch block |
450 | 447 |
e.printStackTrace(); |
451 |
} catch (ExpansionFileReadException e) { |
|
452 |
// TODO Auto-generated catch block |
|
453 |
e.printStackTrace(); |
|
454 | 448 |
} |
455 | 449 |
} |
456 | 450 |
|
... | ... | |
459 | 453 |
|
460 | 454 |
|
461 | 455 |
public void test5(){ |
462 |
try {
|
|
463 |
int WIDTH = 300;
|
|
464 |
int HEIGHT = 200;
|
|
465 |
FLyrVect layer = (FLyrVect) newLayer("municipios.shp", SHP_DRIVER_NAME);
|
|
466 |
ViewPort vp = new ViewPort(PROJECTION_DEFAULT);
|
|
467 |
vp.setImageSize(new Dimension(WIDTH, HEIGHT));
|
|
468 |
vp.setExtent(layer.getFullExtent());
|
|
469 |
MapContext mapa = new MapContext(vp);
|
|
470 |
mapa.getLayers().addLayer(layer);
|
|
471 |
BufferedImage img = new BufferedImage(WIDTH, HEIGHT,
|
|
472 |
BufferedImage.TYPE_INT_ARGB);
|
|
456 |
try { |
|
457 |
int WIDTH = 300; |
|
458 |
int HEIGHT = 200; |
|
459 |
FLyrVect layer = (FLyrVect) newLayer("municipios.shp", SHP_DRIVER_NAME); |
|
460 |
ViewPort vp = new ViewPort(PROJECTION_DEFAULT); |
|
461 |
vp.setImageSize(new Dimension(WIDTH, HEIGHT)); |
|
462 |
vp.setExtent(layer.getFullExtent()); |
|
463 |
MapContext mapa = new MapContext(vp); |
|
464 |
mapa.getLayers().addLayer(layer); |
|
465 |
BufferedImage img = new BufferedImage(WIDTH, HEIGHT, |
|
466 |
BufferedImage.TYPE_INT_ARGB); |
|
473 | 467 |
|
474 |
long t0 = System.currentTimeMillis();
|
|
475 |
mapa.draw(img, img.createGraphics(),mapa.getScaleView());
|
|
476 |
long t1 = System.currentTimeMillis();
|
|
477 |
System.out.println((t1-t0)+" en dibujar con MapContext.draw");
|
|
468 |
long t0 = System.currentTimeMillis(); |
|
469 |
mapa.draw(img, img.createGraphics(),mapa.getScaleView()); |
|
470 |
long t1 = System.currentTimeMillis(); |
|
471 |
System.out.println((t1-t0)+" en dibujar con MapContext.draw"); |
|
478 | 472 |
|
479 | 473 |
|
480 |
long t2 = System.currentTimeMillis();
|
|
481 |
layer.draw(img, img.createGraphics(),vp, new Cancellable(){
|
|
482 |
public boolean isCanceled() {
|
|
483 |
return false;
|
|
484 |
}
|
|
485 |
public void setCanceled(boolean canceled) {
|
|
486 |
}}, getScaleView(vp));
|
|
487 |
long t3 = System.currentTimeMillis();
|
|
488 |
System.out.println((t3-t2)+" en dibujar con layer._draw");
|
|
474 |
long t2 = System.currentTimeMillis(); |
|
475 |
layer.draw(img, img.createGraphics(),vp, new Cancellable(){ |
|
476 |
public boolean isCanceled() { |
|
477 |
return false; |
|
478 |
} |
|
479 |
public void setCanceled(boolean canceled) { |
|
480 |
}}, getScaleView(vp)); |
|
481 |
long t3 = System.currentTimeMillis(); |
|
482 |
System.out.println((t3-t2)+" en dibujar con layer._draw"); |
|
489 | 483 |
|
490 |
} catch (LoadLayerException e) { |
|
491 |
// TODO Auto-generated catch block |
|
492 |
e.printStackTrace(); |
|
493 |
} catch (ReadDriverException e) { |
|
494 |
// TODO Auto-generated catch block |
|
495 |
e.printStackTrace(); |
|
496 |
} catch (ExpansionFileReadException e) { |
|
497 |
// TODO Auto-generated catch block |
|
498 |
e.printStackTrace(); |
|
499 |
} |
|
500 |
|
|
484 |
} catch (LoadLayerException e) { |
|
485 |
// TODO Auto-generated catch block |
|
486 |
e.printStackTrace(); |
|
487 |
} catch (ReadDriverException e) { |
|
488 |
// TODO Auto-generated catch block |
|
489 |
e.printStackTrace(); |
|
490 |
} |
|
501 | 491 |
} |
502 | 492 |
|
503 | 493 |
|
trunk/libraries/libFMap/src-test/com/iver/cit/gvsig/fmap/featureiterators/PerformanceFeatureIteratorTest.java | ||
---|---|---|
45 | 45 |
* |
46 | 46 |
* $Id$ |
47 | 47 |
* $Log$ |
48 |
* Revision 1.5 2007-06-29 13:07:01 jaume |
|
48 |
* Revision 1.6 2007-09-20 08:08:29 jaume |
|
49 |
* ReadExpansionFileException removed from this context |
|
50 |
* |
|
51 |
* Revision 1.5 2007/06/29 13:07:01 jaume |
|
49 | 52 |
* +PictureLineSymbol |
50 | 53 |
* |
51 | 54 |
* Revision 1.4 2007/06/07 10:20:38 azabala |
... | ... | |
183 | 186 |
} catch (ReadDriverException e) { |
184 | 187 |
// TODO Auto-generated catch block |
185 | 188 |
e.printStackTrace(); |
186 |
} catch (ExpansionFileReadException e) { |
|
187 |
// TODO Auto-generated catch block |
|
188 |
e.printStackTrace(); |
|
189 |
} |
|
189 |
} |
|
190 | 190 |
} |
191 | 191 |
|
192 | 192 |
|
... | ... | |
387 | 387 |
} catch (ReadDriverException e) { |
388 | 388 |
// TODO Auto-generated catch block |
389 | 389 |
e.printStackTrace(); |
390 |
} catch (ExpansionFileReadException e) { |
|
391 |
// TODO Auto-generated catch block |
|
392 |
e.printStackTrace(); |
|
393 |
} |
|
390 |
} |
|
394 | 391 |
} |
395 | 392 |
|
396 | 393 |
//the same test as test3 without reprojection |
Also available in: Unified diff