Revision 27490

View differences:

branches/v2_0_0_prep/extensions/extRasterTools-SE/config/text.properties
89 89
geolocation=Geolocalizaci?n
90 90
georref=Georreferenciado
91 91
georreferenciacion=Georreferenciaci?n
92
get_tool_focus=Recupera el foco de la herramienta
92 93
green=Verde
93 94
ancho=Ancho
94 95
alto=Alto
branches/v2_0_0_prep/extensions/extRasterTools-SE/config/text_en.properties
89 89
geolocation=Geolocalization
90 90
georref=Georeferencing
91 91
georreferenciacion=Georeferencing
92
get_tool_focus=Gets the tool focus
92 93
green=Green
93 94
ancho=Width
94 95
alto=Height
branches/v2_0_0_prep/extensions/extRasterTools-SE/src-test-ui/org/gvsig/rastertools/geolocation/TestGeoLocationDialog.java
46 46
	}
47 47

  
48 48
	private void initialize() {
49
		GeoLocationPanel glp = new GeoLocationPanel();
49
		GeoLocationPanel glp = new GeoLocationPanel(null);
50 50
		frame.setContentPane(glp);
51 51

  
52 52
		frame.setSize(new java.awt.Dimension(220, 230));
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/RasterModule.java
128 128
		// A?adimos la configuracion de Raster a gvSIG
129 129

  
130 130
		ExtensionPoint point=extensionPoints.add("AplicationPreferences");
131
		point.append("RasterPreferences", "", new RasterPreferences());
131
		point.append("RasterPreferences", "", RasterPreferences.class);
132 132

  
133 133
		// A?adimos paneles al cuadro de propiedades.
134 134
		point = extensionPoints.add("RasterSEPropertiesDialog");
......
406 406
				"vectorization-icon",
407 407
				getClass().getClassLoader().getResource("images/vectorT.png")
408 408
			);
409
		PluginServices.getIconTheme().registerDefault(
410
				"focus-icon",
411
				getClass().getClassLoader().getResource("images/focus.png")
412
			);
409 413
	}
410 414
	/*
411 415
	 * (non-Javadoc)
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/ui/GeoLocationDialog.java
37 37
import com.iver.andami.ui.mdiManager.IWindow;
38 38
import com.iver.andami.ui.mdiManager.IWindowListener;
39 39
import com.iver.andami.ui.mdiManager.WindowInfo;
40
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
40 41

  
41 42
/**
42 43
 * Dialogo de geolocalizaci?n de raster.
......
59 60
	private int               heightWindow     = 155;
60 61

  
61 62
	private String            lastTool         = null;
63
	private BaseView          view             = null;
62 64

  
63 65
	/**
64 66
	 * Constructor
......
74 76
	 * Constructor. Asigna la capa raster.
75 77
	 *
76 78
	 */
