Revision 703
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/LegendFactory.java | ||
---|---|---|
50 | 50 |
return new SingleSymbolLegend(new FSymbol(FConstant.SYMBOL_TYPE_FILL)); |
51 | 51 |
|
52 | 52 |
} |
53 |
return null;
|
|
53 |
return new SingleSymbolLegend(new FSymbol(FConstant.SYMBOL_TYPE_FILL));
|
|
54 | 54 |
|
55 | 55 |
} |
56 | 56 |
/** |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/MemoryDriver.java | ||
---|---|---|
86 | 86 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#getShape(int) |
87 | 87 |
*/ |
88 | 88 |
public IGeometry getShape(int index) throws IOException { |
89 |
return (IGeometry) arrayGeometries.get(index); |
|
89 |
IGeometry geom = (IGeometry) arrayGeometries.get(index); |
|
90 |
return geom.cloneGeometry(); |
|
90 | 91 |
} |
91 | 92 |
/* (non-Javadoc) |
92 | 93 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#getShapeCount() |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FLabel.java | ||
---|---|---|
152 | 152 |
public PathIterator getPathIterator(AffineTransform at, double arg1) { |
153 | 153 |
return new FPointIterator(pos.p,at); |
154 | 154 |
} |
155 |
/* (non-Javadoc) |
|
156 |
* @see com.iver.cit.gvsig.fmap.core.FShape#cloneFShape() |
|
157 |
*/ |
|
158 |
public FShape cloneFShape() { |
|
159 |
// TODO Auto-generated method stub |
|
160 |
return null; |
|
161 |
} |
|
155 | 162 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FPoint2D.java | ||
---|---|---|
52 | 52 |
* @see java.awt.Shape#intersects(double, double, double, double) |
53 | 53 |
*/ |
54 | 54 |
public boolean intersects(double x, double y, double w, double h) { |
55 |
// TODO Auto-generated method stub
|
|
56 |
return true;
|
|
55 |
Rectangle2D.Double rAux = new Rectangle2D.Double(x,y,w,h);
|
|
56 |
return rAux.contains(p.getX(), p.getY());
|
|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
/* (non-Javadoc) |
... | ... | |
76 | 76 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D) |
77 | 77 |
*/ |
78 | 78 |
public boolean contains(Point2D p) { |
79 |
// TODO Auto-generated method stub |
|
80 | 79 |
return false; |
81 | 80 |
} |
82 | 81 |
|
... | ... | |
91 | 90 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D) |
92 | 91 |
*/ |
93 | 92 |
public boolean contains(Rectangle2D r) { |
94 |
// TODO Auto-generated method stub |
|
95 | 93 |
return false; |
96 | 94 |
} |
97 | 95 |
|
... | ... | |
123 | 121 |
return FShape.POINT; |
124 | 122 |
} |
125 | 123 |
|
124 |
/* (non-Javadoc) |
|
125 |
* @see com.iver.cit.gvsig.fmap.core.FShape#cloneFShape() |
|
126 |
*/ |
|
127 |
public FShape cloneFShape() { |
|
128 |
return new FPoint2D(p.getX(), p.getY()); |
|
129 |
} |
|
130 |
|
|
126 | 131 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java | ||
---|---|---|
78 | 78 |
* "flattened PathIterator". El flattened indica que las curvas las pasa a segmentos |
79 | 79 |
* de l?nea recta AUTOMATICAMENTE!!!. |
80 | 80 |
*/ |
81 |
public static Geometry java2d_to_jts(FGeometry fgeom)
|
|
81 |
public static Geometry java2d_to_jts(FShape shp)
|
|
82 | 82 |
{ |
83 | 83 |
double flatness = 0.8; // Por ejemplo. Cuanto m?s peque?o, m?s segmentos necesitar? la curva |
84 | 84 |
// Es la m?xima distancia que permitimos que el trazo aproximado |
85 | 85 |
// difiera del trazo real. |
86 |
FShape shp = fgeom.getShape(); |
|
87 | 86 |
Geometry geoJTS = null; |
88 | 87 |
Coordinate coord; |
89 | 88 |
Coordinate[] coords; |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FGraphicUtilities.java | ||
---|---|---|
307 | 307 |
case FShape.POLYGON: |
308 | 308 |
if (theLabel.getOrig() == null) // Calculamos el punto solo la primera vez |
309 | 309 |
{ |
310 |
Geometry geo = FConverter.java2d_to_jts(ShapeFactory.createGeometry(shp));
|
|
310 |
Geometry geo = FConverter.java2d_to_jts(shp);
|
|
311 | 311 |
|
312 | 312 |
// System.out.println("Area de " + m_labelValues[numReg] + " = " |
313 | 313 |
// + geo.getArea()); |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FPolyline2D.java | ||
---|---|---|
97 | 97 |
return FShape.LINE; |
98 | 98 |
} |
99 | 99 |
|
100 |
/* (non-Javadoc) |
|
101 |
* @see com.iver.cit.gvsig.fmap.core.FShape#cloneFShape() |
|
102 |
*/ |
|
103 |
public FShape cloneFShape() { |
|
104 |
return new FPolyline2D((GeneralPathX) gp.clone()); |
|
105 |
} |
|
106 |
|
|
100 | 107 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FNullGeometry.java | ||
---|---|---|
5 | 5 |
import java.awt.Graphics2D; |
6 | 6 |
import java.awt.geom.Rectangle2D; |
7 | 7 |
|
8 |
import org.geotools.geometry.Geometry; |
|
9 |
|
|
10 | 8 |
import com.iver.cit.gvsig.fmap.ViewPort; |
11 | 9 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
12 | 10 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
11 |
import com.vividsolutions.jts.geom.Geometry; |
|
13 | 12 |
|
14 | 13 |
public class FNullGeometry implements IGeometry { |
15 | 14 |
|
... | ... | |
39 | 38 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#intersects(java.awt.geom.Rectangle2D) |
40 | 39 |
*/ |
41 | 40 |
public boolean intersects(Rectangle2D r) { |
42 |
// TODO Auto-generated method stub |
|
43 | 41 |
return false; |
44 | 42 |
} |
45 | 43 |
|
... | ... | |
48 | 46 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D() |
49 | 47 |
*/ |
50 | 48 |
public Rectangle2D getBounds2D() { |
51 |
// TODO Auto-generated method stub |
|
52 | 49 |
return null; |
53 | 50 |
} |
54 | 51 |
|
... | ... | |
65 | 62 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#draw(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.core.v02.FSymbol) |
66 | 63 |
*/ |
67 | 64 |
public void draw(Graphics2D g, ViewPort vp, FSymbol symbol) { |
68 |
// TODO Auto-generated method stub |
|
69 | 65 |
|
70 | 66 |
} |
71 | 67 |
|
68 |
|
|
69 |
/* (non-Javadoc) |
|
70 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry() |
|
71 |
*/ |
|
72 |
public IGeometry cloneGeometry() { |
|
73 |
return null; |
|
74 |
} |
|
75 |
|
|
72 | 76 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FMultiPoint2D.java | ||
---|---|---|
4 | 4 |
import java.awt.Graphics2D; |
5 | 5 |
import java.awt.geom.Rectangle2D; |
6 | 6 |
|
7 |
import org.geotools.geometry.Geometry; |
|
8 |
|
|
9 | 7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
10 | 8 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
11 | 9 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
10 |
import com.vividsolutions.jts.geom.Geometry; |
|
12 | 11 |
|
13 | 12 |
|
14 | 13 |
/** |
... | ... | |
105 | 104 |
} |
106 | 105 |
|
107 | 106 |
} |
107 |
|
|
108 |
/* (non-Javadoc) |
|
109 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry() |
|
110 |
*/ |
|
111 |
public IGeometry cloneGeometry() { |
|
112 |
// TODO Auto-generated method stub |
|
113 |
return null; |
|
114 |
} |
|
108 | 115 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometry.java | ||
---|---|---|
7 | 7 |
package com.iver.cit.gvsig.fmap.core; |
8 | 8 |
|
9 | 9 |
import java.awt.Graphics2D; |
10 |
import java.awt.Shape; |
|
11 | 10 |
import java.awt.geom.AffineTransform; |
12 | 11 |
import java.awt.geom.Rectangle2D; |
13 | 12 |
|
14 |
import org.geotools.geometry.Geometry; |
|
15 |
|
|
16 | 13 |
import com.iver.cit.gvsig.fmap.ViewPort; |
14 |
import com.iver.cit.gvsig.fmap.core.v02.FConverter; |
|
17 | 15 |
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities; |
18 | 16 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
19 | 17 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
18 |
import com.vividsolutions.jts.geom.Geometry; |
|
20 | 19 |
|
21 | 20 |
/** |
22 | 21 |
* @author FJP |
... | ... | |
103 | 102 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry() |
104 | 103 |
*/ |
105 | 104 |
public Geometry toJTSGeometry() { |
106 |
// TODO Auto-generated method stub |
|
107 |
return null; |
|
105 |
return FConverter.java2d_to_jts(shp); |
|
108 | 106 |
} |
109 | 107 |
|
110 | 108 |
/* (non-Javadoc) |
... | ... | |
122 | 120 |
return shp.getShapeType(); |
123 | 121 |
} |
124 | 122 |
|
125 |
public FShape getShape() { |
|
126 |
return shp; |
|
123 |
/* (non-Javadoc) |
|
124 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry() |
|
125 |
*/ |
|
126 |
public IGeometry cloneGeometry() { |
|
127 |
return new FGeometry(shp.cloneFShape()); |
|
127 | 128 |
} |
128 | 129 |
|
129 | 130 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/IGeometry.java | ||
---|---|---|
1 | 1 |
/* Generated by Together */ |
2 | 2 |
package com.iver.cit.gvsig.fmap.core; |
3 | 3 |
|
4 |
import java.awt.Graphics2D; |
|
5 |
import java.awt.geom.Rectangle2D; |
|
6 |
|
|
4 | 7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
5 | 8 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
6 | 9 |
import com.iver.cit.gvsig.fmap.rendering.FStyledShapePainter; |
7 | 10 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
11 |
import com.vividsolutions.jts.geom.Geometry; |
|
8 | 12 |
|
9 |
import org.geotools.geometry.Geometry; |
|
10 | 13 |
|
11 |
|
|
12 |
import java.awt.Graphics2D; |
|
13 |
import java.awt.geom.Rectangle2D; |
|
14 |
|
|
15 |
|
|
16 | 14 |
/** |
17 | 15 |
* DOCUMENT ME! |
18 | 16 |
* |
... | ... | |
70 | 68 |
* @return una de las constantes de FShape: POINT, LINE, POLIGON |
71 | 69 |
*/ |
72 | 70 |
int getGeometryType(); |
71 |
|
|
72 |
IGeometry cloneGeometry(); |
|
73 | 73 |
|
74 | 74 |
/** |
75 | 75 |
* DOCUMENT ME! |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FShape.java | ||
---|---|---|
22 | 22 |
* @return int |
23 | 23 |
*/ |
24 | 24 |
public int getShapeType(); |
25 |
public FShape cloneFShape(); |
|
25 | 26 |
} |
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FGeometryCollection.java | ||
---|---|---|
5 | 5 |
import java.awt.Graphics2D; |
6 | 6 |
import java.awt.geom.Rectangle2D; |
7 | 7 |
|
8 |
import org.geotools.geometry.Geometry; |
|
9 |
|
|
10 | 8 |
import com.iver.cit.gvsig.fmap.ViewPort; |
11 | 9 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
12 | 10 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
11 |
import com.vividsolutions.jts.geom.Geometry; |
|
13 | 12 |
|
14 | 13 |
public class FGeometryCollection implements IGeometry { |
15 | 14 |
private IGeometry[] geometries; |
... | ... | |
22 | 21 |
geometries[i].draw(g,vp,symbol); |
23 | 22 |
} |
24 | 23 |
|
25 |
/** |
|
26 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry() |
|
27 |
*/ |
|
28 |
public Geometry toJTSGeometry() { |
|
29 |
return null; |
|
30 |
} |
|
31 | 24 |
|
32 | 25 |
/** |
33 | 26 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#createLabels(int, boolean) |
... | ... | |
74 | 67 |
|
75 | 68 |
|
76 | 69 |
} |
70 |
|
|
71 |
public FGeometryCollection(IGeometry[] geoms) |
|
72 |
{ |
|
73 |
geometries = geoms; |
|
74 |
} |
|
75 |
|
|
76 |
/* (non-Javadoc) |
|
77 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry() |
|
78 |
*/ |
|
79 |
public IGeometry cloneGeometry() { |
|
80 |
IGeometry[] newGeometries = new IGeometry[geometries.length]; |
|
81 |
for (int i=0; i < geometries.length;i++) |
|
82 |
newGeometries[i] = geometries[i].cloneGeometry(); |
|
83 |
return new FGeometryCollection(newGeometries); |
|
84 |
} |
|
85 |
|
|
86 |
/* (non-Javadoc) |
|
87 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#toJTSGeometry() |
|
88 |
*/ |
|
89 |
public Geometry toJTSGeometry() { |
|
90 |
// TODO Auto-generated method stub |
|
91 |
return null; |
|
92 |
} |
|
77 | 93 |
} |
Also available in: Unified diff