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 @ 1192
History | View | Annotate | Download (4.7 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 |
private boolean extended = false; |
51 |
|
52 |
public MainInfoByPointDialog(boolean extended) { |
53 |
this.extended = extended;
|
54 |
setLayout(new BorderLayout()); |
55 |
add((Component)getMainPanel(), BorderLayout.CENTER); |
56 |
} |
57 |
|
58 |
public MainInfoByPointPanel getMainPanel() {
|
59 |
if(mainPanel == null) { |
60 |
HashMap<String, String> translations = new HashMap<String, String>(); |
61 |
translations.put("info", PluginServices.getText(this, "info")); |
62 |
translations.put("view", PluginServices.getText(this, "view")); |
63 |
translations.put("layer_list", PluginServices.getText(this, "layer_list")); |
64 |
translations.put("band_values", PluginServices.getText(this, "band_values")); |
65 |
translations.put("pixel_point", PluginServices.getText(this, "pixel_point")); |
66 |
translations.put("view_point", PluginServices.getText(this, "view_point")); |
67 |
translations.put("world_point", PluginServices.getText(this, "world_point")); |
68 |
translations.put("bands", PluginServices.getText(this, "bands")); |
69 |
translations.put("colors", PluginServices.getText(this, "colors")); |
70 |
translations.put("coords", PluginServices.getText(this, "coords")); |
71 |
translations.put("lat", PluginServices.getText(this, "lat")); |
72 |
translations.put("long", PluginServices.getText(this, "long")); |
73 |
translations.put("red", PluginServices.getText(this, "red")); |
74 |
translations.put("green", PluginServices.getText(this, "green")); |
75 |
translations.put("blue", PluginServices.getText(this, "blue")); |
76 |
HashMap<String, ImageIcon> icons = new HashMap<String, ImageIcon>(); |
77 |
icons.put("forward-icon", IconThemeHelper.getImageIcon("forward-icon")); |
78 |
icons.put("backward-icon", IconThemeHelper.getImageIcon("backward-icon")); |
79 |
mainPanel = RasterSwingLocator.getSwingManager().createInfoByPointPanel( |
80 |
translations, icons, extended); |
81 |
mainPanel.addListenerExtendedButton(this);
|
82 |
} |
83 |
return mainPanel;
|
84 |
} |
85 |
|
86 |
/*
|
87 |
* (non-Javadoc)
|
88 |
* @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
|
89 |
*/
|
90 |
public WindowInfo getWindowInfo() {
|
91 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG);
|
92 |
m_viewinfo.setTitle(PluginServices.getText(this, "InfoByPoint")); |
93 |
if(!extended)
|
94 |
m_viewinfo.setHeight(380);
|
95 |
else
|
96 |
m_viewinfo.setHeight(404);
|
97 |
m_viewinfo.setWidth(250);
|
98 |
return m_viewinfo;
|
99 |
} |
100 |
|
101 |
/*
|
102 |
* (non-Javadoc)
|
103 |
* @see com.iver.andami.ui.mdiManager.IWindowListener#windowClosed()
|
104 |
*/
|
105 |
public void windowClosed() { |
106 |
CompoundBehavior.setAllControlsBehavior(InfoByRasterPointExtension.oldBehavior); |
107 |
} |
108 |
|
109 |
public Object getWindowProfile() { |
110 |
return WindowInfo.PROPERTIES_PROFILE;
|
111 |
} |
112 |
|
113 |
public InfoByPointDataModel getInfoByPointDataModel() {
|
114 |
return getMainPanel().getInfoByPointDataModel();
|
115 |
} |
116 |
|
117 |
public PixelInspector getPixelInspector() {
|
118 |
return getMainPanel().getPixelInspectorPanel();
|
119 |
} |
120 |
|
121 |
public void actionPerformed(ActionEvent e) { |
122 |
} |
123 |
} |