Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/Curve2D.java

View differences:

Curve2D.java
44 44
import java.awt.geom.Point2D;
45 45

  
46 46
import org.cresques.cts.IProjection;
47
import org.gvsig.fmap.geom.GeometryLocator;
48
import org.gvsig.fmap.geom.Geometry.TYPES;
47
import org.gvsig.fmap.geom.Geometry;
49 48
import org.gvsig.fmap.geom.primitive.Curve;
50 49
import org.gvsig.fmap.geom.primitive.FShape;
51 50
import org.gvsig.fmap.geom.primitive.GeneralPathX;
......
61 60
public class Curve2D extends DefaultCurve implements Curve {
62 61
	private static final long serialVersionUID = 8161943328767877860L;
63 62

  
64
	private static GeometryType geomType = GeometryLocator.getGeometryManager()
65
	.registerGeometryType(Curve2D.class, "Curve2D", TYPES.CURVE, SUBTYPES.GEOM2D);
66

  
67 63
	/**
68
	 * Constructor without arguments. It is necessary to create
69
	 * geometries using the {@link GeometryType}{@link #create()}
70
	 * method
64
	 * The constructor with the GeometryType like and argument 
65
	 * is used by the {@link GeometryType}{@link #create()}
66
	 * to create the geometry
67
	 * @param type
68
	 * The geometry type
71 69
	 */
72
	public Curve2D() {
73
		super();
70
	public Curve2D(GeometryType geomType) {
71
		super(geomType);
74 72
	}
75 73

  
76
	public Curve2D(String id, IProjection projection, GeneralPathX gpx) {
77
		super(id, projection, gpx);
74
	/**
75
	 * Constructor used in the {@link Geometry#cloneGeometry()} method.
76
	 * @param geomType
77
	 * @param id
78
	 * @param projection
79
	 * @param gpx
80
	 */
81
	public Curve2D(GeometryType geomType, String id, IProjection projection, GeneralPathX gpx) {
82
		super(geomType, id, projection, gpx);
78 83
		gp=gpx;
79 84
	}
80 85

  
81
	public Curve2D(GeneralPathX gpx) {
82
		this(null, null, gpx);
83
		gp=gpx;
84
	}
85

  
86 86
	/*
87 87
	 * (non-Javadoc)
88 88
	 * @see org.gvsig.fmap.geom.Geometry#getShapeType()
......
96 96
	 * @see org.gvsig.fmap.geom.primitive.FShape#cloneFShape()
97 97
	 */
98 98
	public FShape cloneFShape() {
99
		return new Curve2D(id, projection, (GeneralPathX) gp.clone());
99
		return new Curve2D(getGeometryType(), id, projection, (GeneralPathX) gp.clone());
100 100
	}
101 101

  
102 102
	/*
103 103
	 * (non-Javadoc)
104
	 * @see org.gvsig.fmap.geom.Geometry#getGeometryType()
105
	 */
106
	public GeometryType getGeometryType() {
107
		return geomType;
108
	}
109

  
110
	/*
111
	 * (non-Javadoc)
112
	 * @see org.gvsig.fmap.geom.Geometry#getType()
113
	 */
114
	public int getType() {
115
		return geomType.getType();
116
	}
117

  
118
	/*
119
	 * (non-Javadoc)
120 104
	 * @see org.gvsig.fmap.geom.Geometry#getGeneralPath()
121 105
	 */
122 106
	public GeneralPathX getGeneralPath() {

Also available in: Unified diff