root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / FPoint2D.java @ 262
History | View | Annotate | Download (3.48 KB)
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 FPoint2D implements FGeometry { |
24 |
|
25 |
protected double x; |
26 |
protected double y; |
27 |
|
28 |
/**
|
29 |
* Crea un nuevo Point2D.
|
30 |
*
|
31 |
* @param x DOCUMENT ME!
|
32 |
* @param y DOCUMENT ME!
|
33 |
*/
|
34 |
public FPoint2D(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 |
} |