gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.app / org.gvsig.raster.tools.app.basic / src / main / java / org / gvsig / raster / tools / app / basic / tool / infobypoint / MainInfoByPointDialog.java @ 1194
History | View | Annotate | Download (4.54 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.tools.app.basic.tool.infobypoint; |
23 |
|
24 |
import java.awt.BorderLayout; |
25 |
import java.awt.Component; |
26 |
import java.awt.event.ActionEvent; |
27 |
import java.awt.event.ActionListener; |
28 |
import java.util.HashMap; |
29 |
|
30 |
import javax.swing.ImageIcon; |
31 |
import javax.swing.JPanel; |
32 |
|
33 |
import org.gvsig.andami.IconThemeHelper; |
34 |
import org.gvsig.andami.PluginServices; |
35 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
36 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
37 |
import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior; |
38 |
import org.gvsig.raster.swing.RasterSwingLocator; |
39 |
import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel; |
40 |
import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel; |
41 |
import org.gvsig.raster.swing.pixelinspector.PixelInspector; |
42 |
|
43 |
/**
|
44 |
* Dialog for the information by point of a raster layer
|
45 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
46 |
*/
|
47 |
public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener { |
48 |
private static final long serialVersionUID = 1L; |
49 |
private MainInfoByPointPanel mainPanel = null; |
50 |
|
51 |
public MainInfoByPointDialog() {
|
52 |
setLayout(new BorderLayout()); |
53 |
add((Component)getMainPanel(), BorderLayout.CENTER); |
54 |
} |
55 |
|
56 |
public MainInfoByPointPanel getMainPanel() {
|
57 |
if(mainPanel == null) { |
58 |
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")); |
74 |
HashMap<String, ImageIcon> icons = new HashMap<String, ImageIcon>(); |
75 |
icons.put("forward-icon", IconThemeHelper.getImageIcon("forward-icon")); |
76 |
icons.put("backward-icon", IconThemeHelper.getImageIcon("backward-icon")); |
77 |
mainPanel = RasterSwingLocator.getSwingManager().createInfoByPointPanel( |
78 |
translations, icons, null);
|
79 |
mainPanel.addListenerExtendedButton(this);
|
80 |
} |
81 |
return mainPanel;
|
82 |
} |
83 |
|
84 |
/*
|
85 |
* (non-Javadoc)
|
86 |
* @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
|
87 |
*/
|
88 |
public WindowInfo getWindowInfo() {
|
89 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
|
90 |
m_viewinfo.setTitle(PluginServices.getText(this, "InfoByPoint")); |
91 |
m_viewinfo.setHeight(380);
|
92 |
m_viewinfo.setWidth(250);
|
93 |
return m_viewinfo;
|
94 |
} |
95 |
|
96 |
/*
|
97 |
* (non-Javadoc)
|
98 |
* @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
|
99 |
*/
|
100 |
public void windowClosed() { |
101 |
CompoundBehavior.setAllControlsBehavior(InfoByRasterPointExtension.oldBehavior); |
102 |
} |
103 |
|
104 |
public Object getWindowProfile() { |
105 |
return WindowInfo.PROPERTIES_PROFILE;
|
106 |
} |
107 |
|
108 |
public InfoByPointDataModel getInfoByPointDataModel() {
|
109 |
return getMainPanel().getInfoByPointDataModel();
|
110 |
} |
111 |
|
112 |
public PixelInspector getPixelInspector() {
|
113 |
return getMainPanel().getPixelInspectorPanel();
|
114 |
} |
115 |
|
116 |
public void actionPerformed(ActionEvent e) { |
117 |
} |
118 |
} |