Revision 273 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/demo/ImageFrame.java
ImageFrame.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig.fmap.demo; |
2 | 2 |
|
3 |
import java.awt.BasicStroke; |
|
4 |
import java.awt.Color; |
|
3 | 5 |
import java.io.File; |
4 | 6 |
|
5 | 7 |
import javax.swing.JFrame; |
6 | 8 |
import javax.swing.JPanel; |
7 | 9 |
|
10 |
import org.geotools.renderer.style.PolygonStyle2D; |
|
11 |
|
|
8 | 12 |
import com.iver.cit.gvsig.fmap.NewMapControl; |
9 | 13 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
10 | 14 |
import com.iver.cit.gvsig.fmap.drivers.shp.DemoSHPDriver; |
... | ... | |
13 | 17 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
14 | 18 |
import com.iver.cit.gvsig.fmap.layers.LayerPath; |
15 | 19 |
import com.iver.cit.gvsig.fmap.layers.ProjectionMismatchException; |
20 |
import com.iver.cit.gvsig.fmap.rendering.LegendFactory; |
|
16 | 21 |
import com.iver.cit.gvsig.fmap.tools.ZoomMasMapTool; |
17 | 22 |
public class ImageFrame extends JFrame { |
18 | 23 |
|
... | ... | |
62 | 67 |
jPanel = new NewMapControl(); |
63 | 68 |
DemoSHPDriver driver = new DemoSHPDriver(); |
64 | 69 |
FLyrVect l = LayerFactory.createLayer(driver, new File("d:/fjp/chiara/plano/vias.shp"), null); |
70 |
l.setName("Vias"); |
|
71 |
DemoSHPDriver driver2 = new DemoSHPDriver(); |
|
72 |
FLyrVect l2 = LayerFactory.createLayer(driver2, new File("d:/fjp/chiara/plano/provin.shp"), null); |
|
73 |
l2.setName("Provin"); |
|
74 |
PolygonStyle2D psd = new PolygonStyle2D(); |
|
75 |
psd.setContour(Color.DARK_GRAY); |
|
76 |
psd.setStroke(new BasicStroke(3)); |
|
77 |
psd.setFill(Color.LIGHT_GRAY); |
|
78 |
l2.setLegend(LegendFactory.createUniqueSymbolLegend(psd)); |
|
65 | 79 |
try { |
80 |
jPanel.getMapContext().getLayers().addLayer(new LayerPath(), l2); |
|
66 | 81 |
jPanel.getMapContext().getLayers().addLayer(new LayerPath(), l); |
67 | 82 |
l.getSource().start(); |
68 | 83 |
jPanel.getMapContext().getViewPort().setExtent(l.getFullExtent()); |
Also available in: Unified diff