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

View differences:

AbstractPrimitive.java
80 80
	private static final long serialVersionUID = -4334977368955260872L;
81 81
	protected String id = null;
82 82
	protected IProjection projection = null;
83
	private static GeometryManager geomManager =  GeometryLocator.getGeometryManager();
83
	protected GeometryType geometryType = null;
84
	private static GeometryManager geomManager = GeometryLocator.getGeometryManager();
84 85

  
85 86
	/**
86
	 * Constructor without arguments. It is necessary to create
87
	 * geometries using the {@link GeometryType}{@link #create()}
88
	 * method
87
	 * The constructor with the GeometryType like and argument 
88
	 * is used by the {@link GeometryType}{@link #create()}
89
	 * to create the geometry
90
	 * @param type
91
	 * The geometry type
89 92
	 */
90
	public AbstractPrimitive() {
91
		super();
93
	public AbstractPrimitive(GeometryType geometryType) {
94
		this(geometryType, null, null);		
92 95
	}
93

  
94
	public AbstractPrimitive(String id, IProjection projection) {
96
	
97
	AbstractPrimitive(int type, int subtype) {
98
		try {
99
			geometryType = geomManager.getGeometryType(TYPES.POINT, SUBTYPES.GEOM2D);
100
		} catch (Exception e) {
101
			//Type not registered
102
		}
103
	}	
104
	
105
	public AbstractPrimitive(GeometryType geometryType, String id, IProjection projection) {
95 106
		super();
96 107
		this.id = id;
97 108
		this.projection = projection;
109
		this.geometryType = geometryType;
98 110
	}
99 111

  
100
	public AbstractPrimitive(IProjection projection) {
101
		this(null, projection);
112
	public AbstractPrimitive(GeometryType geometryType, IProjection projection) {
113
		this(geometryType, null, projection);
102 114
	}
103 115

  
116
	/* (non-Javadoc)
117
	 * @see org.gvsig.fmap.geom.Geometry#getGeometryType()
118
	 */
119
	public GeometryType getGeometryType() {
120
		return geometryType;
121
	}
122

  
123
	/* (non-Javadoc)
124
	 * @see org.gvsig.fmap.geom.Geometry#getType()
125
	 */
126
	public int getType() {
127
		return geometryType.getType();
128
	}
129

  
104 130
	/**
105 131
	 * (non-Javadoc)
106 132
	 * @see com.iver.cit.gvsig.fmap.core.Geometry#getInternalShape()

Also available in: Unified diff