Revision 1450 branches/pilotoDWG/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FPolyline2D.java

View differences:

FPolyline2D.java
42 42

  
43 43
import org.cresques.cts.ICoordTrans;
44 44

  
45
import com.vividsolutions.jts.geom.Coordinate;
46
import com.vividsolutions.jts.geom.CoordinateArrays;
47
import com.vividsolutions.jts.geom.GeometryFactory;
48

  
49 45
import java.awt.Rectangle;
50 46
import java.awt.geom.AffineTransform;
51 47
import java.awt.geom.PathIterator;
......
222 218
	public void reProject(ICoordTrans ct) {
223 219
		gp.reProject(ct);
224 220
	}
225
		
221

  
222
	/**
223
	 * @see com.iver.cit.gvsig.fmap.core.FShape#getHandlers()
224
	 */
225
	public Handler[] getHandlers() {
226
		ArrayList handlers = new ArrayList();
227
		GeneralPathXIterator gpi = null;
228
		gpi = (GeneralPathXIterator) getPathIterator(null);
229

  
230
		double[] theData = new double[6];
231
		int i=0;
232
		while (!gpi.isDone()) {
233
			int theType = gpi.currentSegment(theData);
234
			//g.fillRect((int)(theData[0]-3),(int)(theData[1]-3),6,6);
235
			handlers.add(new PointHandler(i,theData[0], theData[1]));
236
			i++;
237
			gpi.next();
238
		}
239

  
240
		return (Handler[]) handlers.toArray(new Handler[0]);
241
	}
242
	/**
243
	 * DOCUMENT ME!
244
	 *
245
	 * @author Vicente Caballero Navarro
246
	 */
247
	class PointHandler extends AbstractHandler {
248
		/**
249
		 * Crea un nuevo PointHandler.
250
		 *
251
		 * @param x DOCUMENT ME!
252
		 * @param y DOCUMENT ME!
253
		 */
254
		public PointHandler(int i,double x, double y) {
255
			point = new Point2D.Double(x, y);
256
			index=i;
257
		}
258

  
259
		/**
260
		 * DOCUMENT ME!
261
		 *
262
		 * @param x DOCUMENT ME!
263
		 * @param y DOCUMENT ME!
264
		 *
265
		 * @return DOCUMENT ME!
266
		 */
267
		public void move(double x, double y) {
268
			gp.pointCoords[index*2]+=x;
269
			gp.pointCoords[index*2+1]+=y;
270
		}
271
	}
272

  
226 273
}

Also available in: Unified diff