Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / Polyline2D.java @ 254

History | View | Annotate | Download (3.03 KB)

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

    
3
import java.awt.Color;
4
import java.awt.Graphics2D;
5
import java.awt.Rectangle;
6
import java.awt.geom.AffineTransform;
7
import java.awt.geom.PathIterator;
8
import java.awt.geom.Point2D;
9
import java.awt.geom.Rectangle2D;
10

    
11
import org.geotools.geometry.Geometry;
12
import org.geotools.renderer.style.LineStyle2D;
13
import org.geotools.renderer.style.Style2D;
14

    
15
import com.iver.cit.gvsig.fmap.ViewPort;
16

    
17

    
18

    
19
public class Polyline2D implements FGeometry{
20
        private GeneralPathX gp;
21

    
22
        public Polyline2D(GeneralPathX gpx){
23
                gp = gpx;
24
        }
25

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

    
48

    
49
        /**
50
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#getType()
51
         */
52
        public int getType() {
53
                return FGeometry.LINE;
54
        }
55

    
56
        /**
57
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean)
58
         */
59
        public FGeometry[] createLabels(int position, boolean duplicates) {
60
                return null;
61
        }
62

    
63
        /**
64
         * @see java.awt.Shape#contains(double, double)
65
         */
66
        public boolean contains(double x, double y) {
67
                return gp.contains(x, y);
68
        }
69

    
70
        /**
71
         * @see java.awt.Shape#contains(double, double, double, double)
72
         */
73
        public boolean contains(double x, double y, double w, double h) {
74
                return gp.contains(x, y, w, h);
75
        }
76

    
77
        /**
78
         * @see java.awt.Shape#intersects(double, double, double, double)
79
         */
80
        public boolean intersects(double x, double y, double w, double h) {
81
                return gp.intersects(x, y, w, h);
82
        }
83

    
84
        /**
85
         * @see java.awt.Shape#getBounds()
86
         */
87
        public Rectangle getBounds() {
88
                return gp.getBounds();
89
        }
90

    
91
        /**
92
         * @see java.awt.Shape#contains(java.awt.geom.Point2D)
93
         */
94
        public boolean contains(Point2D p) {
95
                return gp.contains(p);
96
        }
97

    
98
        /**
99
         * @see java.awt.Shape#getBounds2D()
100
         */
101
        public Rectangle2D getBounds2D() {
102
                return gp.getBounds2D();
103
        }
104

    
105
        /**
106
         * @see java.awt.Shape#contains(java.awt.geom.Rectangle2D)
107
         */
108
        public boolean contains(Rectangle2D r) {
109
                return gp.contains(r);
110
        }
111

    
112
        /**
113
         * @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D)
114
         */
115
        public boolean intersects(Rectangle2D r) {
116
                return gp.intersects(r);
117
        }
118

    
119
        /**
120
         * @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform)
121
         */
122
        public PathIterator getPathIterator(AffineTransform at) {
123
                return gp.getPathIterator(at);
124
        }
125

    
126
        /**
127
         * @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double)
128
         */
129
        public PathIterator getPathIterator(AffineTransform at, double flatness) {
130
                return gp.getPathIterator(at, flatness);
131
        }
132

    
133
        /**
134
         * @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry()
135
         */
136
        public Geometry toJTSGeometry() {
137
                return null;
138
        }
139

    
140
}