root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / FPoint2D.java @ 266
History | View | Annotate | Download (1.74 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#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 |
} |