Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / FPolyline2D.java @ 267

History | View | Annotate | Download (1.6 KB)

1
package com.iver.cit.gvsig.fmap.core;
2

    
3
import java.awt.Graphics2D;
4
import java.awt.geom.Rectangle2D;
5

    
6
import org.geotools.geometry.Geometry;
7
import org.geotools.renderer.style.LineStyle2D;
8
import org.geotools.renderer.style.Style2D;
9

    
10
import com.iver.cit.gvsig.fmap.ViewPort;
11

    
12

    
13

    
14
public class FPolyline2D implements FGeometry {
15
        protected GeneralPathX gp;
16

    
17
        public FPolyline2D(GeneralPathX gpx) {
18
                gp = gpx;
19
        }
20

    
21
        /**
22
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, ViewPort, java.awt.geom.Rectangle2D)
23
         */
24
        public void draw(Graphics2D g, ViewPort vp, Style2D symbol) {
25
//                if (gp.intersects(extent)){
26
                if (symbol instanceof LineStyle2D)
27
                {
28
                        /* LineStyle2D style2D = (LineStyle2D) symbol;                        
29
                        
30
                        g.setPaint(Color.black);
31
                        */                        
32
                    gp.transform(vp.getAffineTransform());
33
                    // g.draw(gp); 
34
                        shpPainter.paint(g,gp,symbol,0);
35
                }
36
                        
37
/*                        StyledShapePainter painter = new StyledShapePainter();
38
                        painter.paint(g, this, symbol, vp.getScale());
39
        */        
40
//                }
41
        }
42

    
43

    
44

    
45
        /**
46
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean)
47
         */
48
        public FGeometry[] createLabels(int position, boolean duplicates) {
49
                return null;
50
        }
51

    
52
        /**
53
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry()
54
         */
55
        public Geometry toJTSGeometry() {
56
                return null;
57
        }
58

    
59
        /* (non-Javadoc)
60
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#intersects(java.awt.geom.Rectangle2D)
61
         */
62
        public boolean intersects(Rectangle2D r) {
63
                return gp.intersects(r);
64
        }
65

    
66
        /* (non-Javadoc)
67
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#getBounds2D()
68
         */
69
        public Rectangle2D getBounds2D() {
70
                return gp.getBounds2D();
71
        }
72

    
73
}