Revision 4774 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/FLayoutFunctions.java

View differences:

FLayoutFunctions.java
51 51
import java.awt.geom.Point2D;
52 52
import java.awt.geom.Rectangle2D;
53 53

  
54
import com.iver.cit.gvsig.gui.layout.fframes.FFrameBox;
54
import com.iver.cit.gvsig.gui.layout.fframes.FFrameTable;
55 55
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGraphics;
56 56
import com.iver.cit.gvsig.gui.layout.fframes.FFrameGroup;
57 57
import com.iver.cit.gvsig.gui.layout.fframes.FFrameLegend;
......
88 88
	public void setSelect() {
89 89
		IFFrame fframe = null;
90 90
		boolean isUpdate = false;
91
		IFFrame[] fframes=layout.getFFrames();
92
		for (int i = 0; i < fframes.length; i++) {
93
			fframe = fframes[i];
91 94

  
92
		for (int i = 0; i < layout.getFFrames().length; i++) {
93
			fframe = (IFFrame) layout.getFFrame(i);
94

  
95 95
			int difx = (layout.getLastPoint().x - layout.getFirstPoint().x);
96 96
			int dify = (layout.getLastPoint().y - layout.getFirstPoint().y);
97 97

  
98 98
			if (((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) &&
99 99
					(fframe.getSelected() != IFFrame.NOSELECT)) {
100
				Rectangle2D rectangle = fframe.getMovieRect(difx, dify);
101

  
100
				Rectangle2D rectangle = fframe.getLastMoveRect();
101
				if (rectangle==null)
102
					return;
102 103
				if (layout.isCuadricula()) {
103 104
					//cuadrar con la cuadr?cula dibujada y despu?s en el mouseReleased guardar ese rect?ngulo de la misma forma.
104 105
					FLayoutUtilities.setRectGrid(rectangle,
......
144 145
	/**
145 146
	 * A?ade un fframe al Layout del tipo preseleccionado  y abre el di?logo
146 147
	 * para configurar las caracter?sticas.
148
	 * @return TODO
147 149
	 */
148
	public void setFFrame() {
150
	public IFFrame addFFrame() {
149 151
		IFFrame fframe = null;
150 152
		boolean isadd = false;
151 153

  
......
169 171
			fframe = new FFrameNorth();
170 172
			isadd = true;
171 173
		} else if (layout.getTool() == Layout.RECTANGLEBOX) {
172
			fframe = new FFrameBox();
174
			fframe = new FFrameTable();
173 175
			isadd = true;
174 176
		} else if ((layout.getTool() == Layout.LINE) ||
175 177
				(layout.getTool() == Layout.POLYLINE) ||
......
201 203
			fframe.setBoundBox(FLayoutUtilities.toSheetRect(r, layout.getAT()));
202 204

  
203 205
			if (layout.openFFrameDialog(fframe)) {
204
				layout.addFFrame(fframe, true,true);
206
				if (!layout.isEditGroup()){
207
					layout.addFFrame(fframe, true,true);
208
				}
205 209
			}
206 210
		}else{
207 211
			if (layout.getTool() == Layout.POINT){
......
215 219
			layout.addFFrame(fframe, true,true);
216 220
			///fframe.setBoundBox(FLayoutUtilities.toSheetRect(r, layout.getAT()));
217 221
		}
222
		return fframe;
218 223
	}
219 224

  
220 225
	private Rectangle2D getRectangle(int tolerance,Point2D first,Point2D last) {
......
250 255
	 * @param p2 Punto final del desplazamiento.
251 256
	 */
252 257
	public void setViewPan(Point p1, Point p2) {
253
		for (int i = 0; i < layout.getFFrames().length; i++) {
254
			if (layout.getFFrame(i) instanceof IFFrameUseFMap) {
255
				IFFrameUseFMap fframe = (IFFrameUseFMap) layout.getFFrame(i);
258
		IFFrame[] fframes=layout.getFFrames();
259
		for (int i = 0; i < fframes.length; i++) {
260
			if (fframes[i] instanceof IFFrameUseFMap) {
261
				IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i];
256 262

  
257 263
				if (((IFFrame)fframe).getSelected() != IFFrame.NOSELECT) {
258 264
					Rectangle2D.Double r = new Rectangle2D.Double();

Also available in: Unified diff