Revision 29001 branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/objects/DwgMText.java

View differences:

DwgMText.java
34 34
 */
35 35
package org.gvsig.dwg.lib.objects;
36 36

  
37
import java.awt.geom.Point2D;
38

  
39 37
import org.gvsig.dwg.lib.DwgHandleReference;
40 38
import org.gvsig.dwg.lib.DwgObject;
41 39
import org.gvsig.dwg.lib.IDwg2FMap;
......
43 41
import org.gvsig.dwg.lib.IDwgExtrusionable;
44 42
import org.gvsig.dwg.lib.util.AcadExtrusionCalculator;
45 43
import org.gvsig.fmap.geom.Geometry;
46
import org.gvsig.fmap.geom.GeometryFactory;
44
import org.gvsig.fmap.geom.GeometryLocator;
47 45
import org.gvsig.fmap.geom.GeometryManager;
46
import org.gvsig.fmap.geom.exception.CreateGeometryException;
47
import org.gvsig.fmap.geom.primitive.Point;
48 48

  
49 49

  
50 50
/**
......
249 249
		return getInsertionPoint()[2];
250 250
	}
251 251

  
252
	public Geometry toFMapGeometry(boolean is3DFile) {
253
		GeometryFactory gFactory = GeometryManager.getInstance().getGeometryFactory();
252
	public Geometry toFMapGeometry(boolean is3DFile) throws CreateGeometryException {
253
		GeometryManager gMan = GeometryLocator.getGeometryManager();
254 254
		double[] p = getInsertionPoint();
255
		double elev = 0.0;
256
		if (is3DFile) {
257
			return gFactory.createPoint3D(p[0], p[1], p[2]);
258

  
259
		} else {
260
			return gFactory.createPoint2D(p[0], p[1]);
261
		}
255
		Point point = (Point) gMan.create(getGeometryType(),
256
				getGeometrySubType(is3DFile));
257
		point.setCoordinates(p);
258
		return point;
262 259
	}
263 260

  
264 261
	public String toFMapString(boolean is3DFile) {
265
		if(is3DFile)
262
		if(is3DFile) {
266 263
			return "FPoint3D";
267
		else
264
		} else {
268 265
			return "FPoint2D";
266
		}
269 267
	}
270 268

  
271 269

  
......
302 300
		myObj.setXAxisDirection(xAxisDirection);
303 301
	}
304 302

  
303
	public int getGeometrySubType(boolean is3DFile) {
304
		if (is3DFile) {
305
			return Geometry.SUBTYPES.GEOM3D;
306
		} else {
307
			return Geometry.SUBTYPES.GEOM2D;
308
		}
309
	}
310

  
311
	public int getGeometryType() {
312
		return Geometry.TYPES.POINT;
313
	}
314

  
305 315
}

Also available in: Unified diff