Revision 240 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/Polyline2D.java
Polyline2D.java | ||
---|---|---|
7 | 7 |
import java.awt.geom.PathIterator; |
8 | 8 |
import java.awt.geom.Point2D; |
9 | 9 |
import java.awt.geom.Rectangle2D; |
10 |
import java.awt.image.BufferedImage; |
|
11 | 10 |
|
12 | 11 |
import org.geotools.geometry.Geometry; |
13 | 12 |
import org.geotools.renderer.style.LineStyle2D; |
... | ... | |
25 | 24 |
} |
26 | 25 |
|
27 | 26 |
/** |
28 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, ViewPort, java.awt.geom.Rectangle2D)
|
|
27 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D, ViewPort, java.awt.geom.Rectangle2D) |
|
29 | 28 |
*/ |
30 |
public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Style2D symbol) {
|
|
29 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
|
31 | 30 |
// if (gp.intersects(extent)){ |
32 | 31 |
if (symbol instanceof LineStyle2D) |
33 | 32 |
{ |
34 | 33 |
LineStyle2D style2D = (LineStyle2D) symbol; |
35 | 34 |
|
36 | 35 |
g.setPaint(Color.black); |
37 |
|
|
38 |
Rectangle2D BoundingBox = getBounds2D(); |
|
39 |
|
|
40 |
if ((BoundingBox.getHeight() > vp.getDist1pixel()) || |
|
41 |
(BoundingBox.getWidth() > vp.getDist1pixel())) |
|
42 |
{ |
|
43 |
|
|
44 |
// theSymbol = getAssociatedSymbol(numReg); |
|
45 |
gp.transform(vp.getAffineTransform()); |
|
46 |
g.draw(gp); |
|
47 |
} |
|
48 |
else |
|
49 |
{ |
|
50 |
Point2D.Double pOrig = new Point2D.Double(getBounds2D().getMinX(), |
|
51 |
getBounds2D().getMinY()); |
|
52 |
Point2D pDest; |
|
53 |
|
|
54 |
pDest = vp.getAffineTransform().transform(pOrig, null); |
|
55 |
|
|
56 |
int pixX = (int) pDest.getX(); |
|
57 |
int pixY = (int) pDest.getY(); |
|
58 |
|
|
59 |
if ((pixX > 0) && (pixX < image.getWidth())) { |
|
60 |
if ((pixY > 0) && (pixY < image.getHeight())) { |
|
61 |
// theSymbol = getAssociatedSymbol(numReg); |
|
62 |
image.setRGB(pixX, pixY, |
|
63 |
Color.GRAY.getRGB()); |
|
64 |
} |
|
65 |
} |
|
66 |
} |
|
36 |
|
|
37 |
gp.transform(vp.getAffineTransform()); |
|
38 |
g.draw(gp); |
|
67 | 39 |
} |
68 | 40 |
|
69 | 41 |
/* StyledShapePainter painter = new StyledShapePainter(); |
... | ... | |
72 | 44 |
// } |
73 | 45 |
} |
74 | 46 |
|
75 |
/** |
|
76 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#print(java.awt.Graphics2D, java.awt.geom.AffineTransform, org.geotools.renderer.style.Style2D, java.awt.geom.Rectangle2D) |
|
77 |
*/ |
|
78 |
public void print(Graphics2D g, AffineTransform mt, Style2D symbol, Rectangle2D extent) { |
|
79 |
} |
|
80 | 47 |
|
81 | 48 |
/** |
82 | 49 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType() |
Also available in: Unified diff