Revision 310
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometry.java | ||
---|---|---|
39 | 39 |
// SHAPE |
40 | 40 |
// Shape shpTrans = vp.getAffineTransform().createTransformedShape(shp); |
41 | 41 |
transform(vp.getAffineTransform()); |
42 |
if (shp instanceof FPoint2D) |
|
43 |
{ |
|
44 |
FPoint2D p = (FPoint2D) shp; |
|
45 |
if (symbol instanceof MarkStyle2D) { |
|
46 |
|
|
47 |
MarkStyle2D ms2d = (MarkStyle2D) symbol; |
|
42 |
shpPainter.paint(g, shp, symbol, 0); |
|
48 | 43 |
|
49 |
if (ms2d.getFill() != null) { |
|
50 |
g.setPaint(ms2d.getFill()); |
|
51 |
// graphics.setComposite(ms2d.getFillComposite()); |
|
52 |
// g.fill(tShp); |
|
53 |
g.fillRect((int) p.p.getX(), (int) p.p.getY(), 10,10); |
|
54 |
} |
|
55 |
|
|
56 |
if (ms2d.getContour() != null) { |
|
57 |
g.setPaint(ms2d.getContour()); |
|
58 |
g.setStroke(ms2d.getStroke()); |
|
59 |
// graphics.setComposite(ms2d.getContourComposite()); |
|
60 |
g.drawRect((int) p.p.getX(), (int) p.p.getY(), 10,10); |
|
61 |
} |
|
62 |
// |
|
63 |
} |
|
64 |
|
|
65 |
} |
|
66 |
else |
|
67 |
{ |
|
68 |
shpPainter.paint(g, shp, symbol, 0); |
|
69 |
} |
|
70 |
|
|
71 | 44 |
|
72 | 45 |
} |
73 | 46 |
|
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometryCollection.java | ||
---|---|---|
17 | 17 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#draw(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, org.geotools.renderer.style.Style2D) |
18 | 18 |
*/ |
19 | 19 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
20 |
for (int i=0; i < geometries.length;i++) |
|
21 |
geometries[i].draw(g,vp,symbol); |
|
20 | 22 |
} |
21 | 23 |
|
22 | 24 |
/** |
... | ... | |
44 | 46 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D() |
45 | 47 |
*/ |
46 | 48 |
public Rectangle2D getBounds2D() { |
47 |
return null; |
|
49 |
Rectangle2D rAux = null; |
|
50 |
for (int i=0; i < geometries.length;i++) |
|
51 |
rAux.createUnion(geometries[i].getBounds2D()); |
|
52 |
return rAux; |
|
48 | 53 |
} |
49 | 54 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/styling/FStyle2D.java | ||
---|---|---|
51 | 51 |
this.style2D = style2D; |
52 | 52 |
// Recalculamos el RGB |
53 | 53 |
Graphics2D g2 = img.createGraphics(); |
54 |
/*g2.setPaint(style2D.getContour()); |
|
55 |
g2.setStroke(style2D.getStroke()); |
|
56 |
if (style2D.getContourComposite() != null) |
|
57 |
g2.setComposite(style2D.getContourComposite()); |
|
58 | 54 |
|
59 |
g2.draw(rect); */ |
|
60 |
|
|
61 | 55 |
shpPainter.paint(g2,rect,style2D,0); |
62 | 56 |
rgb = img.getRGB(0,0); |
63 | 57 |
|
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/FStyledShapePainter.java | ||
---|---|---|
86 | 86 |
LOGGER.fine("Out of scale"); |
87 | 87 |
|
88 | 88 |
return; |
89 |
} |
|
89 |
}
|
|
90 | 90 |
|
91 | 91 |
// if(LOGGER.isLoggable(Level.FINE)) { |
92 | 92 |
// LOGGER.fine("Graphics transform: " + graphics.getTransform()); |
... | ... | |
94 | 94 |
|
95 | 95 |
if (style instanceof MarkStyle2D) { |
96 | 96 |
// get the point onto the shape has to be painted |
97 |
// SI ES UN RECTANGULO, ES MEJOR USAR g.fillRect, es mucho m?s |
|
98 |
// r?pido. Para el resto, va m?s lento. |
|
97 | 99 |
float[] coords = new float[2]; |
98 | 100 |
PathIterator iter = shape.getPathIterator(IDENTITY_TRANSFORM); |
99 |
iter.currentSegment(coords); |
|
101 |
iter.currentSegment(coords);
|
|
100 | 102 |
|
101 | 103 |
MarkStyle2D ms2d = (MarkStyle2D) style; |
102 | 104 |
Shape transformedShape = ms2d.getTransformedShape(coords[0], |
103 |
coords[1]); |
|
105 |
coords[1]); |
|
106 |
// Shape transformedShape = shape; |
|
104 | 107 |
|
105 | 108 |
if (transformedShape != null) { |
106 | 109 |
if (ms2d.getFill() != null) { |
107 | 110 |
graphics.setPaint(ms2d.getFill()); |
108 | 111 |
// graphics.setComposite(ms2d.getFillComposite()); |
109 |
graphics.fill(transformedShape); |
|
112 |
if (transformedShape instanceof Rectangle2D) |
|
113 |
{ |
|
114 |
Rectangle2D rAux = (Rectangle2D) transformedShape; |
|
115 |
graphics.fillRect((int) rAux.getX(), (int) rAux.getY(), |
|
116 |
(int) rAux.getWidth(), (int) rAux.getHeight()); |
|
117 |
} |
|
118 |
else |
|
119 |
{ |
|
120 |
graphics.fill(transformedShape); |
|
121 |
} |
|
122 |
// graphics.fillRect((int) coords[0], (int) coords[1], 10,10); |
|
110 | 123 |
} |
111 | 124 |
|
112 | 125 |
if (ms2d.getContour() != null) { |
Also available in: Unified diff