Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/Circle2D.java
Circle2D.java | ||
---|---|---|
47 | 47 |
import java.util.ArrayList; |
48 | 48 |
|
49 | 49 |
import org.cresques.cts.IProjection; |
50 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
51 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
50 |
import org.gvsig.fmap.geom.Geometry; |
|
52 | 51 |
import org.gvsig.fmap.geom.handler.AbstractHandler; |
53 | 52 |
import org.gvsig.fmap.geom.handler.CuadrantHandler; |
54 | 53 |
import org.gvsig.fmap.geom.handler.Handler; |
... | ... | |
66 | 65 |
*/ |
67 | 66 |
public class Circle2D extends Surface2D implements Circle { |
68 | 67 |
private static final long serialVersionUID = -2709867465161215668L; |
69 |
|
|
70 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
71 |
.registerGeometryType(Circle2D.class, null, TYPES.CIRCLE, SUBTYPES.GEOM2D); |
|
72 | 68 |
|
73 | 69 |
private Point2D center; |
74 | 70 |
private double radio; |
75 | 71 |
|
76 | 72 |
/** |
77 |
* Constructor without arguments. It is necessary to create |
|
78 |
* geometries using the {@link GeometryType}{@link #create()} |
|
79 |
* method |
|
73 |
* The constructor with the GeometryType like and argument |
|
74 |
* is used by the {@link GeometryType}{@link #create()} |
|
75 |
* to create the geometry |
|
76 |
* @param type |
|
77 |
* The geometry type |
|
80 | 78 |
*/ |
81 |
public Circle2D() { |
|
82 |
super(); |
|
79 |
public Circle2D(GeometryType geometryType) {
|
|
80 |
super(geometryType);
|
|
83 | 81 |
} |
84 | 82 |
|
85 | 83 |
/** |
86 |
* DOCUMENT ME! |
|
87 |
* |
|
88 |
* @param gpx |
|
84 |
* Constructor used in the {@link Geometry#cloneGeometry()} method |
|
89 | 85 |
*/ |
90 |
public Circle2D(String id, IProjection projection, GeneralPathX gpx,
|
|
86 |
Circle2D(GeometryType geometryType, String id, IProjection projection, GeneralPathX gpx,
|
|
91 | 87 |
Point2D c, double r) { |
92 |
super(id, projection, gpx); |
|
88 |
super(geometryType, id, projection, gpx);
|
|
93 | 89 |
center = c; |
94 | 90 |
radio = r; |
95 | 91 |
} |
... | ... | |
107 | 103 |
* @see org.gvsig.fmap.geom.primitive.impl.Surface2D#cloneFShape() |
108 | 104 |
*/ |
109 | 105 |
public FShape cloneFShape() { |
110 |
return new Circle2D(id, projection, (GeneralPathX) gp.clone(), center, |
|
106 |
return new Circle2D(getGeometryType(), id, projection, (GeneralPathX) gp.clone(), center,
|
|
111 | 107 |
radio); |
112 | 108 |
} |
113 | 109 |
|
... | ... | |
326 | 322 |
public boolean intersects(Rectangle2D r) { |
327 | 323 |
return gp.intersects(r); |
328 | 324 |
} |
329 |
|
|
330 |
/* |
|
331 |
* (non-Javadoc) |
|
332 |
* @see org.gvsig.fmap.geom.primitive.impl.Surface2D#getGeometryType() |
|
333 |
*/ |
|
334 |
public GeometryType getGeometryType() { |
|
335 |
return geomType; |
|
336 |
} |
|
337 | 325 |
|
338 | 326 |
/* (non-Javadoc) |
339 | 327 |
* @see org.gvsig.fmap.geom.primitive.Surface2D#setGeneralPath(org.gvsig.fmap.geom.primitive.GeneralPathX) |
Also available in: Unified diff