Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/Surface2D.java
Surface2D.java | ||
---|---|---|
43 | 43 |
import java.awt.geom.Rectangle2D; |
44 | 44 |
|
45 | 45 |
import org.cresques.cts.IProjection; |
46 |
import org.gvsig.fmap.geom.GeometryLocator;
|
|
46 |
import org.gvsig.fmap.geom.Geometry; |
|
47 | 47 |
import org.gvsig.fmap.geom.primitive.FShape; |
48 | 48 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
49 | 49 |
import org.gvsig.fmap.geom.primitive.Point; |
... | ... | |
58 | 58 |
public class Surface2D extends OrientableSurface2D implements Surface { |
59 | 59 |
private static final long serialVersionUID = -8448256617197415743L; |
60 | 60 |
|
61 |
|
|
62 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
63 |
.registerGeometryType(Surface2D.class, "Surface2D", TYPES.SURFACE, SUBTYPES.GEOM2D); |
|
64 |
|
|
65 | 61 |
/** |
66 |
* Constructor without arguments. It is necessary to create |
|
67 |
* geometries using the {@link GeometryType}{@link #create()} |
|
68 |
* method |
|
62 |
* The constructor with the GeometryType like and argument |
|
63 |
* is used by the {@link GeometryType}{@link #create()} |
|
64 |
* to create the geometry |
|
65 |
* @param type |
|
66 |
* The geometry type |
|
69 | 67 |
*/ |
70 |
public Surface2D() { |
|
71 |
super(); |
|
68 |
public Surface2D(GeometryType geomType) {
|
|
69 |
super(geomType);
|
|
72 | 70 |
} |
73 | 71 |
|
74 | 72 |
/** |
75 |
* Crea un nuevo Polygon2D. |
|
76 |
* |
|
73 |
* Constructor used in the {@link Geometry#cloneGeometry()} method. |
|
74 |
* @param geomType |
|
75 |
* @param id |
|
76 |
* @param projection |
|
77 | 77 |
* @param gpx |
78 |
* GeneralPathX. |
|
79 | 78 |
*/ |
80 |
public Surface2D(String id, IProjection projection, GeneralPathX gpx) {
|
|
81 |
super(id, projection, gpx); |
|
82 |
} |
|
79 |
Surface2D(GeometryType geomType, String id, IProjection projection, GeneralPathX gpx) {
|
|
80 |
super(geomType, id, projection, gpx);
|
|
81 |
}
|
|
83 | 82 |
|
84 |
public Surface2D(GeneralPathX gpx) { |
|
85 |
this(null, null, gpx); |
|
86 |
} |
|
87 |
|
|
88 | 83 |
/* |
89 | 84 |
* (non-Javadoc) |
90 | 85 |
* @see org.gvsig.fmap.geom.Geometry#getShapeType() |
... | ... | |
98 | 93 |
* @see org.gvsig.fmap.geom.primitive.FShape#cloneFShape() |
99 | 94 |
*/ |
100 | 95 |
public FShape cloneFShape() { |
101 |
return new Surface2D(id, projection, (GeneralPathX) gp.clone()); |
|
96 |
return new Surface2D(getGeometryType(), id, projection, (GeneralPathX) gp.clone());
|
|
102 | 97 |
} |
103 | 98 |
|
104 | 99 |
/* |
... | ... | |
111 | 106 |
|
112 | 107 |
/* |
113 | 108 |
* (non-Javadoc) |
114 |
* @see org.gvsig.fmap.geom.Geometry#getGeometryType() |
|
115 |
*/ |
|
116 |
public GeometryType getGeometryType() { |
|
117 |
return geomType; |
|
118 |
} |
|
119 |
|
|
120 |
/* |
|
121 |
* (non-Javadoc) |
|
122 |
* @see org.gvsig.fmap.geom.Geometry#getType() |
|
123 |
*/ |
|
124 |
public int getType() { |
|
125 |
return geomType.getType(); |
|
126 |
} |
|
127 |
|
|
128 |
/* |
|
129 |
* (non-Javadoc) |
|
130 | 109 |
* |
131 | 110 |
* @see org.gvsig.fmap.geom.Geometry#getGeneralPath() |
132 | 111 |
*/ |
Also available in: Unified diff