Revision 262
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Polygon2D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Pol?gono 2D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class Polygon2D implements FGeometry { |
|
25 |
private GeneralPathX gp; |
|
26 |
|
|
27 |
/** |
|
28 |
* Crea un nuevo Polygon2D. |
|
29 |
* |
|
30 |
* @param gpx DOCUMENT ME! |
|
31 |
*/ |
|
32 |
public Polygon2D(GeneralPathX gpx) { |
|
33 |
gp = gpx; |
|
34 |
} |
|
35 |
|
|
36 |
/** |
|
37 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
38 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
39 |
*/ |
|
40 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
41 |
gp.transform(vp.getAffineTransform()); |
|
42 |
|
|
43 |
g.setPaint(Color.red); |
|
44 |
g.fill(gp); |
|
45 |
g.setPaint(Color.black); |
|
46 |
g.draw(gp); |
|
47 |
} |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
52 |
*/ |
|
53 |
public int getType() { |
|
54 |
return 0; |
|
55 |
} |
|
56 |
|
|
57 |
/** |
|
58 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
59 |
*/ |
|
60 |
public Geometry toJTSGeometry() { |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
66 |
*/ |
|
67 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
68 |
return null; |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* @see java.awt.Shape#contains(double, double) |
|
73 |
*/ |
|
74 |
public boolean contains(double arg0, double arg1) { |
|
75 |
return false; |
|
76 |
} |
|
77 |
|
|
78 |
/** |
|
79 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
80 |
*/ |
|
81 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
|
82 |
return false; |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
87 |
*/ |
|
88 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
|
89 |
return false; |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* @see java.awt.Shape#getBounds() |
|
94 |
*/ |
|
95 |
public Rectangle getBounds() { |
|
96 |
return null; |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
101 |
*/ |
|
102 |
public boolean contains(Point2D arg0) { |
|
103 |
return false; |
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* @see java.awt.Shape#getBounds2D() |
|
108 |
*/ |
|
109 |
public Rectangle2D getBounds2D() { |
|
110 |
return null; |
|
111 |
} |
|
112 |
|
|
113 |
/** |
|
114 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
115 |
*/ |
|
116 |
public boolean contains(Rectangle2D arg0) { |
|
117 |
return false; |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
122 |
*/ |
|
123 |
public boolean intersects(Rectangle2D arg0) { |
|
124 |
return false; |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
129 |
*/ |
|
130 |
public PathIterator getPathIterator(AffineTransform arg0) { |
|
131 |
return null; |
|
132 |
} |
|
133 |
|
|
134 |
/** |
|
135 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
136 |
* double) |
|
137 |
*/ |
|
138 |
public PathIterator getPathIterator(AffineTransform arg0, double arg1) { |
|
139 |
return null; |
|
140 |
} |
|
141 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Polygon3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
import org.geotools.renderer.style.Style2D; |
|
5 |
|
|
6 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
7 |
|
|
8 |
import java.awt.Color; |
|
9 |
import java.awt.Graphics2D; |
|
10 |
import java.awt.Rectangle; |
|
11 |
import java.awt.geom.AffineTransform; |
|
12 |
import java.awt.geom.PathIterator; |
|
13 |
import java.awt.geom.Point2D; |
|
14 |
import java.awt.geom.Rectangle2D; |
|
15 |
|
|
16 |
|
|
17 |
/** |
|
18 |
* Polilinea 3D. |
|
19 |
* |
|
20 |
* @author Vicente Caballero Navarro |
|
21 |
* |
|
22 |
*/ |
|
23 |
public class Polygon3D implements FGeometry { |
|
24 |
private GeneralPathX gp = null; |
|
25 |
double[] pZ = null; |
|
26 |
|
|
27 |
/** |
|
28 |
* Crea un nuevo Polyline3D. |
|
29 |
* |
|
30 |
* @param gpx DOCUMENT ME! |
|
31 |
* @param pZ DOCUMENT ME! |
|
32 |
*/ |
|
33 |
public Polygon3D(GeneralPathX gpx, double[] pZ) { |
|
34 |
gp = gpx; |
|
35 |
this.pZ = pZ; |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
40 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
41 |
*/ |
|
42 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
43 |
gp.transform(vp.getAffineTransform()); |
|
44 |
|
|
45 |
//g.setPaint(Color.red); |
|
46 |
//g.fill(gp); |
|
47 |
g.setPaint(Color.black); |
|
48 |
g.draw(gp); |
|
49 |
} |
|
50 |
|
|
51 |
|
|
52 |
/** |
|
53 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
54 |
*/ |
|
55 |
public int getType() { |
|
56 |
return FGeometry.LINE; |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
61 |
*/ |
|
62 |
public Geometry toJTSGeometry() { |
|
63 |
return null; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
68 |
*/ |
|
69 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
70 |
return null; |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* @see java.awt.Shape#contains(double, double) |
|
75 |
*/ |
|
76 |
public boolean contains(double x, double y) { |
|
77 |
return gp.contains(x,y); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
82 |
*/ |
|
83 |
public boolean contains(double x, double y, double w, double h) { |
|
84 |
return gp.contains(x,y,w,h); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
89 |
*/ |
|
90 |
public boolean intersects(double x, double y, double w, double h) { |
|
91 |
return gp.intersects(x,y,w,h); |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* @see java.awt.Shape#getBounds() |
|
96 |
*/ |
|
97 |
public Rectangle getBounds() { |
|
98 |
return gp.getBounds(); |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
103 |
*/ |
|
104 |
public boolean contains(Point2D p) { |
|
105 |
return gp.contains(p); |
|
106 |
} |
|
107 |
|
|
108 |
/** |
|
109 |
* @see java.awt.Shape#getBounds2D() |
|
110 |
*/ |
|
111 |
public Rectangle2D getBounds2D() { |
|
112 |
return gp.getBounds2D(); |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
117 |
*/ |
|
118 |
public boolean contains(Rectangle2D r) { |
|
119 |
return gp.contains(r); |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
124 |
*/ |
|
125 |
public boolean intersects(Rectangle2D r) { |
|
126 |
return gp.intersects(r); |
|
127 |
} |
|
128 |
|
|
129 |
/** |
|
130 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
131 |
*/ |
|
132 |
public PathIterator getPathIterator(AffineTransform at) { |
|
133 |
return gp.getPathIterator(at); |
|
134 |
} |
|
135 |
|
|
136 |
/** |
|
137 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
138 |
* double) |
|
139 |
*/ |
|
140 |
public PathIterator getPathIterator(AffineTransform at, double d) { |
|
141 |
return gp.getPathIterator(at,d); |
|
142 |
} |
|
143 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Point2D.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
2 |
package com.iver.cit.gvsig.fmap.core; |
|
3 |
|
|
4 |
import org.geotools.geometry.Geometry; |
|
5 |
|
|
6 |
import org.geotools.renderer.style.Style2D; |
|
7 |
|
|
8 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
9 |
|
|
10 |
import java.awt.Color; |
|
11 |
import java.awt.Graphics2D; |
|
12 |
import java.awt.Rectangle; |
|
13 |
import java.awt.geom.AffineTransform; |
|
14 |
import java.awt.geom.PathIterator; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Punto 2D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
*/ |
|
23 |
public class Point2D implements FGeometry { |
|
24 |
|
|
25 |
private double x; |
|
26 |
private double y; |
|
27 |
|
|
28 |
/** |
|
29 |
* Crea un nuevo Point2D. |
|
30 |
* |
|
31 |
* @param x DOCUMENT ME! |
|
32 |
* @param y DOCUMENT ME! |
|
33 |
*/ |
|
34 |
public Point2D(double x, double y) { |
|
35 |
this.x = x; |
|
36 |
this.y = y; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
41 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
42 |
*/ |
|
43 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
44 |
int size = 2; |
|
45 |
int hw=4; |
|
46 |
java.awt.geom.Point2D.Double p1=new java.awt.geom.Point2D.Double(x,y); |
|
47 |
java.awt.geom.Point2D.Double p=new java.awt.geom.Point2D.Double(); |
|
48 |
vp.getAffineTransform().transform(p1,p); |
|
49 |
g.setColor(Color.red); |
|
50 |
|
|
51 |
g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
52 |
(int) hw); |
|
53 |
g.setColor(Color.black); |
|
54 |
g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
55 |
(int) hw); |
|
56 |
} |
|
57 |
|
|
58 |
|
|
59 |
/** |
|
60 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
61 |
*/ |
|
62 |
public int getType() { |
|
63 |
return FGeometry.POINT; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
68 |
*/ |
|
69 |
public Geometry toJTSGeometry() { |
|
70 |
return null; |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
75 |
*/ |
|
76 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
77 |
return null; |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* @see java.awt.Shape#contains(double, double) |
|
82 |
*/ |
|
83 |
public boolean contains(double x, double y) { |
|
84 |
return false; |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
89 |
*/ |
|
90 |
public boolean contains(double x, double y, double w, double h) { |
|
91 |
return false; |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
96 |
*/ |
|
97 |
public boolean intersects(double x, double y, double w, double h) { |
|
98 |
return false; |
|
99 |
} |
|
100 |
|
|
101 |
/** |
|
102 |
* @see java.awt.Shape#getBounds() |
|
103 |
*/ |
|
104 |
public Rectangle getBounds() { |
|
105 |
return null; |
|
106 |
} |
|
107 |
|
|
108 |
/** |
|
109 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
110 |
*/ |
|
111 |
public boolean contains(java.awt.geom.Point2D p) { |
|
112 |
return false; |
|
113 |
} |
|
114 |
|
|
115 |
/** |
|
116 |
* @see java.awt.Shape#getBounds2D() |
|
117 |
*/ |
|
118 |
public Rectangle2D getBounds2D() { |
|
119 |
return null; |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
124 |
*/ |
|
125 |
public boolean contains(Rectangle2D r) { |
|
126 |
return false; |
|
127 |
} |
|
128 |
|
|
129 |
/** |
|
130 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
131 |
*/ |
|
132 |
public boolean intersects(Rectangle2D r) { |
|
133 |
return r.contains(x,y); |
|
134 |
} |
|
135 |
|
|
136 |
/** |
|
137 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
138 |
*/ |
|
139 |
public PathIterator getPathIterator(AffineTransform at) { |
|
140 |
return null; |
|
141 |
} |
|
142 |
|
|
143 |
/** |
|
144 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
145 |
* double) |
|
146 |
*/ |
|
147 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
148 |
return null; |
|
149 |
} |
|
150 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Point3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Punto 3D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class Point3D implements FGeometry { |
|
25 |
double x; |
|
26 |
double y; |
|
27 |
double z; |
|
28 |
public Point3D(double x,double y,double z){ |
|
29 |
this.x=x; |
|
30 |
this.y=y; |
|
31 |
this.z=z; |
|
32 |
} |
|
33 |
|
|
34 |
/** |
|
35 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
36 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
37 |
*/ |
|
38 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
39 |
int size = 2; |
|
40 |
int hw=4; |
|
41 |
java.awt.geom.Point2D.Double p=new java.awt.geom.Point2D.Double(x,y); |
|
42 |
vp.getAffineTransform().transform(p,p); |
|
43 |
g.setColor(Color.red); |
|
44 |
g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
45 |
(int) hw); |
|
46 |
g.setColor(Color.black); |
|
47 |
g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
48 |
(int) hw); |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
|
|
53 |
/** |
|
54 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
55 |
*/ |
|
56 |
public int getType() { |
|
57 |
return FGeometry.POINT; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
62 |
*/ |
|
63 |
public Geometry toJTSGeometry() { |
|
64 |
return null; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
69 |
*/ |
|
70 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
71 |
return null; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* @see java.awt.Shape#contains(double, double) |
|
76 |
*/ |
|
77 |
public boolean contains(double arg0, double arg1) { |
|
78 |
return false; |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
83 |
*/ |
|
84 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
|
85 |
return false; |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
90 |
*/ |
|
91 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
|
92 |
return false; |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* @see java.awt.Shape#getBounds() |
|
97 |
*/ |
|
98 |
public Rectangle getBounds() { |
|
99 |
return null; |
|
100 |
} |
|
101 |
|
|
102 |
/** |
|
103 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
104 |
*/ |
|
105 |
public boolean contains(Point2D arg0) { |
|
106 |
return false; |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* @see java.awt.Shape#getBounds2D() |
|
111 |
*/ |
|
112 |
public Rectangle2D getBounds2D() { |
|
113 |
return null; |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
118 |
*/ |
|
119 |
public boolean contains(Rectangle2D arg0) { |
|
120 |
return false; |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
124 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
125 |
*/ |
|
126 |
public boolean intersects(Rectangle2D r) { |
|
127 |
return r.contains(x,y); |
|
128 |
} |
|
129 |
|
|
130 |
/** |
|
131 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
132 |
*/ |
|
133 |
public PathIterator getPathIterator(AffineTransform arg0) { |
|
134 |
return null; |
|
135 |
} |
|
136 |
|
|
137 |
/** |
|
138 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
139 |
* double) |
|
140 |
*/ |
|
141 |
public PathIterator getPathIterator(AffineTransform arg0, double arg1) { |
|
142 |
return null; |
|
143 |
} |
|
144 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Polyline2D.java | ||
---|---|---|
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 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Polyline3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Polilinea 3D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class Polyline3D implements FGeometry { |
|
25 |
private GeneralPathX gp = null; |
|
26 |
double[] pZ = null; |
|
27 |
|
|
28 |
/** |
|
29 |
* Crea un nuevo Polyline3D. |
|
30 |
* |
|
31 |
* @param gpx DOCUMENT ME! |
|
32 |
* @param pZ DOCUMENT ME! |
|
33 |
*/ |
|
34 |
public Polyline3D(GeneralPathX gpx, double[] pZ) { |
|
35 |
gp = gpx; |
|
36 |
this.pZ = pZ; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
41 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
42 |
*/ |
|
43 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
44 |
gp.transform(vp.getAffineTransform()); |
|
45 |
|
|
46 |
//g.setPaint(Color.red); |
|
47 |
//g.fill(gp); |
|
48 |
g.setPaint(Color.black); |
|
49 |
g.draw(gp); |
|
50 |
} |
|
51 |
|
|
52 |
|
|
53 |
/** |
|
54 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
55 |
*/ |
|
56 |
public int getType() { |
|
57 |
return FGeometry.LINE; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
62 |
*/ |
|
63 |
public Geometry toJTSGeometry() { |
|
64 |
return null; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
69 |
*/ |
|
70 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
71 |
return null; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* @see java.awt.Shape#contains(double, double) |
|
76 |
*/ |
|
77 |
public boolean contains(double x, double y) { |
|
78 |
return gp.contains(x,y); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
83 |
*/ |
|
84 |
public boolean contains(double x, double y, double w, double h) { |
|
85 |
return gp.contains(x,y,w,h); |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
90 |
*/ |
|
91 |
public boolean intersects(double x, double y, double w, double h) { |
|
92 |
return gp.intersects(x,y,w,h); |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* @see java.awt.Shape#getBounds() |
|
97 |
*/ |
|
98 |
public Rectangle getBounds() { |
|
99 |
return gp.getBounds(); |
|
100 |
} |
|
101 |
|
|
102 |
/** |
|
103 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
104 |
*/ |
|
105 |
public boolean contains(Point2D p) { |
|
106 |
return gp.contains(p); |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* @see java.awt.Shape#getBounds2D() |
|
111 |
*/ |
|
112 |
public Rectangle2D getBounds2D() { |
|
113 |
return gp.getBounds2D(); |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
118 |
*/ |
|
119 |
public boolean contains(Rectangle2D r) { |
|
120 |
return gp.contains(r); |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
124 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
125 |
*/ |
|
126 |
public boolean intersects(Rectangle2D r) { |
|
127 |
return gp.intersects(r); |
|
128 |
} |
|
129 |
|
|
130 |
/** |
|
131 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
132 |
*/ |
|
133 |
public PathIterator getPathIterator(AffineTransform at) { |
|
134 |
return gp.getPathIterator(at); |
|
135 |
} |
|
136 |
|
|
137 |
/** |
|
138 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
139 |
* double) |
|
140 |
*/ |
|
141 |
public PathIterator getPathIterator(AffineTransform at, double d) { |
|
142 |
return gp.getPathIterator(at,d); |
|
143 |
} |
|
144 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/NullGeometry.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
2 |
|
|
3 |
package com.iver.cit.gvsig.fmap.core; |
|
4 |
|
|
5 |
import java.awt.Graphics2D; |
|
6 |
import java.awt.Rectangle; |
|
7 |
import java.awt.geom.AffineTransform; |
|
8 |
import java.awt.geom.PathIterator; |
|
9 |
import java.awt.geom.Point2D; |
|
10 |
import java.awt.geom.Rectangle2D; |
|
11 |
|
|
12 |
import org.geotools.geometry.Geometry; |
|
13 |
import org.geotools.renderer.style.Style2D; |
|
14 |
|
|
15 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
16 |
|
|
17 |
public class NullGeometry implements FGeometry { |
|
18 |
|
|
19 |
/** |
|
20 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, ViewPort, org.geotools.renderer.style.Style2D) |
|
21 |
*/ |
|
22 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
23 |
} |
|
24 |
|
|
25 |
|
|
26 |
/** |
|
27 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
28 |
*/ |
|
29 |
public int getType() { |
|
30 |
return 0; |
|
31 |
} |
|
32 |
|
|
33 |
/** |
|
34 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
35 |
*/ |
|
36 |
public Geometry toJTSGeometry() { |
|
37 |
return null; |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
42 |
*/ |
|
43 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
44 |
return null; |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* @see java.awt.Shape#contains(double, double) |
|
49 |
*/ |
|
50 |
public boolean contains(double x, double y) { |
|
51 |
return false; |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
56 |
*/ |
|
57 |
public boolean contains(double x, double y, double w, double h) { |
|
58 |
return false; |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
63 |
*/ |
|
64 |
public boolean intersects(double x, double y, double w, double h) { |
|
65 |
return false; |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see java.awt.Shape#getBounds() |
|
70 |
*/ |
|
71 |
public Rectangle getBounds() { |
|
72 |
return null; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
77 |
*/ |
|
78 |
public boolean contains(Point2D p) { |
|
79 |
return false; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* @see java.awt.Shape#getBounds2D() |
|
84 |
*/ |
|
85 |
public Rectangle2D getBounds2D() { |
|
86 |
return null; |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
91 |
*/ |
|
92 |
public boolean contains(Rectangle2D r) { |
|
93 |
return false; |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
98 |
*/ |
|
99 |
public boolean intersects(Rectangle2D r) { |
|
100 |
return false; |
|
101 |
} |
|
102 |
|
|
103 |
/** |
|
104 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
105 |
*/ |
|
106 |
public PathIterator getPathIterator(AffineTransform at) { |
|
107 |
return null; |
|
108 |
} |
|
109 |
|
|
110 |
/** |
|
111 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double) |
|
112 |
*/ |
|
113 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
114 |
return null; |
|
115 |
} |
|
116 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/MultiPoint2D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Multipunto 2D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class MultiPoint2D implements FGeometry { |
|
25 |
double[] x=null; |
|
26 |
double[] y=null; |
|
27 |
/** |
|
28 |
* Crea un nuevo MultiPoint2D. |
|
29 |
* |
|
30 |
* @param p DOCUMENT ME! |
|
31 |
*/ |
|
32 |
public MultiPoint2D(double[] x,double[] y) { |
|
33 |
this.x=x; |
|
34 |
this.y=y; |
|
35 |
} |
|
36 |
|
|
37 |
/** |
|
38 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
39 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
40 |
*/ |
|
41 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
42 |
int size = 2; |
|
43 |
int hw=4; |
|
44 |
for (int i=0;i<x.length;i++){ |
|
45 |
java.awt.geom.Point2D.Double p=new java.awt.geom.Point2D.Double(x[i],y[i]); |
|
46 |
vp.getAffineTransform().transform(p,p); |
|
47 |
g.setColor(Color.red); |
|
48 |
g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
49 |
(int) hw); |
|
50 |
g.setColor(Color.black); |
|
51 |
g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
52 |
(int) hw); |
|
53 |
} |
|
54 |
} |
|
55 |
|
|
56 |
|
|
57 |
/** |
|
58 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
59 |
*/ |
|
60 |
public int getType() { |
|
61 |
return FGeometry.POINT; |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
66 |
*/ |
|
67 |
public Geometry toJTSGeometry() { |
|
68 |
return null; |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
73 |
*/ |
|
74 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
75 |
return null; |
|
76 |
} |
|
77 |
|
|
78 |
/** |
|
79 |
* @see java.awt.Shape#contains(double, double) |
|
80 |
*/ |
|
81 |
public boolean contains(double arg0, double arg1) { |
|
82 |
return false; |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
87 |
*/ |
|
88 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
|
89 |
return false; |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
94 |
*/ |
|
95 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
|
96 |
return false; |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* @see java.awt.Shape#getBounds() |
|
101 |
*/ |
|
102 |
public Rectangle getBounds() { |
|
103 |
return null; |
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
108 |
*/ |
|
109 |
public boolean contains(Point2D arg0) { |
|
110 |
return false; |
|
111 |
} |
|
112 |
|
|
113 |
/** |
|
114 |
* @see java.awt.Shape#getBounds2D() |
|
115 |
*/ |
|
116 |
public Rectangle2D getBounds2D() { |
|
117 |
return null; |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
122 |
*/ |
|
123 |
public boolean contains(Rectangle2D arg0) { |
|
124 |
return false; |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
129 |
*/ |
|
130 |
public boolean intersects(Rectangle2D r) { |
|
131 |
return false; |
|
132 |
} |
|
133 |
|
|
134 |
/** |
|
135 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
136 |
*/ |
|
137 |
public PathIterator getPathIterator(AffineTransform arg0) { |
|
138 |
return null; |
|
139 |
} |
|
140 |
|
|
141 |
/** |
|
142 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
143 |
* double) |
|
144 |
*/ |
|
145 |
public PathIterator getPathIterator(AffineTransform arg0, double arg1) { |
|
146 |
return null; |
|
147 |
} |
|
148 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Multipoint3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Multipunto 3D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class Multipoint3D implements FGeometry { |
|
25 |
double[] x = null; |
|
26 |
double[] y = null; |
|
27 |
double[] z = null; |
|
28 |
|
|
29 |
/** |
|
30 |
* Crea un nuevo Multipoint3D. |
|
31 |
*/ |
|
32 |
public Multipoint3D(double[] x,double[] y, double[] z) { |
|
33 |
this.x=x; |
|
34 |
this.y=y; |
|
35 |
this.z=z; |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
40 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
41 |
*/ |
|
42 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
43 |
int size = 2; |
|
44 |
int hw=4; |
|
45 |
for (int i=0;i<x.length;i++){ |
|
46 |
java.awt.geom.Point2D.Double p=new java.awt.geom.Point2D.Double(x[i],y[i]); |
|
47 |
vp.getAffineTransform().transform(p,p); |
|
48 |
g.setColor(Color.red); |
|
49 |
g.fillOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
50 |
(int) hw); |
|
51 |
g.setColor(Color.black); |
|
52 |
g.drawOval((int) p.x - size, (int) p.y - size, (int) hw, |
|
53 |
(int) hw); |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
|
|
58 |
/** |
|
59 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
60 |
*/ |
|
61 |
public int getType() { |
|
62 |
return 0; |
|
63 |
} |
|
64 |
|
|
65 |
/** |
|
66 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
67 |
*/ |
|
68 |
public Geometry toJTSGeometry() { |
|
69 |
return null; |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
74 |
*/ |
|
75 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
76 |
return null; |
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* @see java.awt.Shape#contains(double, double) |
|
81 |
*/ |
|
82 |
public boolean contains(double arg0, double arg1) { |
|
83 |
return false; |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
88 |
*/ |
|
89 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
|
90 |
return false; |
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
95 |
*/ |
|
96 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
|
97 |
return false; |
|
98 |
} |
|
99 |
|
|
100 |
/** |
|
101 |
* @see java.awt.Shape#getBounds() |
|
102 |
*/ |
|
103 |
public Rectangle getBounds() { |
|
104 |
return null; |
|
105 |
} |
|
106 |
|
|
107 |
/** |
|
108 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
109 |
*/ |
|
110 |
public boolean contains(Point2D arg0) { |
|
111 |
return false; |
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* @see java.awt.Shape#getBounds2D() |
|
116 |
*/ |
|
117 |
public Rectangle2D getBounds2D() { |
|
118 |
return null; |
|
119 |
} |
|
120 |
|
|
121 |
/** |
|
122 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
123 |
*/ |
|
124 |
public boolean contains(Rectangle2D arg0) { |
|
125 |
return false; |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
130 |
*/ |
|
131 |
public boolean intersects(Rectangle2D arg0) { |
|
132 |
return false; |
|
133 |
} |
|
134 |
|
|
135 |
/** |
|
136 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
137 |
*/ |
|
138 |
public PathIterator getPathIterator(AffineTransform arg0) { |
|
139 |
return null; |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, |
|
144 |
* double) |
|
145 |
*/ |
|
146 |
public PathIterator getPathIterator(AffineTransform arg0, double arg1) { |
|
147 |
return null; |
|
148 |
} |
|
149 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FNullGeometry.java | ||
---|---|---|
1 |
/* Generated by Together */ |
|
2 |
|
|
3 |
package com.iver.cit.gvsig.fmap.core; |
|
4 |
|
|
5 |
import java.awt.Graphics2D; |
|
6 |
import java.awt.Rectangle; |
|
7 |
import java.awt.geom.AffineTransform; |
|
8 |
import java.awt.geom.PathIterator; |
|
9 |
import java.awt.geom.Point2D; |
|
10 |
import java.awt.geom.Rectangle2D; |
|
11 |
|
|
12 |
import org.geotools.geometry.Geometry; |
|
13 |
import org.geotools.renderer.style.Style2D; |
|
14 |
|
|
15 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
16 |
|
|
17 |
public class FNullGeometry implements FGeometry { |
|
18 |
|
|
19 |
/** |
|
20 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, ViewPort, org.geotools.renderer.style.Style2D) |
|
21 |
*/ |
|
22 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
23 |
} |
|
24 |
|
|
25 |
|
|
26 |
/** |
|
27 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
|
28 |
*/ |
|
29 |
public int getType() { |
|
30 |
return 0; |
|
31 |
} |
|
32 |
|
|
33 |
/** |
|
34 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry() |
|
35 |
*/ |
|
36 |
public Geometry toJTSGeometry() { |
|
37 |
return null; |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean) |
|
42 |
*/ |
|
43 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
|
44 |
return null; |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* @see java.awt.Shape#contains(double, double) |
|
49 |
*/ |
|
50 |
public boolean contains(double x, double y) { |
|
51 |
return false; |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* @see java.awt.Shape#contains(double, double, double, double) |
|
56 |
*/ |
|
57 |
public boolean contains(double x, double y, double w, double h) { |
|
58 |
return false; |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* @see java.awt.Shape#intersects(double, double, double, double) |
|
63 |
*/ |
|
64 |
public boolean intersects(double x, double y, double w, double h) { |
|
65 |
return false; |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see java.awt.Shape#getBounds() |
|
70 |
*/ |
|
71 |
public Rectangle getBounds() { |
|
72 |
return null; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
|
77 |
*/ |
|
78 |
public boolean contains(Point2D p) { |
|
79 |
return false; |
|
80 |
} |
|
81 |
|
|
82 |
/** |
|
83 |
* @see java.awt.Shape#getBounds2D() |
|
84 |
*/ |
|
85 |
public Rectangle2D getBounds2D() { |
|
86 |
return null; |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
|
91 |
*/ |
|
92 |
public boolean contains(Rectangle2D r) { |
|
93 |
return false; |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D) |
|
98 |
*/ |
|
99 |
public boolean intersects(Rectangle2D r) { |
|
100 |
return false; |
|
101 |
} |
|
102 |
|
|
103 |
/** |
|
104 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform) |
|
105 |
*/ |
|
106 |
public PathIterator getPathIterator(AffineTransform at) { |
|
107 |
return null; |
|
108 |
} |
|
109 |
|
|
110 |
/** |
|
111 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double) |
|
112 |
*/ |
|
113 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
|
114 |
return null; |
|
115 |
} |
|
116 |
} |
|
0 | 117 |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FMultiPoint2D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.fmap.core; |
|
2 |
|
|
3 |
import org.geotools.geometry.Geometry; |
|
4 |
|
|
5 |
import org.geotools.renderer.style.Style2D; |
|
6 |
|
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
|
8 |
|
|
9 |
import java.awt.Color; |
|
10 |
import java.awt.Graphics2D; |
|
11 |
import java.awt.Rectangle; |
|
12 |
import java.awt.geom.AffineTransform; |
|
13 |
import java.awt.geom.PathIterator; |
|
14 |
import java.awt.geom.Point2D; |
|
15 |
import java.awt.geom.Rectangle2D; |
|
16 |
|
|
17 |
|
|
18 |
/** |
|
19 |
* Multipunto 2D. |
|
20 |
* |
|
21 |
* @author Vicente Caballero Navarro |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class FMultiPoint2D implements FGeometry { |
|
25 |
double[] x=null; |
|
26 |
double[] y=null; |
|
27 |
/** |
|
28 |
* Crea un nuevo MultiPoint2D. |
|
29 |
* |
|
30 |
* @param p DOCUMENT ME! |
|
31 |
*/ |
|
32 |
public FMultiPoint2D(double[] x,double[] y) { |
|
33 |
this.x=x; |
|
34 |
this.y=y; |
|
35 |
} |
|
36 |
|
|
37 |
/** |
|
38 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, |
|
39 |
* ViewPort, org.geotools.renderer.style.Style2D) |
|
40 |
*/ |
|
41 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
42 |
int size = 2; |
|
43 |
int hw=4; |
|
44 |
for (int i=0;i<x.length;i++){ |
|
45 |
java.awt.geom.Point2D.Double p=new java.awt.geom.Point2D.Double(x[i],y[i]); |
|
46 |
vp.getAffineTransform().transform(p,p); |
|
47 |
g.setColor(Color.red); |
Also available in: Unified diff