Revision 2595 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/infobypoint/MainInfoByPointDialog.java

View differences:

MainInfoByPointDialog.java
23 23

  
24 24
import java.awt.BorderLayout;
25 25
import java.awt.Component;
26
import java.awt.Cursor;
26 27
import java.awt.event.ActionEvent;
27 28
import java.awt.event.ActionListener;
28 29
import java.util.HashMap;
......
31 32
import javax.swing.JPanel;
32 33

  
33 34
import org.gvsig.andami.IconThemeHelper;
34
import org.gvsig.andami.PluginServices;
35 35
import org.gvsig.andami.ui.mdiManager.IWindow;
36
import org.gvsig.andami.ui.mdiManager.IWindowListener;
36 37
import org.gvsig.andami.ui.mdiManager.WindowInfo;
38
import org.gvsig.fmap.mapcontrol.MapControl;
37 39
import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior;
40
import org.gvsig.i18n.Messages;
38 41
import org.gvsig.raster.swing.RasterSwingLocator;
39 42
import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
40 43
import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel;
......
44 47
 * Dialog for the information by point of a raster layer
45 48
 * @author Nacho Brodin (nachobrodin@gmail.com)
46 49
 */
47
public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener {
50
public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener, IWindowListener {
48 51
	private static final long               serialVersionUID   = 1L;
49 52
	private MainInfoByPointPanel            mainPanel          = null;
53
	private String                          toolToRestore    = null;
54
	private MapControl                      mapCtrl            = null;
50 55
	
51
	public MainInfoByPointDialog() {
56
	public MainInfoByPointDialog(MapControl mapControl, String toolToRestore) {
52 57
		setLayout(new BorderLayout());
53 58
		add((Component)getMainPanel(), BorderLayout.CENTER);
59
		this.toolToRestore = toolToRestore;
60
		this.mapCtrl = mapControl;
54 61
	}
55 62
	
56 63
	public MainInfoByPointPanel getMainPanel() {
57 64
		if(mainPanel == null) { 
58 65
			HashMap<String, String> translations = new HashMap<String, String>();
59
			translations.put("info", PluginServices.getText(this, "info"));
60
			translations.put("view", PluginServices.getText(this, "view"));
61
			translations.put("layer_list", PluginServices.getText(this, "layer_list"));
62
			translations.put("band_values", PluginServices.getText(this, "band_values"));
63
			translations.put("pixel_point", PluginServices.getText(this, "pixel_point"));
64
			translations.put("view_point", PluginServices.getText(this, "view_point"));
65
			translations.put("world_point", PluginServices.getText(this, "world_point"));
66
			translations.put("bands", PluginServices.getText(this, "bands"));
67
			translations.put("colors", PluginServices.getText(this, "colors"));
68
			translations.put("coords", PluginServices.getText(this, "coords"));
69
			translations.put("lat", PluginServices.getText(this, "lat"));
70
			translations.put("long", PluginServices.getText(this, "long"));
71
			translations.put("red", PluginServices.getText(this, "red"));
72
			translations.put("green", PluginServices.getText(this, "green"));
73
			translations.put("blue", PluginServices.getText(this, "blue"));
66
			translations.put("info", Messages.getText("info"));
67
			translations.put("view", Messages.getText("view"));
68
			translations.put("layer_list", Messages.getText("layer_list"));
69
			translations.put("band_values", Messages.getText("band_values"));
70
			translations.put("pixel_point", Messages.getText("pixel_point"));
71
			translations.put("view_point", Messages.getText("view_point"));
72
			translations.put("world_point", Messages.getText("world_point"));
73
			translations.put("bands", Messages.getText("bands"));
74
			translations.put("colors", Messages.getText("colors"));
75
			translations.put("coords", Messages.getText("coords"));
76
			translations.put("lat", Messages.getText("lat"));
77
			translations.put("long", Messages.getText("long"));
78
			translations.put("red", Messages.getText("red"));
79
			translations.put("green", Messages.getText("green"));
80
			translations.put("blue", Messages.getText("blue"));
74 81
			HashMap<String, ImageIcon> icons = new HashMap<String, ImageIcon>();
75 82
			icons.put("forward-icon", IconThemeHelper.getImageIcon("forward-icon"));
76 83
			icons.put("backward-icon", IconThemeHelper.getImageIcon("backward-icon"));
......
83 90

  
84 91
	public WindowInfo getWindowInfo() {
85 92
		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
86
		m_viewinfo.setTitle(PluginServices.getText(this, "InfoByPoint"));
93
		m_viewinfo.setTitle(Messages.getText("InfoByPoint"));
87 94
		m_viewinfo.setHeight(380);
88 95
		m_viewinfo.setWidth(250);
89 96
		return m_viewinfo;
......
91 98
	
92 99
	public void windowClosed() {
93 100
		CompoundBehavior.setAllControlsBehavior(InfoByRasterPointExtension.oldBehavior);
101
		mapCtrl.setTool(toolToRestore);
94 102
	}
95 103
	
96 104
	public Object getWindowProfile() {
......
107 115

  
108 116
	public void actionPerformed(ActionEvent e) {
109 117
	}
118

  
119
	public void windowActivated() {
120
		
121
	}
110 122
}

Also available in: Unified diff