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 @ 1172
History | View | Annotate | Download (4.33 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.event.ActionEvent; |
26 |
import java.awt.event.ActionListener; |
27 |
import java.util.HashMap; |
28 |
|
29 |
import javax.swing.JPanel; |
30 |
|
31 |
import org.gvsig.andami.PluginServices; |
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
33 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
34 |
import org.gvsig.fmap.mapcontrol.tools.CompoundBehavior; |
35 |
import org.gvsig.raster.tools.app.basic.tool.infobypoint.gui.InfoByPointDataModel; |
36 |
import org.gvsig.raster.tools.app.basic.tool.infobypoint.gui.MainInfoByPointPanel; |
37 |
import org.gvsig.raster.tools.app.basic.tool.pixelincrease.PixelInspector; |
38 |
|
39 |
public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener { |
40 |
private static final long serialVersionUID = 1L; |
41 |
private MainInfoByPointPanel mainPanel = null; |
42 |
private boolean extended = false; |
43 |
|
44 |
public MainInfoByPointDialog(boolean extended) { |
45 |
this.extended = extended;
|
46 |
setLayout(new BorderLayout()); |
47 |
add(getMainPanel(), BorderLayout.CENTER);
|
48 |
} |
49 |
|
50 |
public MainInfoByPointPanel getMainPanel() {
|
51 |
if(mainPanel == null) { |
52 |
HashMap<String, String> translations = new HashMap<String, String>(); |
53 |
translations.put("info", PluginServices.getText(this, "info")); |
54 |
translations.put("view", PluginServices.getText(this, "view")); |
55 |
translations.put("layer_list", PluginServices.getText(this, "layer_list")); |
56 |
translations.put("band_values", PluginServices.getText(this, "band_values")); |
57 |
translations.put("pixel_point", PluginServices.getText(this, "pixel_point")); |
58 |
translations.put("view_point", PluginServices.getText(this, "view_point")); |
59 |
translations.put("world_point", PluginServices.getText(this, "world_point")); |
60 |
translations.put("bands", PluginServices.getText(this, "bands")); |
61 |
translations.put("colors", PluginServices.getText(this, "colors")); |
62 |
translations.put("coords", PluginServices.getText(this, "coords")); |
63 |
translations.put("lat", PluginServices.getText(this, "lat")); |
64 |
translations.put("long", PluginServices.getText(this, "long")); |
65 |
translations.put("red", PluginServices.getText(this, "red")); |
66 |
translations.put("green", PluginServices.getText(this, "green")); |
67 |
translations.put("blue", PluginServices.getText(this, "blue")); |
68 |
mainPanel = new MainInfoByPointPanel(translations, extended);
|
69 |
mainPanel.getButtonsPanel().getExtendedButton().addActionListener(this);
|
70 |
} |
71 |
return mainPanel;
|
72 |
} |
73 |
|
74 |
/*
|
75 |
* (non-Javadoc)
|
76 |
* @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
|
77 |
*/
|
78 |
public WindowInfo getWindowInfo() {
|
79 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
|
80 |
m_viewinfo.setTitle(PluginServices.getText(this, "InfoByPoint")); |
81 |
if(!extended)
|
82 |
m_viewinfo.setHeight(380);
|
83 |
else
|
84 |
m_viewinfo.setHeight(404);
|
85 |
m_viewinfo.setWidth(250);
|
86 |
return m_viewinfo;
|
87 |
} |
88 |
|
89 |
/*
|
90 |
* (non-Javadoc)
|
91 |
* @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
|
92 |
*/
|
93 |
public void windowClosed() { |
94 |
CompoundBehavior.setAllControlsBehavior(InfoByRasterPointExtension.oldBehavior); |
95 |
} |
96 |
|
97 |
public Object getWindowProfile() { |
98 |
return WindowInfo.PROPERTIES_PROFILE;
|
99 |
} |
100 |
|
101 |
public InfoByPointDataModel getInfoByPointDataModel() {
|
102 |
return getMainPanel().getInfoByPointDataModel();
|
103 |
} |
104 |
|
105 |
public PixelInspector getPixelInspector() {
|
106 |
return getMainPanel().getPixelInspectorPanel();
|
107 |
} |
108 |
|
109 |
public void actionPerformed(ActionEvent e) { |
110 |
if(e.getSource() == getMainPanel().getButtonsPanel().getExtendedButton()) {
|
111 |
|
112 |
} |
113 |
} |
114 |
} |