77
	public GeoLocationDialog(FLyrRasterSE lyr, ViewPort vp) {
79
	public GeoLocationDialog(FLyrRasterSE lyr, ViewPort vp, BaseView view) {
78 80
		BorderLayout bl = new BorderLayout(5, 5);
79 81
		this.setLayout(bl);
80 82

  
......
83 85
	}
84 86
	
85 87
	/**
88
	 * Obtiene la vista asociada a este dialogo
89
	 * @return BaseView
90
	 */
91
	public BaseView getAssociateView() {
92
		return view;
93
	}
94
	
95
	/**
86 96
	 * Asigna la posici?n de la ventana
87 97
	 * @param x Posici?n en X
88 98
	 * @param y Posici?n en Y
......
158 168
	 */
159 169
	public GeoLocationPanel getGeoLocationPanel(){
160 170
		if (geolocationPanel == null) 
161
			geolocationPanel = new GeoLocationPanel();
171
			geolocationPanel = new GeoLocationPanel(this);
162 172
		
163 173
		return geolocationPanel;
164 174
	}
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/ui/GeoLocationPanel.java
48 48
 */
49 49
public class GeoLocationPanel extends GeolocationBaseClassPanel {
50 50
	private static final long         serialVersionUID = -7797379892312214949L;
51
	private DataInputContainer	       ulx = null;
52
	private DataInputContainer	       uly = null;
53
	private DataInputContainer	       psx = null;
54
	private DataInputContainer	       psy = null;
55
	private DataInputContainer	       rotx = null;
56
	private DataInputContainer	       roty = null;
57
	private JButton                    first = null;
58
	private JButton                    save = null;
59
	private JButton                    back = null;
60
	private JButton                    next = null;
61
	private JButton                    apply = null;
62
	private JButton                    reset = null;
63
	private JButton                    tfwload = null;
64
	private JButton                    center = null;
51
	private DataInputContainer	       ulx             = null;
52
	private DataInputContainer	       uly             = null;
53
	private DataInputContainer	       psx             = null;
54
	private DataInputContainer	       psy             = null;
55
	private DataInputContainer	       rotx            = null;
56
	private DataInputContainer	       roty            = null;
57
	private JButton                    first           = null;
58
	private JButton                    save            = null;
59
	private JButton                    back            = null;
60
	private JButton                    next            = null;
61
	private JButton                    apply           = null;
62
	private JButton                    reset           = null;
63
	private JButton                    tfwload         = null;
64
	private JButton                    center          = null;
65
	private JButton                    focus           = null;
65 66
	
66
	private JPanel			           coordsPanel = null;
67
	private JPanel			           paramsPanel = null;
68
	private JPanel			           buttonsPanel = null;
67
	private JPanel			           coordsPanel     = null;
68
	private JPanel			           paramsPanel     = null;
69
	private JPanel			           buttonsPanel    = null;
69 70
		
70 71
	/**
71 72
	 * Constructor
72 73
	 */
73
	public GeoLocationPanel() {
74
	public GeoLocationPanel(GeoLocationDialog dialog) {
74 75
		ImageIcon backIcon = null;
75 76
		ImageIcon nextIcon = null;
76 77
		ImageIcon saveIcon = null;
......
78 79
		ImageIcon resetIcon = null;
79 80
		ImageIcon tfwLoadIcon = null;
80 81
		ImageIcon centerRasterIcon = null;
82
		ImageIcon focusIcon = null;
81 83
		try {
82 84
			backIcon = PluginServices.getIconTheme().get("back-icon");
83 85
			nextIcon = PluginServices.getIconTheme().get("next-icon");
......
86 88
			resetIcon = PluginServices.getIconTheme().get("reset-icon");
87 89
			centerRasterIcon = PluginServices.getIconTheme().get("centerraster-icon");
88 90
			tfwLoadIcon = PluginServices.getIconTheme().get("tfwload-icon");
91
			focusIcon = PluginServices.getIconTheme().get("focus-icon");
89 92
		} catch(NullPointerException e) {
90 93
			
91 94
		}
92 95
		
93
		listener = new GeoLocationPanelListener(this);
96
		listener = new GeoLocationPanelListener(this, dialog);
94 97
		
95 98
		GridBagLayout gl = new GridBagLayout();
96 99
		this.setLayout(gl);
......
127 130
		reset = new JButton(resetIcon);
128 131
		tfwload = new JButton(tfwLoadIcon);
129 132
		center = new JButton(centerRasterIcon);
133
		focus = new JButton(focusIcon);
130 134
		
131 135
		save.setToolTipText(PluginServices.getText(this,"salvar_transf"));
132 136
		back.setToolTipText(PluginServices.getText(this,"back_transf"));
......
136 140
		reset.setToolTipText(PluginServices.getText(this,"reset_transf"));
137 141
		center.setToolTipText(PluginServices.getText(this,"center_raster"));
138 142
		tfwload.setToolTipText(PluginServices.getText(this,"tfw_load"));
143
		focus.setToolTipText(PluginServices.getText(this,"get_tool_focus"));
139 144
		
140 145
		save.setPreferredSize(new Dimension(28, 24));
141 146
		first.setPreferredSize(new Dimension(28, 24));
......
196 201
		gbc.gridx = 0;
197 202
		gbc.gridy = 0;
198 203
		gbc.insets = new java.awt.Insets(1, 0, 0, 2);
204
		smallButtons.add(focus, gbc);
205
		gbc.gridx = 1;
199 206
		smallButtons.add(center, gbc);
200
		gbc.gridx = 1;
207
		gbc.gridx = 2;
201 208
		smallButtons.add(reset, gbc);
202
		gbc.gridx = 2;
209
		gbc.gridx = 3;
203 210
		smallButtons.add(first, gbc);
204
		gbc.gridx = 3;
211
		gbc.gridx = 4;
205 212
		smallButtons.add(back, gbc);
206
		gbc.gridx = 4;
213
		gbc.gridx = 5;
207 214
		smallButtons.add(next, gbc);
208
		gbc.gridx = 5;
215
		gbc.gridx = 6;
209 216
		smallButtons.add(tfwload, gbc);
210
		gbc.gridx = 6;
217
		gbc.gridx = 7;
211 218
		smallButtons.add(save, gbc);
212 219
		
213 220
		gbc.gridx = 0;
......
410 417
		return center;
411 418
	}
412 419
	
420
	/*
421
	 * (non-Javadoc)
422
	 * @see org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel#getFocus()
423
	 */
424
	public JButton getFocus() {
425
		return focus;
426
	}
427
	
413 428
	/**
414 429
	 * Obtiene el tama?o de pixel en X
415 430
	 * @return
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/ui/GeoLocationOpeningRasterPanel.java
62 62
	 */
63 63
	public GeoLocationOpeningRasterPanel(GeoLocationOpeningRasterDialog parent) {
64 64
		this.parent = parent;
65
		listener = new GeoLocationPanelListener(this);
65
		listener = new GeoLocationPanelListener(this, null);
66 66
		transfPanel = new GeoLocationOpeningRasterTransfPanel(listener);
67 67
		cornersPanel = new GeoLocationOpeningRasterCornersPanel(listener);
68 68
		
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/ui/GeolocationBaseClassPanel.java
201 201
	}
202 202
	
203 203
	/**
204
	 * Obtiene el bot?n de recuperaci?n del foco de la tool
205
	 * @return JButton
206
	 */
207
	public JButton getFocus() {
208
		return null;
209
	}
210
	
211
	/**
204 212
	 * Obtiene el tama?o de pixel en X
205 213
	 * @return
206 214
	 */
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/GeoLocationTocMenuEntry.java
157 157
			return;
158 158
		
159 159
		FLyrRasterSE lyr = (FLyrRasterSE)selectedItems[0];
160
		GeoLocationDialog gld = new GeoLocationDialog(lyr, mapCtrl.getViewPort());
160
		GeoLocationDialog gld = new GeoLocationDialog(lyr, mapCtrl.getViewPort(), theView);
161 161
		if(!isOpen) {
162 162
			Point posit = RasterToolsUtil.iwindowPosition((int)gld.getSizeWindow().getWidth(), (int)gld.getSizeWindow().getHeight());
163 163
			gld.setPosition((int)posit.getX(), (int)posit.getY());
branches/v2_0_0_prep/extensions/extRasterTools-SE/src/org/gvsig/rastertools/geolocation/listener/GeoLocationPanelListener.java
36 36
import org.gvsig.fmap.geom.Geometry.SUBTYPES;
37 37
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
38 38
import org.gvsig.fmap.geom.primitive.Envelope;
39
import org.gvsig.fmap.geom.util.UtilFunctions;
40 39
import org.gvsig.fmap.mapcontext.ViewPort;
40
import org.gvsig.fmap.mapcontrol.MapControl;
41
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
42
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior;
43
import org.gvsig.fmap.raster.layers.FLyrRasterSE;
41 44
import org.gvsig.gui.beans.datainput.DataInputContainerListener;
42 45
import org.gvsig.gui.beans.swing.JFileChooser;
43 46
import org.gvsig.raster.dataset.serializer.RmfSerializerException;
......
45 48
import org.gvsig.raster.util.ExtendedFileFilter;
46 49
import org.gvsig.raster.util.Historical;
47 50
import org.gvsig.raster.util.RasterToolsUtil;
51
import org.gvsig.rastertools.geolocation.behavior.GeoRasterBehavior;
52
import org.gvsig.rastertools.geolocation.ui.GeoLocationDialog;
48 53
import org.gvsig.rastertools.geolocation.ui.GeoLocationOpeningRasterPanel;
49 54
import org.gvsig.rastertools.geolocation.ui.GeoLocationPanel;
50 55
import org.gvsig.rastertools.geolocation.ui.GeolocationBaseClassPanel;
......
52 57
import org.slf4j.LoggerFactory;
53 58

  
54 59
import com.iver.andami.PluginServices;
60
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
61
import com.iver.cit.gvsig.project.documents.view.toolListeners.StatusBarListener;
55 62

  
56 63
/**
57 64
 * Listener para el panel de geolocalizaci?n.
......
64 71
	private static final Logger 			logger        			= LoggerFactory.getLogger(GeoLocationPanelListener.class);
65 72
	private GeolocationBaseClassPanel		panel 					= null;
66 73
	private boolean                     	enableValueChangeEvent 	= false;
74
	private GeoLocationDialog               dialog                  = null;
67 75

  
68 76
	/**
69 77
	 * Crea un nuevo <code>GeoLocationPanelListener</code>
70 78
	 * @param panel
71 79
	 */
72
	public GeoLocationPanelListener(GeolocationBaseClassPanel panel) {
80
	public GeoLocationPanelListener(GeolocationBaseClassPanel panel, GeoLocationDialog dialog) {
81
		this.dialog = dialog;
73 82
		this.panel = panel;
74 83
	}
75 84

  
......
172 181
			at = new AffineTransform(psX, 0, 0, psY, x, y);
173 182
			panel.setModify(true);
174 183
		}
184
		
185
		//Recuperar el foco
186
		if(e.getSource() == panel.getFocus()) {
187
			if(dialog != null) {
188
				BaseView theView = dialog.getAssociateView();
189
				MapControl mapCtrl = theView.getMapControl();
190
				mapCtrl.setTool("geoPan");
191
			}
192
		}
175 193

  
176 194
		//Entrar? en el caso de que se haya seleccionado alguna transformaci?n
177 195
		if(at != null) {
......
182 200
				panel.getMapCtrl().getMapContext().invalidate();
183 201
		}
184 202
	}
185

  
203
	
186 204
	/**
187 205
	 * Control del cambio de valor dentro de las cajas de texto. Cuando esto ocurre tiene
188 206
	 * el mismo efecto que el bot?n "Aplicar"

Also available in: Unified diff