root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / fshape / Polyline2D.java @ 213
History | View | Annotate | Download (3.05 KB)
1 |
package com.iver.cit.gvsig.fmap.fshape; |
---|---|
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 |
import java.awt.image.BufferedImage; |
11 |
|
12 |
import org.geotools.renderer.style.Style2D; |
13 |
|
14 |
|
15 |
public class Polyline2D implements FGeometry{ |
16 |
private GeneralPathX gp;
|
17 |
|
18 |
public Polyline2D(GeneralPathX gpx){
|
19 |
gp = gpx; |
20 |
} |
21 |
|
22 |
/**
|
23 |
* @see com.iver.cit.gvsig.fmap.fshape.FGeometry#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, java.awt.geom.AffineTransform, org.geotools.renderer.style.Style2D, java.awt.geom.Rectangle2D)
|
24 |
*/
|
25 |
public void draw(BufferedImage image, Graphics2D g, Rectangle2D extent, AffineTransform at, Style2D symbol) { |
26 |
// if (gp.intersects(extent)){
|
27 |
gp.transform(at); |
28 |
|
29 |
g.setPaint(Color.BLACK);
|
30 |
g.draw(gp); |
31 |
|
32 |
/* StyledShapePainter painter = new StyledShapePainter();
|
33 |
painter.paint(g, this, symbol, vp.getScale());
|
34 |
*/
|
35 |
// }
|
36 |
} |
37 |
|
38 |
/**
|
39 |
* @see com.iver.cit.gvsig.fmap.fshape.FGeometry#print(java.awt.Graphics2D, java.awt.geom.AffineTransform, org.geotools.renderer.style.Style2D, java.awt.geom.Rectangle2D)
|
40 |
*/
|
41 |
public void print(Graphics2D g, AffineTransform mt, Style2D symbol, Rectangle2D extent) { |
42 |
} |
43 |
|
44 |
/**
|
45 |
* @see com.iver.cit.gvsig.fmap.fshape.FGeometry#getType()
|
46 |
*/
|
47 |
public int getType() { |
48 |
return FGeometry.LINE;
|
49 |
} |
50 |
|
51 |
/**
|
52 |
* @see com.iver.cit.gvsig.fmap.fshape.FGeometry#createLabels(int, boolean)
|
53 |
*/
|
54 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
55 |
return null; |
56 |
} |
57 |
|
58 |
/**
|
59 |
* @see java.awt.Shape#contains(double, double)
|
60 |
*/
|
61 |
public boolean contains(double x, double y) { |
62 |
return gp.contains(x, y);
|
63 |
} |
64 |
|
65 |
/**
|
66 |
* @see java.awt.Shape#contains(double, double, double, double)
|
67 |
*/
|
68 |
public boolean contains(double x, double y, double w, double h) { |
69 |
return gp.contains(x, y, w, h);
|
70 |
} |
71 |
|
72 |
/**
|
73 |
* @see java.awt.Shape#intersects(double, double, double, double)
|
74 |
*/
|
75 |
public boolean intersects(double x, double y, double w, double h) { |
76 |
return gp.intersects(x, y, w, h);
|
77 |
} |
78 |
|
79 |
/**
|
80 |
* @see java.awt.Shape#getBounds()
|
81 |
*/
|
82 |
public Rectangle getBounds() { |
83 |
return gp.getBounds();
|
84 |
} |
85 |
|
86 |
/**
|
87 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D)
|
88 |
*/
|
89 |
public boolean contains(Point2D p) { |
90 |
return gp.contains(p);
|
91 |
} |
92 |
|
93 |
/**
|
94 |
* @see java.awt.Shape#getBounds2D()
|
95 |
*/
|
96 |
public Rectangle2D getBounds2D() { |
97 |
return gp.getBounds2D();
|
98 |
} |
99 |
|
100 |
/**
|
101 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D)
|
102 |
*/
|
103 |
public boolean contains(Rectangle2D r) { |
104 |
return gp.contains(r);
|
105 |
} |
106 |
|
107 |
/**
|
108 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D)
|
109 |
*/
|
110 |
public boolean intersects(Rectangle2D r) { |
111 |
return gp.intersects(r);
|
112 |
} |
113 |
|
114 |
/**
|
115 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform)
|
116 |
*/
|
117 |
public PathIterator getPathIterator(AffineTransform at) { |
118 |
return gp.getPathIterator(at);
|
119 |
} |
120 |
|
121 |
/**
|
122 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform, double)
|
123 |
*/
|
124 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
125 |
return gp.getPathIterator(at, flatness);
|
126 |
} |
127 |
|
128 |
} |