Revision 1548 branches/pilotoDWG/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FCircle2D.java

View differences:

FCircle2D.java
40 40
 */
41 41
package com.iver.cit.gvsig.fmap.core;
42 42

  
43
import java.awt.geom.AffineTransform;
43 44
import java.awt.geom.Arc2D;
44 45
import java.awt.geom.Point2D;
45 46
import java.awt.geom.Rectangle2D;
46 47

  
47 48
import java.util.ArrayList;
48 49

  
50
import com.iver.cit.gvsig.fmap.edition.cad.TrigonometricalFunctions;
49 51

  
52

  
50 53
/**
51 54
 * DOCUMENT ME!
52 55
 *
......
88 91
	/**
89 92
	 * DOCUMENT ME!
90 93
	 *
94
	 * @param at DOCUMENT ME!
95
	 */
96
	public void transform(AffineTransform at) {
97
		Point2D pdist=TrigonometricalFunctions.getPerpendicularPoint(new Point2D.Double(center.getX()+10,center.getY()),new Point2D.Double(center.getX()-10,center.getY()),center,radio);
98
		Point2D aux=new Point2D.Double();
99
		at.transform(center,aux);
100
		center=aux;
101
		Point2D aux3=new Point2D.Double();
102
		at.transform(pdist,aux3);
103
		radio=center.distance(aux3);
104
		gp.transform(at);
105
	}
106
	/**
107
	 * DOCUMENT ME!
108
	 *
91 109
	 * @return DOCUMENT ME!
92 110
	 */
93 111
	public Handler[] getStretchingHandlers() {
......
103 121
	}
104 122
	public Handler[] getSelectHandlers() {
105 123
		ArrayList handlers = new ArrayList();
106
		Rectangle2D rect = this.getBounds2D();
107
		handlers.add(new CenterSelHandler(0, rect.getCenterX(), rect.getCenterY()));
108
		handlers.add(new RadioSelHandler(1, rect.getX(), rect.getCenterY()));
109
		handlers.add(new RadioSelHandler(2, rect.getMaxX(), rect.getCenterY()));
110
		handlers.add(new RadioSelHandler(3, rect.getCenterX(), rect.getY()));
111
		handlers.add(new RadioSelHandler(3, rect.getCenterX(), rect.getMaxY()));
124
		handlers.add(new CenterSelHandler(0,center.getX(), center.getY()));
125
		handlers.add(new RadioSelHandler(1, center.getX()-radio, center.getY()));
126
		handlers.add(new RadioSelHandler(2, center.getX()+radio, center.getY()));
127
		handlers.add(new RadioSelHandler(3, center.getX(), center.getY()-radio));
128
		handlers.add(new RadioSelHandler(3, center.getX(), center.getY()+radio));
112 129

  
113 130
		return (Handler[]) handlers.toArray(new Handler[0]);
114 131
	}
......
139 156
		 * @return DOCUMENT ME!
140 157
		 */
141 158
		public void move(double x, double y) {
159
			center=new Point2D.Double(center.getX()+x,center.getY()+y);
142 160
			for (int i=0;i<gp.numCoords/2;i++){
143 161
				gp.pointCoords[i*2]+=x;
144 162
				gp.pointCoords[i*2+1]+=y;

Also available in: Unified diff