Revision 1172
org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.basic/src/test/java/org/gvsig/raster/app/extension/TestInfoByPointPanel.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
public class TestInfoByPointPanel { |
12 | 12 |
private int w = 280; |
13 |
private int h = 410;
|
|
13 |
private int h = 434;
|
|
14 | 14 |
private JFrame frame = new JFrame(); |
15 | 15 |
private MainInfoByPointPanel desc = null; |
16 | 16 |
|
17 | 17 |
public TestInfoByPointPanel() { |
18 |
desc = new MainInfoByPointPanel(null); |
|
18 |
desc = new MainInfoByPointPanel(null, true);
|
|
19 | 19 |
InfoByPointDataModel model = desc.getInfoByPointDataModel(); |
20 | 20 |
model.addObserver(desc); |
21 | 21 |
model.setARGB(255, 125, 110); |
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/gui/PixelViewPanel.java | ||
---|---|---|
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.gui; |
|
23 |
|
|
24 |
import java.awt.GridBagConstraints; |
|
25 |
import java.awt.GridBagLayout; |
|
26 |
import java.util.HashMap; |
|
27 |
|
|
28 |
import javax.swing.JPanel; |
|
29 |
|
|
30 |
/** |
|
31 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
32 |
*/ |
|
33 |
public class PixelViewPanel extends JPanel { |
|
34 |
private static final long serialVersionUID = 1L; |
|
35 |
private HashMap<String, String> tr = null; |
|
36 |
private InfoByPointDataModel dataModel = null; |
|
37 |
private PixelInspectorPanel pixelInspectorPanel = null; |
|
38 |
private InfoByPointPanel infoByPointPanel = null; |
|
39 |
|
|
40 |
public PixelViewPanel(HashMap<String, String> translations, InfoByPointDataModel dataModel) { |
|
41 |
tr = translations; |
|
42 |
if(tr == null || tr.get("layer_list") == null) { |
|
43 |
tr = new HashMap<String, String>(); |
|
44 |
tr.put("layer_list", "layer_list"); |
|
45 |
tr.put("band_values", "band_values"); |
|
46 |
tr.put("pixel_point", "pixel_point"); |
|
47 |
tr.put("view_point", "view_point"); |
|
48 |
tr.put("world_point", "world_point"); |
|
49 |
tr.put("bands", "bands"); |
|
50 |
tr.put("colors", "colors"); |
|
51 |
tr.put("coords", "coords"); |
|
52 |
tr.put("lat", "lat"); |
|
53 |
tr.put("long", "long"); |
|
54 |
} |
|
55 |
this.dataModel = dataModel; |
|
56 |
init(); |
|
57 |
} |
|
58 |
|
|
59 |
private void init() { |
|
60 |
setLayout(new GridBagLayout()); |
|
61 |
GridBagConstraints gbc = new GridBagConstraints(); |
|
62 |
gbc.gridx = 0; |
|
63 |
gbc.gridy = 0; |
|
64 |
gbc.fill = GridBagConstraints.BOTH; |
|
65 |
gbc.weightx = 1; |
|
66 |
gbc.weighty = 1; |
|
67 |
gbc.insets = new java.awt.Insets(2, 2, 2, 2); |
|
68 |
add(getPixelInspectorPanel(), gbc); |
|
69 |
|
|
70 |
gbc.gridy = 1; |
|
71 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
72 |
gbc.weightx = 1; |
|
73 |
gbc.weighty = 0; |
|
74 |
add(getinfoByPointPanel(), gbc); |
|
75 |
} |
|
76 |
|
|
77 |
public void updateDataModel() { |
|
78 |
getinfoByPointPanel().updateDataModel(); |
|
79 |
} |
|
80 |
|
|
81 |
public PixelInspectorPanel getPixelInspectorPanel() { |
|
82 |
if(pixelInspectorPanel == null) |
|
83 |
pixelInspectorPanel = new PixelInspectorPanel(tr); |
|
84 |
return pixelInspectorPanel; |
|
85 |
} |
|
86 |
|
|
87 |
public InfoByPointPanel getinfoByPointPanel() { |
|
88 |
if(infoByPointPanel == null) |
|
89 |
infoByPointPanel = new InfoByPointPanel(tr, dataModel); |
|
90 |
return infoByPointPanel; |
|
91 |
} |
|
92 |
} |
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/gui/ButtonsPanel.java | ||
---|---|---|
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.gui; |
|
23 |
|
|
24 |
import java.awt.Color; |
|
25 |
import java.awt.Dimension; |
|
26 |
import java.awt.FlowLayout; |
|
27 |
import java.awt.GridBagConstraints; |
|
28 |
import java.awt.GridBagLayout; |
|
29 |
import java.awt.event.ActionEvent; |
|
30 |
import java.awt.event.ActionListener; |
|
31 |
|
|
32 |
import javax.swing.BorderFactory; |
|
33 |
import javax.swing.Icon; |
|
34 |
import javax.swing.ImageIcon; |
|
35 |
import javax.swing.JButton; |
|
36 |
import javax.swing.JPanel; |
|
37 |
|
|
38 |
import org.gvsig.andami.PluginServices; |
|
39 |
|
|
40 |
/** |
|
41 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
42 |
*/ |
|
43 |
public class ButtonsPanel extends JPanel implements ActionListener { |
|
44 |
private static final long serialVersionUID = 1L; |
|
45 |
private static int BUTTON_SIZE = 26; |
|
46 |
private JButton extendedButton = null; |
|
47 |
private Icon icon1 = null; |
|
48 |
private Icon icon2 = null; |
|
49 |
|
|
50 |
public ButtonsPanel() { |
|
51 |
try { |
|
52 |
icon1 = PluginServices.getIconTheme().get("forward-icon"); |
|
53 |
icon2 = PluginServices.getIconTheme().get("backward-icon"); |
|
54 |
if(icon1 == null) |
|
55 |
icon1 = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/forward.png", ""); |
|
56 |
if(icon2 == null) |
|
57 |
icon2 = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/backward.png", ""); |
|
58 |
} catch (NullPointerException e) { |
|
59 |
} |
|
60 |
init(); |
|
61 |
} |
|
62 |
|
|
63 |
private void init() { |
|
64 |
FlowLayout ly = new FlowLayout(); |
|
65 |
setLayout(ly); |
|
66 |
//ly.setHgap(2); |
|
67 |
ly.setVgap(2); |
|
68 |
ly.setAlignment(FlowLayout.RIGHT); |
|
69 |
setBorder(BorderFactory.createLineBorder(Color.blue)); |
|
70 |
add(getExtendedButton()); |
|
71 |
/*setLayout(new GridBagLayout()); |
|
72 |
GridBagConstraints gbc = new GridBagConstraints(); |
|
73 |
gbc.gridx = 0; |
|
74 |
gbc.weightx = 1; |
|
75 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
76 |
gbc.insets = new java.awt.Insets(1, 1, 1, 4); |
|
77 |
add(new JPanel(), gbc); |
|
78 |
|
|
79 |
gbc.gridx = 1; |
|
80 |
gbc.anchor = GridBagConstraints.EAST; |
|
81 |
gbc.fill = GridBagConstraints.NONE; |
|
82 |
gbc.weightx = 0; |
|
83 |
add(getExtendedButton(), gbc);*/ |
|
84 |
} |
|
85 |
|
|
86 |
public JButton getExtendedButton() { |
|
87 |
if(extendedButton == null) { |
|
88 |
extendedButton = new JButton(icon1); |
|
89 |
extendedButton.setPreferredSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE)); |
|
90 |
extendedButton.addActionListener(this); |
|
91 |
} |
|
92 |
return extendedButton; |
|
93 |
} |
|
94 |
|
|
95 |
public void actionPerformed(ActionEvent e) { |
|
96 |
if(e.getSource() == getExtendedButton()) { |
|
97 |
if(getExtendedButton().getIcon() == icon1) |
|
98 |
getExtendedButton().setIcon(icon2); |
|
99 |
else |
|
100 |
getExtendedButton().setIcon(icon1); |
|
101 |
} |
|
102 |
|
|
103 |
} |
|
104 |
} |
|
0 | 105 |
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/gui/InfoByPointPanel.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.raster.tools.app.basic.tool.infobypoint.gui; |
23 | 23 |
|
24 |
import java.awt.Dimension; |
|
24 | 25 |
import java.awt.GridBagConstraints; |
25 | 26 |
import java.awt.GridBagLayout; |
26 | 27 |
import java.awt.event.ActionEvent; |
... | ... | |
83 | 84 |
GridBagConstraints gbc = new GridBagConstraints(); |
84 | 85 |
gbc.gridx = 0; |
85 | 86 |
gbc.gridy = 0; |
86 |
gbc.anchor = GridBagConstraints.WEST; |
|
87 |
//gbc.anchor = GridBagConstraints.WEST;
|
|
87 | 88 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
88 | 89 |
gbc.weightx = 1; |
89 | 90 |
gbc.insets = new java.awt.Insets(1, 2, 1, 2); |
... | ... | |
93 | 94 |
add(getJPanelCoordinates(), gbc); |
94 | 95 |
|
95 | 96 |
gbc.gridy = 4; |
96 |
gbc.fill = GridBagConstraints.BOTH; |
|
97 |
gbc.weighty = 1; |
|
97 |
//gbc.fill = GridBagConstraints.BOTH;
|
|
98 |
//gbc.weighty = 1;
|
|
98 | 99 |
add(getJPanelBands(), gbc); |
99 | 100 |
|
100 | 101 |
gbc.gridy = 5; |
101 |
gbc.weighty = 0; |
|
102 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
102 |
//gbc.weighty = 0;
|
|
103 |
//gbc.fill = GridBagConstraints.HORIZONTAL;
|
|
103 | 104 |
add(getJPanelColors(), gbc); |
104 | 105 |
} |
105 | 106 |
|
... | ... | |
138 | 139 |
|
139 | 140 |
jPanelBands.add(getJLabelNumberOfBands(), gbc); |
140 | 141 |
gbc.gridy = 1; |
141 |
gbc.gridheight = 2; |
|
142 |
gbc.fill = GridBagConstraints.BOTH; |
|
143 |
gbc.weighty = 1; |
|
142 |
//gbc.gridheight = 2;
|
|
143 |
//gbc.fill = GridBagConstraints.BOTH;
|
|
144 |
//gbc.weighty = 1;
|
|
144 | 145 |
JScrollPane listScroller = new JScrollPane(getJListValues()); |
146 |
listScroller.setPreferredSize(new Dimension(0, 35)); |
|
145 | 147 |
jPanelBands.add(listScroller, gbc); |
146 | 148 |
} |
147 | 149 |
return jPanelBands; |
... | ... | |
197 | 199 |
private JList getJListValues() { |
198 | 200 |
if(jListBandValues == null) { |
199 | 201 |
jListBandValues = new JList(); |
202 |
//jListBandValues.setPreferredSize(new Dimension(0, 35)); |
|
200 | 203 |
} |
201 | 204 |
return jListBandValues; |
202 | 205 |
} |
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/gui/MainInfoByPointPanel.java | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
package org.gvsig.raster.tools.app.basic.tool.infobypoint.gui; |
23 | 23 |
|
24 |
import java.awt.BorderLayout; |
|
24 |
import java.awt.Color; |
|
25 |
import java.awt.Dimension; |
|
26 |
import java.awt.GridBagConstraints; |
|
27 |
import java.awt.GridBagLayout; |
|
25 | 28 |
import java.util.HashMap; |
26 | 29 |
import java.util.Observable; |
27 | 30 |
import java.util.Observer; |
28 | 31 |
|
32 |
import javax.swing.BorderFactory; |
|
29 | 33 |
import javax.swing.JPanel; |
30 | 34 |
|
35 |
/** |
|
36 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
37 |
*/ |
|
31 | 38 |
public class MainInfoByPointPanel extends JPanel implements Observer { |
32 |
private static final long serialVersionUID = 1L; |
|
33 |
private HashMap<String, String> tr = null; |
|
34 |
private PixelViewPanel viewPanel = null; |
|
35 |
private InfoByPointDataModel dataModel = null; |
|
39 |
private static final long serialVersionUID = 1L; |
|
40 |
private HashMap<String, String> tr = null; |
|
41 |
private InfoByPointDataModel dataModel = null; |
|
42 |
private PixelInspectorPanel pixelInspectorPanel = null; |
|
43 |
private InfoByPointPanel infoByPointPanel = null; |
|
44 |
private ButtonsPanel buttonsPanel = null; |
|
45 |
private boolean extended = false; |
|
36 | 46 |
|
37 |
public MainInfoByPointPanel(HashMap<String, String> translations) { |
|
47 |
public MainInfoByPointPanel(HashMap<String, String> translations, boolean extended) {
|
|
38 | 48 |
tr = translations; |
39 |
if(tr == null) { |
|
49 |
if(tr == null || tr.get("layer_list") == null) {
|
|
40 | 50 |
tr = new HashMap<String, String>(); |
51 |
tr.put("layer_list", "layer_list"); |
|
52 |
tr.put("band_values", "band_values"); |
|
53 |
tr.put("pixel_point", "pixel_point"); |
|
54 |
tr.put("view_point", "view_point"); |
|
55 |
tr.put("world_point", "world_point"); |
|
56 |
tr.put("bands", "bands"); |
|
57 |
tr.put("colors", "colors"); |
|
58 |
tr.put("coords", "coords"); |
|
59 |
tr.put("lat", "lat"); |
|
60 |
tr.put("long", "long"); |
|
41 | 61 |
} |
62 |
this.extended = extended; |
|
42 | 63 |
init(); |
43 | 64 |
} |
44 | 65 |
|
45 | 66 |
private void init() { |
46 |
setLayout(new BorderLayout()); |
|
47 |
add(getViewPanel(), BorderLayout.CENTER); |
|
48 |
} |
|
49 |
|
|
50 |
public PixelViewPanel getViewPanel() { |
|
51 |
if(viewPanel == null) { |
|
52 |
viewPanel = new PixelViewPanel(tr, getInfoByPointDataModel()); |
|
67 |
setLayout(new GridBagLayout()); |
|
68 |
GridBagConstraints gbc = new GridBagConstraints(); |
|
69 |
gbc.gridx = 0; |
|
70 |
gbc.gridy = 0; |
|
71 |
gbc.gridwidth = 1; |
|
72 |
gbc.gridheight = 1; |
|
73 |
if(!extended) { |
|
74 |
gbc.fill = GridBagConstraints.BOTH; |
|
75 |
gbc.weightx = 1; |
|
76 |
gbc.weighty = 1; |
|
77 |
} else { |
|
78 |
gbc.anchor = GridBagConstraints.WEST; |
|
79 |
gbc.fill = GridBagConstraints.VERTICAL; |
|
80 |
gbc.weighty = 1; |
|
53 | 81 |
} |
54 |
return viewPanel; |
|
82 |
gbc.insets = new java.awt.Insets(2, 2, 2, 2); |
|
83 |
add(getPixelInspectorPanel(), gbc); |
|
84 |
|
|
85 |
if(!extended) { |
|
86 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
87 |
gbc.weightx = 1; |
|
88 |
gbc.weighty = 0; |
|
89 |
} else { |
|
90 |
gbc.fill = GridBagConstraints.NONE; |
|
91 |
gbc.weighty = 0; |
|
92 |
} |
|
93 |
|
|
94 |
gbc.gridx = 0; |
|
95 |
gbc.gridy = 1; |
|
96 |
add(getinfoByPointPanel(), gbc); |
|
97 |
|
|
98 |
if(extended) { |
|
99 |
gbc.fill = GridBagConstraints.HORIZONTAL; |
|
100 |
gbc.gridx = 0; |
|
101 |
gbc.gridy = 2; |
|
102 |
add(getButtonsPanel(), gbc); |
|
103 |
|
|
104 |
gbc.gridx = 1; |
|
105 |
gbc.gridy = 0; |
|
106 |
gbc.gridheight = 3; |
|
107 |
gbc.fill = GridBagConstraints.BOTH; |
|
108 |
gbc.weightx = 1; |
|
109 |
gbc.weighty = 1; |
|
110 |
JPanel p = new JPanel(); |
|
111 |
p.setPreferredSize(new Dimension(500, 400)); |
|
112 |
p.setBorder(BorderFactory.createLineBorder(Color.red)); |
|
113 |
add(p, gbc); |
|
114 |
} |
|
55 | 115 |
} |
56 | 116 |
|
57 | 117 |
public InfoByPointDataModel getInfoByPointDataModel() { |
... | ... | |
59 | 119 |
dataModel = new InfoByPointDataModel(); |
60 | 120 |
return dataModel; |
61 | 121 |
} |
62 |
|
|
122 |
|
|
123 |
public PixelInspectorPanel getPixelInspectorPanel() { |
|
124 |
if(pixelInspectorPanel == null) |
|
125 |
pixelInspectorPanel = new PixelInspectorPanel(tr); |
|
126 |
return pixelInspectorPanel; |
|
127 |
} |
|
128 |
|
|
129 |
public InfoByPointPanel getinfoByPointPanel() { |
|
130 |
if(infoByPointPanel == null) |
|
131 |
infoByPointPanel = new InfoByPointPanel(tr, getInfoByPointDataModel()); |
|
132 |
return infoByPointPanel; |
|
133 |
} |
|
134 |
|
|
135 |
public ButtonsPanel getButtonsPanel() { |
|
136 |
if(buttonsPanel == null) |
|
137 |
buttonsPanel = new ButtonsPanel(); |
|
138 |
return buttonsPanel; |
|
139 |
} |
|
140 |
|
|
63 | 141 |
public void update(Observable o, Object arg) { |
64 |
getViewPanel().updateDataModel();
|
|
142 |
getinfoByPointPanel().updateDataModel();
|
|
65 | 143 |
} |
66 |
|
|
67 | 144 |
} |
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 | ||
---|---|---|
22 | 22 |
package org.gvsig.raster.tools.app.basic.tool.infobypoint; |
23 | 23 |
|
24 | 24 |
import java.awt.BorderLayout; |
25 |
import java.awt.event.ActionEvent; |
|
26 |
import java.awt.event.ActionListener; |
|
25 | 27 |
import java.util.HashMap; |
26 | 28 |
|
27 | 29 |
import javax.swing.JPanel; |
... | ... | |
34 | 36 |
import org.gvsig.raster.tools.app.basic.tool.infobypoint.gui.MainInfoByPointPanel; |
35 | 37 |
import org.gvsig.raster.tools.app.basic.tool.pixelincrease.PixelInspector; |
36 | 38 |
|
37 |
public class MainInfoByPointDialog extends JPanel implements IWindow { |
|
39 |
public class MainInfoByPointDialog extends JPanel implements IWindow, ActionListener {
|
|
38 | 40 |
private static final long serialVersionUID = 1L; |
39 | 41 |
private MainInfoByPointPanel mainPanel = null; |
42 |
private boolean extended = false; |
|
40 | 43 |
|
41 |
public MainInfoByPointDialog() { |
|
44 |
public MainInfoByPointDialog(boolean extended) { |
|
45 |
this.extended = extended; |
|
42 | 46 |
setLayout(new BorderLayout()); |
43 | 47 |
add(getMainPanel(), BorderLayout.CENTER); |
44 | 48 |
} |
... | ... | |
61 | 65 |
translations.put("red", PluginServices.getText(this, "red")); |
62 | 66 |
translations.put("green", PluginServices.getText(this, "green")); |
63 | 67 |
translations.put("blue", PluginServices.getText(this, "blue")); |
64 |
mainPanel = new MainInfoByPointPanel(translations); |
|
68 |
mainPanel = new MainInfoByPointPanel(translations, extended); |
|
69 |
mainPanel.getButtonsPanel().getExtendedButton().addActionListener(this); |
|
65 | 70 |
} |
66 | 71 |
return mainPanel; |
67 | 72 |
} |
... | ... | |
73 | 78 |
public WindowInfo getWindowInfo() { |
74 | 79 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODELESSDIALOG); |
75 | 80 |
m_viewinfo.setTitle(PluginServices.getText(this, "InfoByPoint")); |
76 |
m_viewinfo.setHeight(380); |
|
81 |
if(!extended) |
|
82 |
m_viewinfo.setHeight(380); |
|
83 |
else |
|
84 |
m_viewinfo.setHeight(404); |
|
77 | 85 |
m_viewinfo.setWidth(250); |
78 | 86 |
return m_viewinfo; |
79 | 87 |
} |
... | ... | |
95 | 103 |
} |
96 | 104 |
|
97 | 105 |
public PixelInspector getPixelInspector() { |
98 |
return getMainPanel().getViewPanel().getPixelInspectorPanel();
|
|
106 |
return getMainPanel().getPixelInspectorPanel(); |
|
99 | 107 |
} |
108 |
|
|
109 |
public void actionPerformed(ActionEvent e) { |
|
110 |
if(e.getSource() == getMainPanel().getButtonsPanel().getExtendedButton()) { |
|
111 |
|
|
112 |
} |
|
113 |
} |
|
100 | 114 |
} |
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/InfoByRasterPointExtension.java | ||
---|---|---|
74 | 74 |
return; |
75 | 75 |
} |
76 | 76 |
} |
77 |
MainInfoByPointDialog dialog = new MainInfoByPointDialog(); |
|
77 |
MainInfoByPointDialog dialog = new MainInfoByPointDialog(false);
|
|
78 | 78 |
InfoByPointDataModel model = dialog.getInfoByPointDataModel(); |
79 | 79 |
model.addObserver(dialog.getMainPanel()); |
80 | 80 |
|
... | ... | |
100 | 100 |
return ((AbstractViewPanel)theView).getMapControl(); |
101 | 101 |
} |
102 | 102 |
|
103 |
|
|
103 | 104 |
/* |
104 | 105 |
* (non-Javadoc) |
105 | 106 |
* @see org.gvsig.andami.plugins.IExtension#isEnabled() |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSServerExplorer.java | ||
---|---|---|
223 | 223 |
} |
224 | 224 |
return null; |
225 | 225 |
} |
226 |
|
|
227 |
/** |
|
228 |
* Gets the list of raster information formats supported by the server |
|
229 |
* @return |
|
230 |
*/ |
|
231 |
@SuppressWarnings("unchecked") |
|
232 |
public String[] getInfoFormats() { |
|
233 |
if(connector != null) { |
|
234 |
Vector f = connector.getInfoFormats(); |
|
235 |
ArrayList formatos = new ArrayList(); |
|
236 |
for (int i = 0; i < f.size(); i++) { |
|
237 |
formatos.add(f.elementAt(i)); |
|
238 |
} |
|
239 |
return (String[]) formatos.toArray(new String[0]); |
|
240 |
} |
|
241 |
return null; |
|
242 |
} |
|
226 | 243 |
|
227 | 244 |
/** |
228 | 245 |
* Gets a tree of nodes which represents the server information |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSConnector.java | ||
---|---|---|
266 | 266 |
public Vector getFormats() { |
267 | 267 |
return client.getFormats(); |
268 | 268 |
} |
269 |
|
|
270 |
/** |
|
271 |
* @return <b>Vector</b> containing strings with the information formats supported by this server. |
|
272 |
*/ |
|
273 |
@SuppressWarnings("unchecked") |
|
274 |
public Vector getInfoFormats() { |
|
275 |
return client.getInfoFormats(); |
|
276 |
} |
|
269 | 277 |
|
270 | 278 |
/** |
271 | 279 |
* @return <b>Boolean</b> returns if the WMS is queryable (suppports GetFeatureInfo) |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSProvider.java | ||
---|---|---|
667 | 667 |
wmsStatus.setLayerNames(Utilities.createVector(p.getLayerQuery(), ",")); |
668 | 668 |
wmsStatus.setSrs(p.getSRSCode()); |
669 | 669 |
wmsStatus.setFormat(p.getFormat()); |
670 |
wmsStatus.setInfoFormat(p.getInfoFormat()); |
|
670 | 671 |
wmsStatus.setStyles(p.getStyles()); |
671 | 672 |
wmsStatus.setDimensions(p.getDimensions()); |
672 | 673 |
wmsStatus.setTransparency(p.isWmsTransparent()); |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSDataParameters.java | ||
---|---|---|
39 | 39 |
public void setLayerQuery(String string); |
40 | 40 |
|
41 | 41 |
public void setInfoLayerQuery(String string); |
42 |
|
|
43 |
/** |
|
44 |
* Sets the info by point format |
|
45 |
*/ |
|
46 |
public void setInfoFormat(String format); |
|
47 |
|
|
48 |
/** |
|
49 |
* Gets the info by point format |
|
50 |
* @return |
|
51 |
*/ |
|
52 |
public String getInfoFormat(); |
|
42 | 53 |
|
43 | 54 |
public void setFormat(String string); |
44 | 55 |
|
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/resources/text.properties | ||
---|---|---|
168 | 168 |
ymax=ymax |
169 | 169 |
ymin=ymin |
170 | 170 |
remote_service_tiled=Has seleccionado la opci?n usar la cach? de teselas en este servicio remoto.\n Esto significa que se har?n sucesivas peticiones de un tama?o m?ximo de |
171 |
seleccionar_infobypoint_format=Seleccionar formato de texto para informaci?n por punto |
|
172 |
infoformat=Formato de la informaci?n por punto |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/resources/text_en.properties | ||
---|---|---|
167 | 167 |
ymax=Maximum Y |
168 | 168 |
ymin=Minimum Y |
169 | 169 |
remote_service_tiled=You have decided to use the tile cache in this remote service.\n That means that several requests will be done in a maximum size of |
170 |
seleccionar_infobypoint_format=Select text format for info by point |
|
171 |
infoformat=Format of info by point |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/dialog/WMSPropsDialog.java | ||
---|---|---|
198 | 198 |
if (index != -1) { |
199 | 199 |
toc.getLstFormats().setSelectedIndex(index); |
200 | 200 |
} |
201 |
|
|
202 |
//info format |
|
203 |
String infoFormat = (String) info.get("infoformat"); |
|
204 |
index = toc.getFormatIndex(infoFormat); |
|
205 |
if (index != -1) { |
|
206 |
toc.getLstInfoFormats().setSelectedIndex(index); |
|
207 |
} |
|
201 | 208 |
|
202 | 209 |
// transparency |
203 | 210 |
toc.setTransparent(((Boolean) info.get("wmsTransparency")).booleanValue()); |
... | ... | |
306 | 313 |
return; |
307 | 314 |
} |
308 | 315 |
((FLyrWMS) fLayer).getParameters().setFormat(wmsParamsTabbedPane.getFormat()); |
316 |
((FLyrWMS) fLayer).getParameters().setInfoFormat(wmsParamsTabbedPane.getInfoFormat()); |
|
309 | 317 |
try { |
310 | 318 |
if (!wmsParamsTabbedPane.getDisagregatedLayers()) { |
311 | 319 |
((FLyrWMS) fLayer).getParameters().setLayerQuery(wmsParamsTabbedPane.getLayersQuery()); |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/panel/WMSParamsPanel.java | ||
---|---|---|
106 | 106 |
*/ |
107 | 107 |
@SuppressWarnings("unchecked") |
108 | 108 |
public class WMSParamsPanel extends WizardPanel { |
109 |
private static final long serialVersionUID = 1L; |
|
110 |
private JScrollPane jScrollPane1 = null; |
|
111 |
private JScrollPane jScrollPane2 = null; |
|
112 |
private JScrollPane jScrollPane5 = null; |
|
113 |
private JButton btnAdd = null; |
|
114 |
private JButton btnDel = null; |
|
115 |
private JScrollPane jScrollPane6 = null; |
|
116 |
private JPanel jPanel2 = null; |
|
117 |
private JPanel tabFormats = null; |
|
118 |
private JPanel jPanel4 = null; |
|
119 |
private JTextField jTxtNomCapa = null; |
|
120 |
private LayerList lstSelectedLayers = null; |
|
121 |
private ArrayList<TreePath> selectedPaths = new ArrayList<TreePath>(); |
|
122 |
private JList lstSRSs = null; |
|
123 |
private LayerTree treeLayers = null; |
|
124 |
private JList lstFormats = null; |
|
125 |
private WizardListenerSupport listenerSupport; |
|
126 |
private JTabbedPane jTabbedPane = null; |
|
127 |
private JPanel tabLayers = null; |
|
128 |
private JPanel jPanel1 = null; |
|
129 |
private JPanel jPanel5 = null; |
|
130 |
private StylesPanel tabStyle = null; |
|
131 |
private JCheckBox chkTransparency = null; |
|
132 |
private InfoPanel tabInfo = null; |
|
133 |
private DimensionPanel tabDimensions = null; |
|
134 |
private int dimensionTabIndex; |
|
135 |
private int stylesTabIndex; |
|
136 |
private String oldSRS = null; |
|
137 |
private AbstractCollection oldDimensions = null; |
|
138 |
private Dimension sizeFixed; |
|
139 |
private JCheckBox chkExtendedNames = null; |
|
140 |
private JButton btnUp = null; |
|
141 |
private JButton btnDown = null; |
|
142 |
protected WMSServerExplorer explorer = null; |
|
143 |
private boolean updating = fPrefs.getBoolean("refresh_capabilities", false); |
|
144 |
public static Preferences fPrefs = Preferences.userRoot().node( |
|
145 |
"gvsig.wms-wizard"); |
|
109 |
private static final long serialVersionUID = 1L; |
|
110 |
private JScrollPane jScrollPane1 = null; |
|
111 |
private JScrollPane jScrollPane2 = null; |
|
112 |
private JScrollPane jScrollPane3 = null; |
|
113 |
private JScrollPane jScrollPane5 = null; |
|
114 |
private JButton btnAdd = null; |
|
115 |
private JButton btnDel = null; |
|
116 |
private JScrollPane jScrollPane6 = null; |
|
117 |
private JPanel jPanel2 = null; |
|
118 |
private JPanel tabFormats = null; |
|
119 |
private JPanel jPanel4 = null; |
|
120 |
private JTextField jTxtNomCapa = null; |
|
121 |
private LayerList lstSelectedLayers = null; |
|
122 |
private ArrayList<TreePath> selectedPaths = new ArrayList<TreePath>(); |
|
123 |
private JList lstSRSs = null; |
|
124 |
private JList lstInfoFormats = null; |
|
125 |
private LayerTree treeLayers = null; |
|
126 |
private JList lstFormats = null; |
|
127 |
private WizardListenerSupport listenerSupport; |
|
128 |
private JTabbedPane jTabbedPane = null; |
|
129 |
private JPanel tabLayers = null; |
|
130 |
private JPanel jPanel1 = null; |
|
131 |
private JPanel jPanel5 = null; |
|
132 |
private JPanel jPanel6 = null; |
|
133 |
private StylesPanel tabStyle = null; |
|
134 |
private JCheckBox chkTransparency = null; |
|
135 |
private InfoPanel tabInfo = null; |
|
136 |
private DimensionPanel tabDimensions = null; |
|
137 |
private int dimensionTabIndex; |
|
138 |
private int stylesTabIndex; |
|
139 |
private String oldSRS = null; |
|
140 |
private AbstractCollection oldDimensions = null; |
|
141 |
private Dimension sizeFixed; |
|
142 |
private JCheckBox chkExtendedNames = null; |
|
143 |
private JButton btnUp = null; |
|
144 |
private JButton btnDown = null; |
|
145 |
protected WMSServerExplorer explorer = null; |
|
146 |
private boolean updating = fPrefs.getBoolean("refresh_capabilities", false); |
|
147 |
public static Preferences fPrefs = Preferences.userRoot().node("gvsig.wms-wizard"); |
|
148 |
private JCheckBox chkDisagregate = null; |
|
149 |
private boolean lastCached; |
|
146 | 150 |
|
147 |
private JCheckBox chkDisagregate = null; |
|
148 |
private boolean lastCached; |
|
149 |
|
|
150 | 151 |
public WMSParamsPanel() { |
151 | 152 |
super(); |
152 | 153 |
initialize(); |
153 | 154 |
} |
154 | 155 |
|
155 |
// TODO: crear nuevo constructor para a๏ฟฝadir los panels que quieras...
|
|
156 |
// TODO: crear nuevo constructor para a?adir los panels que quieras...
|
|
156 | 157 |
public WMSParamsPanel(WMSServerExplorer data) { |
157 | 158 |
super(); |
158 | 159 |
setWizardData(data); |
... | ... | |
264 | 265 |
tabFormats.setLayout(null); |
265 | 266 |
tabFormats.add(getJPanel1(), null); |
266 | 267 |
tabFormats.add(getJPanel5(), null); |
268 |
tabFormats.add(getJPanel6(), null); |
|
267 | 269 |
} |
268 | 270 |
|
269 | 271 |
return tabFormats; |
... | ... | |
364 | 366 |
|
365 | 367 |
return jTxtNomCapa; |
366 | 368 |
} |
369 |
|
|
370 |
/** |
|
371 |
* This method initializes jPanel1 |
|
372 |
* |
|
373 |
* @return Panel |
|
374 |
*/ |
|
375 |
private JPanel getJPanel1() { |
|
376 |
if (jPanel1 == null) { |
|
377 |
jPanel1 = new JPanel(); |
|
378 |
jPanel1.setLayout(null); |
|
379 |
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
380 |
null, PluginServices.getText(this, "select_formats"), |
|
381 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
382 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
383 |
null)); |
|
384 |
jPanel1.setBounds(5, 10, 485, 140); |
|
385 |
jPanel1.add(getJScrollPane6(), null); |
|
386 |
jPanel1.add(getChkTransparency(), null); |
|
387 |
} |
|
388 |
return jPanel1; |
|
389 |
} |
|
367 | 390 |
|
368 | 391 |
/** |
392 |
* This method initializes jPanel5 |
|
393 |
* |
|
394 |
* @return Panel |
|
395 |
*/ |
|
396 |
private JPanel getJPanel5() { |
|
397 |
if (jPanel5 == null) { |
|
398 |
jPanel5 = new JPanel(); |
|
399 |
jPanel5.setLayout(null); |
|
400 |
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
401 |
null, PluginServices.getText(this, "seleccionar_srs"), |
|
402 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
403 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
404 |
null)); |
|
405 |
jPanel5.setBounds(5, 150, 485, 140); |
|
406 |
jPanel5.add(getJScrollPane2(), null); |
|
407 |
} |
|
408 |
return jPanel5; |
|
409 |
} |
|
410 |
|
|
411 |
/** |
|
412 |
* This method initializes jPanel6 |
|
413 |
* |
|
414 |
* @return Panel |
|
415 |
*/ |
|
416 |
private JPanel getJPanel6() { |
|
417 |
if (jPanel6 == null) { |
|
418 |
jPanel6 = new JPanel(); |
|
419 |
jPanel6.setLayout(null); |
|
420 |
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
421 |
null, PluginServices.getText(this, "seleccionar_infobypoint_format"), |
|
422 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
423 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
424 |
null)); |
|
425 |
jPanel6.setBounds(5, 295, 485, 78); |
|
426 |
jPanel6.add(getJScrollPane3(), null); |
|
427 |
} |
|
428 |
return jPanel6; |
|
429 |
} |
|
430 |
|
|
431 |
/** |
|
369 | 432 |
* This method initializes jScrollPane6 |
370 | 433 |
* |
371 | 434 |
* @return ScrollPane |
... | ... | |
373 | 436 |
private JScrollPane getJScrollPane6() { |
374 | 437 |
if (jScrollPane6 == null) { |
375 | 438 |
jScrollPane6 = new JScrollPane(); |
376 |
jScrollPane6.setBounds(5, 23, 470, 140);
|
|
439 |
jScrollPane6.setBounds(5, 23, 470, 110);
|
|
377 | 440 |
jScrollPane6.setViewportView(getLstFormats()); |
378 |
jScrollPane6.setPreferredSize(new java.awt.Dimension(250, 200));
|
|
441 |
jScrollPane6.setPreferredSize(new java.awt.Dimension(250, 180));
|
|
379 | 442 |
} |
380 | 443 |
|
381 | 444 |
return jScrollPane6; |
... | ... | |
389 | 452 |
private JScrollPane getJScrollPane2() { |
390 | 453 |
if (jScrollPane2 == null) { |
391 | 454 |
jScrollPane2 = new JScrollPane(); |
392 |
jScrollPane2.setBounds(5, 23, 470, 140);
|
|
455 |
jScrollPane2.setBounds(5, 23, 470, 110);
|
|
393 | 456 |
jScrollPane2.setViewportView(getLstSRSs()); |
394 |
jScrollPane2.setPreferredSize(new java.awt.Dimension(100, 200));
|
|
457 |
jScrollPane2.setPreferredSize(new java.awt.Dimension(250, 180));
|
|
395 | 458 |
} |
396 | 459 |
|
397 | 460 |
return jScrollPane2; |
398 | 461 |
} |
462 |
|
|
463 |
/** |
|
464 |
* This method initializes jScrollPane3 |
|
465 |
* |
|
466 |
* @return ScrollPane |
|
467 |
*/ |
|
468 |
private JScrollPane getJScrollPane3() { |
|
469 |
if (jScrollPane3 == null) { |
|
470 |
jScrollPane3 = new JScrollPane(); |
|
471 |
jScrollPane3.setBounds(5, 23, 470, 45); |
|
472 |
jScrollPane3.setViewportView(getLstInfoFormats()); |
|
473 |
jScrollPane3.setPreferredSize(new java.awt.Dimension(250, 120)); |
|
474 |
} |
|
399 | 475 |
|
476 |
return jScrollPane3; |
|
477 |
} |
|
478 |
|
|
400 | 479 |
/** |
401 | 480 |
* Gets the available layers in WMS maintaining the tree structure |
402 | 481 |
* |
... | ... | |
465 | 544 |
this.repaint(); |
466 | 545 |
if ((getLstSRSs().getSelectedIndex() != -1) |
467 | 546 |
&& (getLstFormats().getSelectedIndex() != -1) |
547 |
&& (getLstInfoFormats().getSelectedIndex() != -1) |
|
468 | 548 |
&& (getLstSelectedLayers().getModel().getSize() > 0)) { |
469 | 549 |
b = true; |
470 | 550 |
} else { |
... | ... | |
474 | 554 |
// Enable or disable del button. |
475 | 555 |
int[] selectedIndices = getLstSelectedLayers().getSelectedIndices(); |
476 | 556 |
|
477 |
getBtnDel().setEnabled( |
|
478 |
selectedIndices != null && selectedIndices.length > 0); |
|
557 |
getBtnDel().setEnabled(selectedIndices != null && selectedIndices.length > 0); |
|
479 | 558 |
|
480 | 559 |
return b; |
481 | 560 |
} |
... | ... | |
557 | 636 |
*/ |
558 | 637 |
public void refreshInfo() { |
559 | 638 |
getTabInfo().refresh(explorer, selectedLayersVector(), |
560 |
getStyleTitles(), getFormat(), getSRS(), getDimensions()); |
|
639 |
getStyleTitles(), getFormat(), getInfoFormat(), getSRS(), getDimensions());
|
|
561 | 640 |
} |
562 | 641 |
|
563 | 642 |
private void refreshDimensions() { |
... | ... | |
726 | 805 |
if (lstSRSs == null) { |
727 | 806 |
lstSRSs = new JList(); |
728 | 807 |
lstSRSs.setModel(new SRSListModel()); |
729 |
lstSRSs |
|
730 |
.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
731 |
lstSRSs |
|
732 |
.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
733 |
public void valueChanged( |
|
734 |
javax.swing.event.ListSelectionEvent e) { |
|
735 |
int i = lstSRSs.getSelectedIndex(); |
|
736 |
if (i != -1) { |
|
737 |
oldSRS = (String) lstSRSs.getModel() |
|
738 |
.getElementAt(i); |
|
739 |
} |
|
740 |
fireWizardComplete(isCorrectlyConfigured()); |
|
741 |
} |
|
742 |
}); |
|
808 |
lstSRSs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
809 |
lstSRSs.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
810 |
public void valueChanged(javax.swing.event.ListSelectionEvent e) { |
|
811 |
int i = lstSRSs.getSelectedIndex(); |
|
812 |
if (i != -1) { |
|
813 |
oldSRS = (String) lstSRSs.getModel().getElementAt(i); |
|
814 |
} |
|
815 |
fireWizardComplete(isCorrectlyConfigured()); |
|
816 |
} |
|
817 |
}); |
|
743 | 818 |
} |
744 |
|
|
745 | 819 |
return lstSRSs; |
746 | 820 |
} |
821 |
|
|
822 |
/** |
|
823 |
* This method initializes lstSRSs |
|
824 |
* |
|
825 |
* @return JList |
|
826 |
*/ |
|
827 |
public JList getLstInfoFormats() { |
|
828 |
if (lstInfoFormats == null) { |
|
829 |
lstInfoFormats = new JList(); |
|
830 |
lstInfoFormats.setModel(new SRSListModel()); |
|
831 |
lstInfoFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
832 |
lstInfoFormats.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
833 |
public void valueChanged(javax.swing.event.ListSelectionEvent e) { |
|
834 |
fireWizardComplete(isCorrectlyConfigured()); |
|
835 |
} |
|
836 |
}); |
|
837 |
} |
|
747 | 838 |
|
839 |
return lstInfoFormats; |
|
840 |
} |
|
841 |
|
|
748 | 842 |
/** |
749 | 843 |
* This method initializes lstFormats |
750 | 844 |
* |
... | ... | |
753 | 847 |
public JList getLstFormats() { |
754 | 848 |
if (lstFormats == null) { |
755 | 849 |
lstFormats = new JList(); |
756 |
lstFormats |
|
757 |
.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
758 |
lstFormats |
|
759 |
.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
760 |
public void valueChanged( |
|
761 |
javax.swing.event.ListSelectionEvent e) { |
|
762 |
fireWizardComplete(isCorrectlyConfigured()); |
|
763 |
} |
|
764 |
}); |
|
850 |
lstFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
851 |
lstFormats.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
852 |
public void valueChanged(javax.swing.event.ListSelectionEvent e) { |
|
853 |
fireWizardComplete(isCorrectlyConfigured()); |
|
854 |
} |
|
855 |
}); |
|
765 | 856 |
} |
766 | 857 |
|
767 | 858 |
return lstFormats; |
... | ... | |
808 | 899 |
|
809 | 900 |
getLstFormats().setModel( |
810 | 901 |
new FormatListModel(this.explorer.getFormats())); |
902 |
getLstInfoFormats().setModel( |
|
903 |
new FormatListModel(this.explorer.getInfoFormats())); |
|
811 | 904 |
getTreeLayers() |
812 | 905 |
.setModel(new LayerTreeModel(this.explorer.getLayerTree())); |
813 | 906 |
refreshInfo(); |
... | ... | |
832 | 925 |
public String getFormat() { |
833 | 926 |
return (String) getLstFormats().getSelectedValue(); |
834 | 927 |
} |
928 |
|
|
929 |
public String getInfoFormat() { |
|
930 |
return (String) getLstInfoFormats().getSelectedValue(); |
|
931 |
} |
|
835 | 932 |
|
836 | 933 |
public String getLayersQuery() { |
837 | 934 |
ArrayList elements = ((JDnDListModel) getLstSelectedLayers().getModel()) |
... | ... | |
989 | 1086 |
} |
990 | 1087 |
return -1; |
991 | 1088 |
} |
1089 |
|
|
1090 |
/** |
|
1091 |
* Returns the index of the format within the formats list. |
|
1092 |
* |
|
1093 |
* Devuelve la posicion que ocupa el formato en la lista de formatos |
|
1094 |
* |
|
1095 |
* @param format |
|
1096 |
* |
|
1097 |
* @return The format's index if it exists, -1 if it not exists. |
|
1098 |
*/ |
|
1099 |
public int getInfoFormatIndex(String infoformat) { |
|
1100 |
for (int i = 0; i < getLstInfoFormats().getModel().getSize(); i++) { |
|
1101 |
if (infoformat != null |
|
1102 |
&& infoformat.equals(getLstInfoFormats().getModel().getElementAt(i))) { |
|
1103 |
return i; |
|
1104 |
} |
|
1105 |
} |
|
1106 |
return -1; |
|
1107 |
} |
|
992 | 1108 |
|
993 | 1109 |
/** |
994 | 1110 |
* This method initializes jTabbedPane |
... | ... | |
1046 | 1162 |
} |
1047 | 1163 |
|
1048 | 1164 |
/** |
1049 |
* This method initializes jPanel1 |
|
1050 |
* |
|
1051 |
* @return Panel |
|
1052 |
*/ |
|
1053 |
private JPanel getJPanel1() { |
|
1054 |
if (jPanel1 == null) { |
|
1055 |
jPanel1 = new JPanel(); |
|
1056 |
jPanel1.setLayout(null); |
|
1057 |
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
1058 |
null, PluginServices.getText(this, "select_formats"), |
|
1059 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
1060 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
1061 |
null)); |
|
1062 |
jPanel1.setBounds(5, 10, 485, 194); |
|
1063 |
jPanel1.add(getJScrollPane6(), null); |
|
1064 |
jPanel1.add(getChkTransparency(), null); |
|
1065 |
} |
|
1066 |
return jPanel1; |
|
1067 |
} |
|
1068 |
|
|
1069 |
/** |
|
1070 |
* This method initializes jPanel5 |
|
1071 |
* |
|
1072 |
* @return Panel |
|
1073 |
*/ |
|
1074 |
private JPanel getJPanel5() { |
|
1075 |
if (jPanel5 == null) { |
|
1076 |
jPanel5 = new JPanel(); |
|
1077 |
jPanel5.setLayout(null); |
|
1078 |
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
1079 |
null, PluginServices.getText(this, "seleccionar_srs"), |
|
1080 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
1081 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
1082 |
null)); |
|
1083 |
jPanel5.setBounds(5, 205, 485, 173); |
|
1084 |
jPanel5.add(getJScrollPane2(), null); |
|
1085 |
} |
|
1086 |
return jPanel5; |
|
1087 |
} |
|
1088 |
|
|
1089 |
/** |
|
1090 | 1165 |
* This method initializes jPanel6 |
1091 | 1166 |
* |
1092 | 1167 |
* @return Panel |
... | ... | |
1375 | 1450 |
par = (WMSDataParameters) p; |
1376 | 1451 |
} |
1377 | 1452 |
par.setFormat(getFormat()); |
1453 |
par.setInfoFormat(getInfoFormat()); |
|
1378 | 1454 |
par.setLayerQuery(node.getName()); |
1379 | 1455 |
par.setInfoLayerQuery(getQueryableLayerQuery()); |
1380 | 1456 |
par.setSRS(getSRS()); |
... | ... | |
1493 | 1569 |
par = (WMSDataParameters) p; |
1494 | 1570 |
} |
1495 | 1571 |
par.setFormat(getFormat()); |
1572 |
par.setInfoFormat(getInfoFormat()); |
|
1496 | 1573 |
par.setLayerQuery(node.getName()); |
1497 | 1574 |
par.setInfoLayerQuery(getQueryableLayerQuery()); |
1498 | 1575 |
par.setSRS(getSRS()); |
... | ... | |
1547 | 1624 |
} |
1548 | 1625 |
|
1549 | 1626 |
par.setFormat(getFormat()); |
1627 |
par.setInfoFormat(getInfoFormat()); |
|
1550 | 1628 |
par.setLayerQuery(getLayersQuery()); |
1551 | 1629 |
par.setInfoLayerQuery(getQueryableLayerQuery()); |
1552 | 1630 |
par.setSRS(getSRS()); |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/panel/InfoPanel.java | ||
---|---|---|
55 | 55 |
private final String selected_dimensions = PluginServices.getText(this, "selected_dimensions"); |
56 | 56 |
private final String style = PluginServices.getText(this, "style"); |
57 | 57 |
private final String format_title = PluginServices.getText(this, "format"); |
58 |
private final String infoformat_title = PluginServices.getText(this, "infoformat"); |
|
58 | 59 |
private final String srs_title = "SRS"; |
59 | 60 |
private final String properties = PluginServices.getText(this, "properties"); |
60 | 61 |
private final String layer_name = PluginServices.getText(this, "name"); |
... | ... | |
95 | 96 |
* @param dataSource |
96 | 97 |
*/ |
97 | 98 |
@SuppressWarnings("unchecked") |
98 |
public void refresh(WMSServerExplorer dataSource, Vector layers, Vector styles, String format, String srs, Vector dimensions) { |
|
99 |
public void refresh(WMSServerExplorer dataSource, |
|
100 |
Vector layers, |
|
101 |
Vector styles, |
|
102 |
String format, |
|
103 |
String infoFormat, |
|
104 |
String srs, |
|
105 |
Vector dimensions) { |
|
99 | 106 |
|
100 | 107 |
String server_text = dataSource.getHost(); |
101 | 108 |
String server_type_text = dataSource.getServerType(); |
... | ... | |
160 | 167 |
" <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+layers_title+"</font></b></td>" + |
161 | 168 |
" </tr>" + layers_html; |
162 | 169 |
String dimension_html = ""; |
163 |
if (dimensions!=null) {
|
|
170 |
if (dimensions != null) {
|
|
164 | 171 |
boolean swap = false; |
165 | 172 |
for (int i = 0; i < dimensions.size(); i++) { |
166 | 173 |
String color = swap ? bgColor0 : bgColor1; |
167 | 174 |
String[] dimension = ((String) dimensions.get(i)).split("="); |
168 | 175 |
dimension_html += |
169 |
" <tr valign=\"top\" bgcolor="+color+">" +
|
|
170 |
" <td width=\"120\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><b>"+dimension[0]+"</b></td>" +
|
|
171 |
" <td width=\"322\" height=\"18\">"+dimension[1]+"</td>" +
|
|
176 |
" <tr valign=\"top\" bgcolor=" + color + ">" +
|
|
177 |
" <td width=\"120\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><b>" + dimension[0] + "</b></td>" +
|
|
178 |
" <td width=\"322\" height=\"18\">" + dimension[1] + "</td>" +
|
|
172 | 179 |
" </tr>"; |
173 | 180 |
swap = !swap; |
174 | 181 |
} |
... | ... | |
176 | 183 |
if (!dimension_html.equals("")) |
177 | 184 |
dimension_html = |
178 | 185 |
" <tr valign=\"top\">" + |
179 |
" <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+selected_dimensions+"</font></b></td>" +
|
|
186 |
" <td width=\"92\" height=\"18\" bgcolor=" + bgColor3 + " colspan=\"2\"><font face=\"" + font + "\" size=\"4\"><b>" + selected_dimensions + "</font></b></td>" +
|
|
180 | 187 |
" </tr>" + dimension_html; |
181 | 188 |
|
182 | 189 |
String format_html = |
183 | 190 |
" <tr valign=\"top\" bgcolor=\"#FFFFFF\">" + |
184 |
" <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+properties+"</font></b></td>" +
|
|
191 |
" <td width=\"92\" height=\"18\" bgcolor=" + bgColor3 + " colspan=\"2\"><font face=\"" + font + "\" size=\"4\"><b>" + properties + "</font></b></td>" +
|
|
185 | 192 |
" </tr>" + |
186 |
" <tr valign=\"top\" bgcolor="+bgColor0+">" +
|
|
187 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+format_title+"</b></font></td>" +
|
|
188 |
" <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+format+"</font></td>" +
|
|
193 |
" <tr valign=\"top\" bgcolor=" + bgColor0 + ">" +
|
|
194 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + format_title + "</b></font></td>" +
|
|
195 |
" <td><font face=\"" + font + "\" size=\"3\"><font face=\"" + font + "\" size=\"3\">" + format + "</font></td>" +
|
|
189 | 196 |
" </tr>" + |
190 |
" <tr valign=\"top\" bgcolor="+bgColor1+">" + |
|
191 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+srs_title+"</font></b></td>" + |
|
192 |
" <td><font face=\""+font+"\" size=\"3\">"+srs+"</font></td>" + |
|
197 |
" <tr valign=\"top\" bgcolor=" + bgColor1 + ">" + |
|
198 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + srs_title + "</font></b></td>" + |
|
199 |
" <td><font face=\"" + font + "\" size=\"3\">" + srs + "</font></td>" + |
|
200 |
" </tr>" + |
|
201 |
" <tr valign=\"top\" bgcolor=" + bgColor0 + ">" + |
|
202 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + infoformat_title + "</font></b></td>" + |
|
203 |
" <td><font face=\"" + font + "\" size=\"3\">" + infoFormat + "</font></td>" + |
|
193 | 204 |
" </tr>"; |
194 | 205 |
|
195 | 206 |
String html = |
... | ... | |
198 | 209 |
"<body>" + |
199 | 210 |
"<table align=\"center\" width=\"437\" height=\"156\" border=\"0\" cellpadding=\"4\" cellspacing=\"4\">" + |
200 | 211 |
" <tr valign=\"top\" bgcolor=\"#FFFFFF\">" + |
201 |
" <td width=\"92\" height=\"18\" bgcolor="+bgColor3+" colspan=\"2\"><font face=\""+font+"\" size=\"4\"><b>"+service_title+"</font></b></td>" +
|
|
212 |
" <td width=\"92\" height=\"18\" bgcolor=" + bgColor3 + " colspan=\"2\"><font face=\"" + font + "\" size=\"4\"><b>"+service_title+"</font></b></td>" +
|
|
202 | 213 |
" </tr>" + |
203 |
" <tr valign=\"top\" bgcolor="+bgColor0+">" +
|
|
204 |
" <td width=\"92\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server+"</font></b></td>" +
|
|
205 |
" <td width=\"268\"><font face=\""+font+"\" size=\"3\">"+server_text+"</font></td>" +
|
|
214 |
" <tr valign=\"top\" bgcolor=" + bgColor0 + ">" +
|
|
215 |
" <td width=\"92\" height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>"+server+"</font></b></td>" +
|
|
216 |
" <td width=\"268\"><font face=\"" + font + "\" size=\"3\">" + server_text + "</font></td>" +
|
|
206 | 217 |
" </tr>" + |
207 |
" <tr valign=\"top\" bgcolor="+bgColor1+">" +
|
|
208 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_type+"</b></font></td>" +
|
|
209 |
" <td><font face=\""+font+"\" size=\"3\">"+server_type_text+"</font></td>" +
|
|
218 |
" <tr valign=\"top\" bgcolor=" + bgColor1 + ">" +
|
|
219 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + server_type + "</b></font></td>" +
|
|
220 |
" <td><font face=\"" + font + "\" size=\"3\">" + server_type_text + "</font></td>" +
|
|
210 | 221 |
" </tr>" + |
211 |
" <tr valign=\"top\" bgcolor="+bgColor0+">" +
|
|
212 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_title+"</b></font></td>" +
|
|
213 |
" <td><font face=\""+font+"\" size=\"3\"><font face=\""+font+"\" size=\"3\">"+server_title_text+"</font></td>" +
|
|
222 |
" <tr valign=\"top\" bgcolor=" + bgColor0 + ">" +
|
|
223 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + server_title + "</b></font></td>" +
|
|
224 |
" <td><font face=\"" + font+ "\" size=\"3\"><font face=\"" + font + "\" size=\"3\">" + server_title_text + "</font></td>" +
|
|
214 | 225 |
" </tr>" + |
215 |
" <tr valign=\"top\" bgcolor="+bgColor1+">" +
|
|
216 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\""+font+"\" size=\"3\"><b>"+server_abstract+"</font></b></td>" +
|
|
217 |
" <td><font face=\""+font+"\" size=\"3\">"+server_abstract_text+"</font></td>" +
|
|
226 |
" <tr valign=\"top\" bgcolor=" + bgColor1 + ">" +
|
|
227 |
" <td height=\"18\" bgcolor=\"#D6D6D6\" align=\"right\"><font face=\"" + font + "\" size=\"3\"><b>" + server_abstract + "</font></b></td>" +
|
|
228 |
" <td><font face=\"" + font + "\" size=\"3\">" + server_abstract_text + "</font></td>" +
|
|
218 | 229 |
" </tr>" + |
219 | 230 |
|
220 | 231 |
" <tr>" + |
org.gvsig.raster.wms/trunk/org.gvsig.raster.wms/org.gvsig.raster.wms.app/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/wizard/WMSWizard.java | ||
---|---|---|
715 | 715 |
public String getFormat() { |
716 | 716 |
return getWMSParamsPanel().getFormat(); |
717 | 717 |
} |
718 |
|
|
719 |
/** |
|
720 |
* DOCUMENT ME! |
|
721 |
* |
|
722 |
* @return DOCUMENT ME! |
|
723 |
*/ |
|
724 |
public String getInfoFormat() { |
|
725 |
return getWMSParamsPanel().getInfoFormat(); |
|
726 |
} |
|
718 | 727 |
|
719 | 728 |
/** |
720 | 729 |
* DOCUMENT ME! |
Also available in: Unified diff