Revision 20869
org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.raster.wms</artifactId> |
|
5 |
<packaging>pom</packaging> |
|
6 |
<version>2.2.229</version> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<description>wms client</description> |
|
9 |
<inceptionYear>2011</inceptionYear> |
|
10 |
|
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.desktop</artifactId> |
|
14 |
<version>2.0.423</version> |
|
15 |
</parent> |
|
16 |
|
|
17 |
<properties> |
|
18 |
<!-- El plugin versions:use-latest-versions falla con scope import --> |
|
19 |
<!-- asi que toca usar el versions:update-properties que si que funciona --> |
|
20 |
<org.gvsig.raster.version>2.2.246</org.gvsig.raster.version> |
|
21 |
</properties> |
|
22 |
|
|
23 |
<repositories> |
|
24 |
<repository> |
|
25 |
<id>gvsig-public-http-repository</id> |
|
26 |
<name>gvSIG maven public HTTP repository</name> |
|
27 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
28 |
<releases> |
|
29 |
<enabled>true</enabled> |
|
30 |
<updatePolicy>daily</updatePolicy> |
|
31 |
<checksumPolicy>warn</checksumPolicy> |
|
32 |
</releases> |
|
33 |
<snapshots> |
|
34 |
<enabled>true</enabled> |
|
35 |
<updatePolicy>daily</updatePolicy> |
|
36 |
<checksumPolicy>warn</checksumPolicy> |
|
37 |
</snapshots> |
|
38 |
</repository> |
|
39 |
</repositories> |
|
40 |
|
|
41 |
<scm> |
|
42 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229</connection> |
|
43 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229</developerConnection> |
|
44 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229</url> |
|
45 |
</scm> |
|
46 |
|
|
47 |
<build> |
|
48 |
<plugins> |
|
49 |
<plugin> |
|
50 |
<groupId>org.apache.maven.plugins</groupId> |
|
51 |
<artifactId>maven-release-plugin</artifactId> |
|
52 |
<configuration> |
|
53 |
<tagBase>https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster.wms/tags/</tagBase> |
|
54 |
<goals>deploy</goals> |
|
55 |
</configuration> |
|
56 |
</plugin> |
|
57 |
</plugins> |
|
58 |
</build> |
|
59 |
|
|
60 |
<dependencyManagement> |
|
61 |
<dependencies> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.raster</artifactId> |
|
65 |
<version>${org.gvsig.raster.version}</version> |
|
66 |
<type>pom</type> |
|
67 |
<scope>import</scope> |
|
68 |
</dependency> |
|
69 |
|
|
70 |
<dependency> |
|
71 |
<groupId>org.gvsig</groupId> |
|
72 |
<artifactId>org.gvsig.raster.wms.io</artifactId> |
|
73 |
<version>2.2.229</version> |
|
74 |
</dependency> |
|
75 |
<dependency> |
|
76 |
<groupId>org.gvsig</groupId> |
|
77 |
<artifactId>org.gvsig.raster.wms.remoteclient</artifactId> |
|
78 |
<version>2.2.229</version> |
|
79 |
</dependency> |
|
80 |
<dependency> |
|
81 |
<groupId>org.gvsig</groupId> |
|
82 |
<artifactId>org.gvsig.raster.wms.app.wmsclient</artifactId> |
|
83 |
<version>2.2.229</version> |
|
84 |
</dependency> |
|
85 |
|
|
86 |
</dependencies> |
|
87 |
</dependencyManagement> |
|
88 |
|
|
89 |
<modules> |
|
90 |
<module>org.gvsig.raster.wms.remoteclient</module> |
|
91 |
<module>org.gvsig.raster.wms.io</module> |
|
92 |
<module>org.gvsig.raster.wms.app.wmsclient</module> |
|
93 |
</modules> |
|
94 |
</project> |
|
95 |
|
|
0 | 96 |
org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229/org.gvsig.raster.wms.app.wmsclient/buildNumber.properties | ||
---|---|---|
1 |
#Mon Jun 19 01:14:48 CEST 2023 |
|
2 |
buildNumber=285 |
|
0 | 3 |
org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/toc/WMSPropsTocMenuEntry.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 |
|
|
23 |
package org.gvsig.raster.wms.app.wmsclient.gui.toc; |
|
24 |
|
|
25 |
import org.gvsig.andami.PluginServices; |
|
26 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
|
27 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
|
28 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
29 |
import org.gvsig.raster.wms.app.wmsclient.gui.dialog.WMSPropsDialog; |
|
30 |
import org.gvsig.raster.wms.app.wmsclient.layer.FLyrWMS; |
|
31 |
|
|
32 |
|
|
33 |
public class WMSPropsTocMenuEntry extends AbstractTocContextMenuAction { |
|
34 |
|
|
35 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
|
36 |
WMSPropsDialog dialog = new WMSPropsDialog(selectedItems[0]); |
|
37 |
PluginServices.getMDIManager().addWindow(dialog); |
|
38 |
} |
|
39 |
|
|
40 |
public String getText() { |
|
41 |
return PluginServices.getText(this, "wms_properties"); |
|
42 |
} |
|
43 |
|
|
44 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
|
45 |
return selectedItems.length == 1 && selectedItems[0].isAvailable(); |
|
46 |
} |
|
47 |
|
|
48 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
|
49 |
if (selectedItems.length != 1) { |
|
50 |
return false; |
|
51 |
} |
|
52 |
return selectedItems[0] instanceof FLyrWMS; |
|
53 |
|
|
54 |
} |
|
55 |
|
|
56 |
} |
|
0 | 57 |
org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/dialog/WMSPropsDialog.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 |
|
|
23 |
package org.gvsig.raster.wms.app.wmsclient.gui.dialog; |
|
24 |
|
|
25 |
import java.awt.Dimension; |
|
26 |
import java.awt.event.ActionEvent; |
|
27 |
import java.awt.event.ActionListener; |
|
28 |
import java.util.HashMap; |
|
29 |
import java.util.List; |
|
30 |
import java.util.Vector; |
|
31 |
|
|
32 |
import javax.swing.JButton; |
|
33 |
import javax.swing.JDialog; |
|
34 |
import javax.swing.JOptionPane; |
|
35 |
import javax.swing.JPanel; |
|
36 |
import javax.swing.tree.TreePath; |
|
37 |
|
|
38 |
import org.gvsig.andami.PluginServices; |
|
39 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
40 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
41 |
import org.gvsig.app.gui.wizards.WizardListener; |
|
42 |
import org.gvsig.app.gui.wizards.WizardListenerSupport; |
|
43 |
import org.gvsig.fmap.dal.coverage.exception.ConnectException; |
|
44 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
45 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
46 |
import org.gvsig.fmap.mapcontext.exceptions.ConnectionErrorLayerException; |
|
47 |
import org.gvsig.fmap.mapcontext.exceptions.DriverLayerException; |
|
48 |
import org.gvsig.fmap.mapcontext.exceptions.LegendLayerException; |
|
49 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
50 |
import org.gvsig.fmap.mapcontext.exceptions.NameLayerException; |
|
51 |
import org.gvsig.fmap.mapcontext.exceptions.ProjectionLayerException; |
|
52 |
import org.gvsig.fmap.mapcontext.exceptions.TypeLayerException; |
|
53 |
import org.gvsig.fmap.mapcontext.exceptions.URLLayerException; |
|
54 |
import org.gvsig.fmap.mapcontext.exceptions.UnsupportedVersionLayerException; |
|
55 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
56 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
57 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
58 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
|
59 |
import org.gvsig.raster.swing.RasterSwingLibrary; |
|
60 |
import org.gvsig.raster.util.CancelTaskImpl; |
|
61 |
import org.gvsig.raster.wms.app.wmsclient.gui.panel.WMSParamsPanel; |
|
62 |
import org.gvsig.raster.wms.app.wmsclient.gui.wizard.LayerTreeModel; |
|
63 |
import org.gvsig.raster.wms.app.wmsclient.layer.FLyrWMS; |
|
64 |
import org.gvsig.raster.wms.io.RemoteWMSStyle; |
|
65 |
import org.gvsig.raster.wms.io.WMSLayerNode; |
|
66 |
import org.gvsig.raster.wms.io.WMSServerExplorer; |
|
67 |
import org.slf4j.Logger; |
|
68 |
import org.slf4j.LoggerFactory; |
|
69 |
|
|
70 |
|
|
71 |
/** |
|
72 |
* The TOC WMS properties panel container. |
|
73 |
* |
|
74 |
* @author jaume - |
|
75 |
* |
|
76 |
*/ |
|
77 |
public class WMSPropsDialog extends JPanel implements IWindow { |
|
78 |
|
|
79 |
private static final long serialVersionUID = 1L; |
|
80 |
private Logger logger = LoggerFactory.getLogger(WMSPropsDialog.class); |
|
81 |
JDialog dlg = null; |
|
82 |
private JPanel buttonsPanel = null; |
|
83 |
private FLyrRaster fLayer = null; |
|
84 |
boolean applied = false;; |
|
85 |
private WindowInfo m_ViewInfo = null; |
|
86 |
|
|
87 |
private JButton btnApply = null; |
|
88 |
private JButton btnOk = null; |
|
89 |
private JButton btnCancel = null; |
|
90 |
private WMSParamsPanel wmsParamsTabbedPane; |
|
91 |
private CommandListener m_actionListener; |
|
92 |
private WMSServerExplorer explorer = null; |
|
93 |
|
|
94 |
public WMSPropsDialog(FLayer layer) { |
|
95 |
super(); |
|
96 |
if(layer instanceof FLyrRaster) |
|
97 |
initialize((FLyrRaster)layer); |
|
98 |
} |
|
99 |
|
|
100 |
|
|
101 |
private void initialize(FLyrRaster layer) { |
|
102 |
setLayout(null); |
|
103 |
|
|
104 |
setFLayer(layer); |
|
105 |
wmsParamsTabbedPane = getParamsPanel(((FLyrWMS) layer).getProperties()); |
|
106 |
wmsParamsTabbedPane.addWizardListener(new WizardListener(){ |
|
107 |
public void wizardStateChanged(boolean finishable) { |
|
108 |
getBtnOk().setEnabled(finishable); |
|
109 |
getBtnApply().setEnabled(finishable); |
|
110 |
} |
|
111 |
|
|
112 |
public void error(Exception e) { |
|
113 |
} |
|
114 |
|
|
115 |
}) ; |
|
116 |
wmsParamsTabbedPane.disableDisagregatedLayers(); |
|
117 |
this.add(wmsParamsTabbedPane); |
|
118 |
this.add(getButtonsPanel(), null); |
|
119 |
|
|
120 |
} |
|
121 |
|
|
122 |
|
|
123 |
public void setFLayer(FLyrRaster f) { |
|
124 |
fLayer = f; |
|
125 |
} |
|
126 |
|
|
127 |
/** |
|
128 |
* With getParamsPanel we have access to the map config TabbedPane. |
|
129 |
* If this panel doesn't exist yet (which can occur when an existing project is |
|
130 |
* recovered) it is been automatically constructed by connecting to the server, |
|
131 |
* reloading the necessary data, filling up the content and setting the selected |
|
132 |
* values that were selected when the projet was saved. |
|
133 |
* |
|
134 |
* |
|
135 |
* Since a connection to the server is needed when rebuiliding the panel, this |
|
136 |
* causes a delay for the panel's showing up or a nullPointer error if there is |
|
137 |
* no path to the server. |
|
138 |
* |
|
139 |
* |
|
140 |
* Con getParamsPanel tenemos acceso a juego de pesta?as de configuraci?n |
|
141 |
* del mapa. Si este panel todav?a no existe (como puede ser cuando |
|
142 |
* recuperamos un proyecto guardado) ?ste se crea autom?ticamente conectando |
|
143 |
* al servidor, recuperando los datos necesarios, rellenando el contenido y |
|
144 |
* dejando seleccionados los valores que estaban seleccionados cuando se |
|
145 |
* guarda el proyecto. |
|
146 |
* |
|
147 |
* |
|
148 |
* Como para reconstruirse requiere una conexi?n con el servidor esto causa |
|
149 |
* un retardo en la aparici?n en el toc o un error de nullPointer si no |
|
150 |
* hay conexi?n hasta el servidor. |
|
151 |
* |
|
152 |
* |
|
153 |
* @return WMSParamsPanel |
|
154 |
*/ |
|
155 |
@SuppressWarnings({ "unchecked" }) |
|
156 |
public WMSParamsPanel getParamsPanel(HashMap info) { |
|
157 |
if (info != null) { |
|
158 |
try { |
|
159 |
if(explorer == null) { |
|
160 |
explorer = ((FLyrWMS)fLayer).getExplorer(); |
|
161 |
|
|
162 |
try { |
|
163 |
explorer.connect(new CancelTaskImpl(), true); |
|
164 |
} catch (ConnectException e) { |
|
165 |
RasterSwingLibrary.messageBoxError("The connection cannot be established", this, e); |
|
166 |
return null; |
|
167 |
} |
|
168 |
} |
|
169 |
} catch (Exception e) { |
|
170 |
explorer = null; |
|
171 |
JOptionPane.showMessageDialog(null, "error_comunicacion_servidor", "Error", JOptionPane.ERROR_MESSAGE); |
|
172 |
} |
|
173 |
try { |
|
174 |
|
|
175 |
// name |
|
176 |
WMSParamsPanel toc = new WMSParamsPanel(); |
|
177 |
toc.setLayerName((String)info.get("name")); |
|
178 |
toc.setWizardData(explorer); |
|
179 |
|
|
180 |
toc.setVisible(true); |
|
181 |
toc.setListenerSupport(new WizardListenerSupport()); |
|
182 |
|
|
183 |
WMSLayerNode[] selectedLayers = (WMSLayerNode[]) ((Vector) info.get("selectedLayers")).toArray(new WMSLayerNode[0]); |
|
184 |
for (int i = 0; i < selectedLayers.length; i++) { |
|
185 |
toc.getJustTreeLayer().clearSelection(); |
|
186 |
// Se a?ade a la lista de layers seleccionados |
|
187 |
TreePath path = new TreePath(((LayerTreeModel)toc.getJustTreeLayer() |
|
188 |
.getModel()).getNodeByName(selectedLayers[i].getName())); |
|
189 |
toc.getJustTreeLayer().addSelectionPath(path); |
|
190 |
toc.addLayer(); |
|
191 |
} |
|
192 |
|
|
193 |
// srs |
|
194 |
String srs = (String) info.get("srs"); |
|
195 |
int index = toc.getSRSIndex( srs ); |
|
196 |
if (index != -1) { |
|
197 |
toc.getLstSRSs().setSelectedIndex(index); |
|
198 |
} |
|
199 |
|
|
200 |
// format |
|
201 |
String format = (String) info.get("format"); |
|
202 |
index = toc.getFormatIndex(format); |
|
203 |
if (index != -1) { |
|
204 |
toc.getLstFormats().setSelectedIndex(index); |
|
205 |
} |
|
206 |
|
|
207 |
//info format |
|
208 |
String infoFormat = (String) info.get("infoformat"); |
|
209 |
index = toc.getInfoFormatIndex(infoFormat); |
|
210 |
if (index != -1) { |
|
211 |
toc.getLstInfoFormats().setSelectedIndex(index); |
|
212 |
} |
|
213 |
|
|
214 |
// transparency |
|
215 |
toc.setTransparent(((Boolean) info.get("wmsTransparency")).booleanValue()); |
|
216 |
|
|
217 |
// styles |
|
218 |
List<RemoteWMSStyle> l = (List<RemoteWMSStyle>) info.get("styles"); |
|
219 |
if (l != null && l.size() > 0) { |
|
220 |
toc.setStyleSelections(l); |
|
221 |
} |
|
222 |
|
|
223 |
// dimensions |
|
224 |
Vector v = (Vector) info.get("dimensions"); |
|
225 |
if (v != null) { |
|
226 |
toc.setDimensions(v); |
|
227 |
} |
|
228 |
|
|
229 |
// fixed sizes |
|
230 |
Dimension sz = (Dimension) info.get("fixedSize"); |
|
231 |
if (sz != null) { |
|
232 |
toc.setFixedSize(sz); |
|
233 |
} |
|
234 |
toc.refreshInfo(); |
|
235 |
applied = false; |
|
236 |
return toc; |
|
237 |
} catch (Exception e) { |
|
238 |
JOptionPane.showMessageDialog(null, "error_comunicacion_servidor", "Error", JOptionPane.ERROR_MESSAGE); |
|
239 |
} |
|
240 |
} |
|
241 |
return null; |
|
242 |
} |
|
243 |
|
|
244 |
|
|
245 |
public JPanel getButtonsPanel() { |
|
246 |
if (buttonsPanel == null) { |
|
247 |
m_actionListener = new CommandListener(this); |
|
248 |
buttonsPanel = new JPanel(); |
|
249 |
buttonsPanel.setBounds(5, wmsParamsTabbedPane.getHeight(), 471, 40); |
|
250 |
buttonsPanel.setLayout(null); |
|
251 |
buttonsPanel.setName("buttonPanel"); |
|
252 |
|
|
253 |
buttonsPanel.add(getBtnOk(), null); |
|
254 |
buttonsPanel.add(getBtnApply(), null); |
|
255 |
buttonsPanel.add(getBtnCancel(), null); |
|
256 |
} |
|
257 |
return buttonsPanel; |
|
258 |
} |
|
259 |
|
|
260 |
public JButton getBtnOk() { |
|
261 |
if (btnOk == null) { |
|
262 |
btnOk = new JButton("ok"); |
|
263 |
btnOk.setText(PluginServices.getText(this,"ok")); |
|
264 |
btnOk.setActionCommand("OK"); |
|
265 |
btnOk.addActionListener(m_actionListener); |
|
266 |
btnOk.setBounds(367, 9, 90, 25); |
|
267 |
} |
|
268 |
return btnOk; |
|
269 |
} |
|
270 |
|
|
271 |
public JButton getBtnApply() { |
|
272 |
if (btnApply == null) { |
|
273 |
btnApply = new JButton("apply"); |
|
274 |
btnApply.setText(PluginServices.getText(this,"apply")); |
|
275 |
btnApply.setEnabled(false); |
|
276 |
btnApply.setActionCommand("APPLY"); |
|
277 |
btnApply.addActionListener(m_actionListener); |
|
278 |
btnApply.setBounds(267, 9, 90, 25); |
|
279 |
} |
|
280 |
return btnApply; |
|
281 |
} |
|
282 |
|
|
283 |
public JButton getBtnCancel() { |
|
284 |
if (btnCancel == null) { |
|
285 |
btnCancel = new JButton("cancel"); |
|
286 |
btnCancel.setText(PluginServices.getText(this,"cancel")); |
|
287 |
btnCancel.setActionCommand("CANCEL"); |
|
288 |
btnCancel.addActionListener(m_actionListener); |
|
289 |
btnCancel.setBounds(137, 9, 90, 25); |
|
290 |
} |
|
291 |
return btnCancel; |
|
292 |
} |
|
293 |
|
|
294 |
private class CommandListener implements ActionListener { |
|
295 |
|
|
296 |
/** |
|
297 |
* Creates a new ComandosListener object. |
|
298 |
* |
|
299 |
* @param lg DOCUMENT ME! |
|
300 |
*/ |
|
301 |
public CommandListener(WMSPropsDialog tp) { |
|
302 |
//m_tp = tp; |
|
303 |
} |
|
304 |
|
|
305 |
@SuppressWarnings({ "unchecked" }) |
|
306 |
public void actionPerformed(ActionEvent e) { |
|
307 |
if (e.getActionCommand() == "CANCEL") { |
|
308 |
close(); |
|
309 |
} else { |
|
310 |
/*try { |
|
311 |
((FLyrWMS) fLayer).setFullExtent(wmsParamsTabbedPane.getLayersRectangle()); |
|
312 |
} catch (ProjectionLayerException ex) { |
|
313 |
ex.printStackTrace(); |
|
314 |
JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), ex.getMessage()); |
|
315 |
return; |
|
316 |
}*/ |
|
317 |
((FLyrWMS) fLayer).getParameters().setFormat(wmsParamsTabbedPane.getFormat()); |
|
318 |
((FLyrWMS) fLayer).getParameters().setInfoFormat(wmsParamsTabbedPane.getInfoFormat()); |
|
319 |
try { |
|
320 |
if (!wmsParamsTabbedPane.getDisagregatedLayers()) { |
|
321 |
((FLyrWMS) fLayer).getParameters().setLayerQuery(wmsParamsTabbedPane.getLayersQuery()); |
|
322 |
} |
|
323 |
((FLyrWMS) fLayer).getParameters().setInfoLayerQuery(wmsParamsTabbedPane.getQueryableLayerQuery()); |
|
324 |
((FLyrWMS) fLayer).getParameters().setSRS(wmsParamsTabbedPane.getSRS()); |
|
325 |
((FLyrWMS) fLayer).getParameters().setName(wmsParamsTabbedPane.getLayerName()); |
|
326 |
((FLyrWMS) fLayer).getParameters().setWmsTransparency(wmsParamsTabbedPane.getTransparency()); |
|
327 |
((FLyrWMS) fLayer).getParameters().setStyles(wmsParamsTabbedPane.getStyles()); |
|
328 |
((FLyrWMS) fLayer).getParameters().setDimensions(wmsParamsTabbedPane.getDimensions()); |
|
329 |
((FLyrWMS) fLayer).getParameters().setFixedSize(wmsParamsTabbedPane.getFixedSize()); |
|
330 |
|
|
331 |
//fLayer = wmsParamsTabbedPane.getLayer(); |
|
332 |
FLayers parent = ((FLayer)fLayer).getParentLayer(); |
|
333 |
|
|
334 |
if (e.getActionCommand() == "APPLY"){ |
|
335 |
MapControl mapCtrl = null; |
|
336 |
|
|
337 |
IWindow[] w = PluginServices.getMDIManager().getAllWindows(); |
|
338 |
for (int i = 0; i < w.length; i++) { |
|
339 |
if (w[i] instanceof org.gvsig.app.project.documents.view.gui.AbstractViewPanel) { |
|
340 |
MapContext mapContext = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl().getMapContext(); |
|
341 |
if(mapContext == fLayer.getMapContext()) |
|
342 |
mapCtrl = ((org.gvsig.app.project.documents.view.gui.AbstractViewPanel)w[i]).getMapControl(); |
|
343 |
} |
|
344 |
} |
|
345 |
|
|
346 |
if (parent != null) { |
|
347 |
if ( wmsParamsTabbedPane.getLayer() instanceof FLayers){ |
|
348 |
mapCtrl.getMapContext().getLayers(). |
|
349 |
replaceLayer(parent.getName(),mergeFLayers(parent,(FLayers)wmsParamsTabbedPane.getLayer())); |
|
350 |
} |
|
351 |
} |
|
352 |
else { |
|
353 |
mapCtrl.getMapContext().getLayers().replaceLayer(fLayer.getName(), wmsParamsTabbedPane.getLayer()); |
|
354 |
} |
|
355 |
//mapCtrl.getMapContext().getLayers().addLayer( fLayer ); |
|
356 |
mapCtrl.getMapContext().invalidate(); |
|
357 |
applied = true; |
|
358 |
getBtnApply().setEnabled(!applied); |
|
359 |
} |
|
360 |
if (e.getActionCommand() == "OK") { |
|
361 |
if (!applied) { |
|
362 |
|
|
363 |
org.gvsig.app.project.documents.view.gui.AbstractViewPanel vista = (org.gvsig.app.project.documents.view.gui.AbstractViewPanel) PluginServices.getMDIManager().getActiveWindow(); |
|
364 |
MapControl mapCtrl = vista.getMapControl(); |
|
365 |
|
|
366 |
if (parent != null){ |
|
367 |
if ( wmsParamsTabbedPane.getLayer() instanceof FLayers){ |
|
368 |
mapCtrl.getMapContext().getLayers(). |
|
369 |
replaceLayer(parent.getName(),mergeFLayers(parent,(FLayers)wmsParamsTabbedPane.getLayer())); |
|
370 |
} |
|
371 |
} |
|
372 |
else { |
|
373 |
mapCtrl.getMapContext().getLayers().replaceLayer(fLayer.getName(), wmsParamsTabbedPane.getLayer()); |
|
374 |
} mapCtrl.getMapContext().invalidate(); |
|
375 |
} |
|
376 |
close(); |
|
377 |
} |
|
378 |
} catch (ConnectionErrorLayerException e1) { |
|
379 |
logger.info("", e1); |
|
380 |
} catch (DriverLayerException e1) { |
|
381 |
logger.info("", e1); |
|
382 |
} catch (LegendLayerException e1) { |
|
383 |
logger.info("", e1); |
|
384 |
} catch (NameLayerException e1) { |
|
385 |
logger.info("", e1); |
|
386 |
} catch (ProjectionLayerException e1) { |
|
387 |
logger.info("", e1); |
|
388 |
} catch (TypeLayerException e1) { |
|
389 |
logger.info("", e1); |
|
390 |
} catch (UnsupportedVersionLayerException e1) { |
|
391 |
logger.info("", e1); |
|
392 |
} catch (URLLayerException e1) { |
|
393 |
logger.info("", e1); |
|
394 |
} catch (LoadLayerException e1) { |
|
395 |
logger.info("", e1); |
|
396 |
} catch (InitializeException e1) { |
|
397 |
logger.info("", e1); |
|
398 |
} |
|
399 |
} |
|
400 |
} |
|
401 |
} |
|
402 |
/** |
|
403 |
* Merge two FLayers in one |
|
404 |
* @param group1 |
|
405 |
* @param group2 |
|
406 |
* @return |
|
407 |
*/ |
|
408 |
private FLayers mergeFLayers(FLayers group1, FLayers group2) |
|
409 |
{ |
|
410 |
//FLayers agrupation = new FLayers(group1.getFMap(), group1.getParentLayer()); |
|
411 |
FLayer layer; |
|
412 |
for(int i = 0; i < group2.getLayersCount(); i++) |
|
413 |
{ |
|
414 |
layer = group2.getLayer( i ); |
|
415 |
if(group1.getLayer( layer.getName()) == null ){ |
|
416 |
group1.addLayer( layer ); |
|
417 |
} |
|
418 |
} |
|
419 |
|
|
420 |
return group1; |
|
421 |
} |
|
422 |
|
|
423 |
|
|
424 |
|
|
425 |
public WindowInfo getWindowInfo() { |
|
426 |
if (m_ViewInfo==null){ |
|
427 |
m_ViewInfo=new WindowInfo(WindowInfo.MODALDIALOG); |
|
428 |
m_ViewInfo.setTitle(PluginServices.getText(this,"fit_WMS_layer")); |
|
429 |
m_ViewInfo.setWidth(wmsParamsTabbedPane.getWidth()+10); |
|
430 |
m_ViewInfo.setHeight(wmsParamsTabbedPane.getHeight()+40); |
|
431 |
|
|
432 |
} |
|
433 |
return m_ViewInfo; |
|
434 |
} |
|
435 |
|
|
436 |
public void close() { |
|
437 |
PluginServices.getMDIManager().closeWindow(this); |
|
438 |
} |
|
439 |
|
|
440 |
|
|
441 |
public Object getWindowProfile() { |
|
442 |
return WindowInfo.DIALOG_PROFILE; |
|
443 |
} |
|
444 |
|
|
445 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
0 | 446 |
org.gvsig.raster.wms/tags/org.gvsig.raster.wms-2.2.229/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/gui/panel/WMSParamsPanel.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 |
|
|
23 |
package org.gvsig.raster.wms.app.wmsclient.gui.panel; |
|
24 |
|
|
25 |
import java.awt.Component; |
|
26 |
import java.awt.Dimension; |
|
27 |
import java.awt.event.FocusAdapter; |
|
28 |
import java.awt.event.FocusEvent; |
|
29 |
import java.awt.event.FocusListener; |
|
30 |
import java.awt.event.MouseAdapter; |
|
31 |
import java.awt.event.MouseEvent; |
|
32 |
import java.lang.reflect.InvocationTargetException; |
|
33 |
import java.net.URI; |
|
34 |
import java.net.URISyntaxException; |
|
35 |
import java.util.AbstractCollection; |
|
36 |
import java.util.ArrayList; |
|
37 |
import java.util.Hashtable; |
|
38 |
import java.util.List; |
|
39 |
import java.util.TreeSet; |
|
40 |
import java.util.Vector; |
|
41 |
import java.util.prefs.Preferences; |
|
42 |
|
|
43 |
import javax.swing.JButton; |
|
44 |
import javax.swing.JCheckBox; |
|
45 |
import javax.swing.JList; |
|
46 |
import javax.swing.JOptionPane; |
|
47 |
import javax.swing.JPanel; |
|
48 |
import javax.swing.JScrollPane; |
|
49 |
import javax.swing.JTabbedPane; |
|
50 |
import javax.swing.JTextField; |
|
51 |
import javax.swing.tree.TreePath; |
|
52 |
|
|
53 |
import org.gvsig.andami.IconThemeHelper; |
|
54 |
import org.gvsig.andami.PluginServices; |
|
55 |
import org.gvsig.andami.messages.NotificationManager; |
|
56 |
import org.gvsig.app.gui.WizardPanel; |
|
57 |
import org.gvsig.app.gui.wizards.FormatListModel; |
|
58 |
import org.gvsig.app.gui.wizards.WizardListenerSupport; |
|
59 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
|
60 |
import org.gvsig.fmap.dal.DALLocator; |
|
61 |
import org.gvsig.fmap.dal.DataManager; |
|
62 |
import org.gvsig.fmap.dal.DataParameters; |
|
63 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
|
64 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
65 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
|
66 |
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters; |
|
67 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
68 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
69 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
70 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
71 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
72 |
import org.gvsig.gui.beans.controls.dnd.JDnDListModel; |
|
73 |
import org.gvsig.gui.beans.listeners.BeanListener; |
|
74 |
import org.gvsig.raster.wms.app.wmsclient.gui.wizard.LayerTreeModel; |
|
75 |
import org.gvsig.raster.wms.app.wmsclient.gui.wizard.SRSListModel; |
|
76 |
import org.gvsig.raster.wms.app.wmsclient.layer.FLyrWMS; |
|
77 |
import org.gvsig.raster.wms.io.RemoteWMSStyle; |
|
78 |
import org.gvsig.raster.wms.io.WMSDataParameters; |
|
79 |
import org.gvsig.raster.wms.io.WMSLayerNode; |
|
80 |
import org.gvsig.raster.wms.io.WMSServerExplorer; |
|
81 |
import org.gvsig.raster.wms.io.WMSServerExplorerParameters; |
|
82 |
import org.gvsig.raster.wms.io.time.RemoteTimeDimension; |
|
83 |
|
|
84 |
|
|
85 |
/** |
|
86 |
* This class implements the map option panel. |
|
87 |
* |
|
88 |
* It includes a set of Listeners that implement some control rules which |
|
89 |
* refresh the component values that depends on those selected in the other |
|
90 |
* components to avoid to choose an invalid set of options. It also includes a |
|
91 |
* method (isCorrectlyConfigured()) that checks if the current set of values is |
|
92 |
* enough to correctly launch a GetMap request. |
|
93 |
* |
|
94 |
* The information is obtained from a WMSWizardDataSource object. |
|
95 |
* |
|
96 |
* |
|
97 |
* Esta clase implementa el panel de opciones disponibles sobre el mapa |
|
98 |
* |
|
99 |
* Incluye una serie de Listeners que implementan unas reglas de control que |
|
100 |
* refrescan los valores de componentes cuyos valores dependen de aqu๏ฟฝllos |
|
101 |
* seleccionados en otros componentes para evitar que se escoja una combinaci๏ฟฝn |
|
102 |
* de opciones err๏ฟฝnea as๏ฟฝ como una funci๏ฟฝn (isCorrectlyConfigured()) que |
|
103 |
* comprueba si la combinaci๏ฟฝn escogida actualmente es suficiente para lanzar |
|
104 |
* una operaci๏ฟฝn GetMap correctamente. |
|
105 |
* |
|
106 |
* La informaci๏ฟฝn obtiene a partir de un objeto WMSWizardDataSource. |
|
107 |
* |
|
108 |
* @author jaume - jaume dominguez faus |
|
109 |
* |
|
110 |
*/ |
|
111 |
@SuppressWarnings("unchecked") |
|
112 |
public class WMSParamsPanel extends WizardPanel { |
|
113 |
private static final long serialVersionUID = 1L; |
|
114 |
private JScrollPane jScrollPane1 = null; |
|
115 |
private JScrollPane jScrollPane2 = null; |
|
116 |
private JScrollPane jScrollPane3 = null; |
|
117 |
private JScrollPane jScrollPane5 = null; |
|
118 |
private JButton btnAdd = null; |
|
119 |
private JButton btnDel = null; |
|
120 |
private JScrollPane jScrollPane6 = null; |
|
121 |
private JPanel jPanel2 = null; |
|
122 |
private JPanel tabFormats = null; |
|
123 |
private JPanel jPanel4 = null; |
|
124 |
private JTextField jTxtNomCapa = null; |
|
125 |
private LayerList lstSelectedLayers = null; |
|
126 |
private ArrayList<TreePath> selectedPaths = new ArrayList<TreePath>(); |
|
127 |
private JList lstSRSs = null; |
|
128 |
private JList lstInfoFormats = null; |
|
129 |
private LayerTree treeLayers = null; |
|
130 |
private JList lstFormats = null; |
|
131 |
private WizardListenerSupport listenerSupport; |
|
132 |
private JTabbedPane jTabbedPane = null; |
|
133 |
private JPanel tabLayers = null; |
|
134 |
private JPanel jPanelFormats = null; |
|
135 |
private JPanel jPanelAxisOrder = null; |
|
136 |
private JPanel jPanelSrsSelection = null; |
|
137 |
private JPanel jPanelInfoByPointFormat = null; |
|
138 |
private StylesPanel tabStyle = null; |
|
139 |
private JCheckBox chkTransparency = null; |
|
140 |
private JCheckBox chkAxisOrder = null; |
|
141 |
private InfoPanel tabInfo = null; |
|
142 |
private DimensionPanel tabDimensions = null; |
|
143 |
private int dimensionTabIndex; |
|
144 |
private int stylesTabIndex; |
|
145 |
private String oldSRS = null; |
|
146 |
private AbstractCollection oldDimensions = null; |
|
147 |
private Dimension sizeFixed; |
|
148 |
private JCheckBox chkExtendedNames = null; |
|
149 |
private JButton btnUp = null; |
|
150 |
private JButton btnDown = null; |
|
151 |
protected WMSServerExplorer explorer = null; |
|
152 |
private boolean updating = fPrefs.getBoolean("refresh_capabilities", false); |
|
153 |
public static Preferences fPrefs = Preferences.userRoot().node("gvsig.wms-wizard"); |
|
154 |
//private Logger log = LoggerFactory.getLogger(WMSParamsPanel.class); |
|
155 |
private JCheckBox chkDisagregate = null; |
|
156 |
private boolean lastCached; |
|
157 |
private String groupName = "WMS Group"; |
|
158 |
|
|
159 |
public WMSParamsPanel() { |
|
160 |
super(); |
|
161 |
initialize(); |
|
162 |
} |
|
163 |
|
|
164 |
// TODO: crear nuevo constructor para a?adir los panels que quieras... |
|
165 |
public WMSParamsPanel(WMSServerExplorer data) { |
|
166 |
super(); |
|
167 |
setWizardData(data); |
|
168 |
this.setLayout(null); |
|
169 |
this.setVisible(false); |
|
170 |
this.setBounds(0, 0, 510, 427); |
|
171 |
if (jTabbedPane == null) { |
|
172 |
jTabbedPane = new JTabbedPane(); |
|
173 |
jTabbedPane.setBounds(4, 4, 502, 415); |
|
174 |
StylesPanel sp = getTabStyle(); |
|
175 |
DimensionPanel dp = getTabDimensions(); |
|
176 |
|
|
177 |
jTabbedPane.addTab(PluginServices.getText(this, "capas"), null, |
|
178 |
getTabLayers(), null); |
|
179 |
jTabbedPane.addTab(PluginServices.getText(this, "estilos"), null, |
|
180 |
sp, null); |
|
181 |
stylesTabIndex = jTabbedPane.getTabCount() - 1; |
|
182 |
jTabbedPane.addTab(PluginServices.getText(this, "dimensiones"), |
|
183 |
null, dp, null); |
|
184 |
dimensionTabIndex = jTabbedPane.getTabCount() - 1; |
|
185 |
jTabbedPane.addTab(PluginServices.getText(this, "formatos"), null, |
|
186 |
getTabFormats(), null); |
|
187 |
jTabbedPane.setEnabledAt(dimensionTabIndex, false); |
|
188 |
jTabbedPane.setEnabledAt(stylesTabIndex, false); |
|
189 |
} |
|
190 |
this.add(jTabbedPane, null); |
|
191 |
|
|
192 |
setListenerSupport(new WizardListenerSupport()); |
|
193 |
} |
|
194 |
|
|
195 |
/** |
|
196 |
* This method initializes panelPage2 |
|
197 |
* |
|
198 |
* @return Panel |
|
199 |
*/ |
|
200 |
private void initialize() { |
|
201 |
this.setLayout(null); |
|
202 |
this.setVisible(false); |
|
203 |
this.setBounds(0, 0, 510, 427); |
|
204 |
this.add(getJTabbedPane(), null); |
|
205 |
} |
|
206 |
|
|
207 |
public boolean isUpdatingCache() { |
|
208 |
return updating; |
|
209 |
} |
|
210 |
|
|
211 |
public void setUpdatingCache(boolean updating) { |
|
212 |
this.updating = updating; |
|
213 |
} |
|
214 |
|
|
215 |
/** |
|
216 |
* This method initializes jPanel2 |
|
217 |
* |
|
218 |
* @return Panel |
|
219 |
*/ |
|
220 |
private JPanel getJPanel2() { |
|
221 |
if (jPanel2 == null) { |
|
222 |
jPanel2 = new JPanel(); |
|
223 |
jPanel2.setLayout(null); |
|
224 |
jPanel2.setBounds(5, 59, 485, 328); |
|
225 |
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
226 |
null, PluginServices.getText(this, "select_layers"), |
|
227 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
228 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
229 |
null)); |
|
230 |
jPanel2.add(getChkExtendedNames(), null); |
|
231 |
|
|
232 |
jPanel2.add(getJScrollPane1(), null); |
|
233 |
jPanel2.add(getBtnDel(), null); |
|
234 |
jPanel2.add(getBtnAdd(), null); |
|
235 |
jPanel2.add(getJScrollPane5(), null); |
|
236 |
jPanel2.add(getBtnUp(), null); |
|
237 |
jPanel2.add(getBtnDown(), null); |
|
238 |
jPanel2.add(getChkDisagregate(), null); |
|
239 |
} |
|
240 |
|
|
241 |
return jPanel2; |
|
242 |
} |
|
243 |
|
|
244 |
/** |
|
245 |
* This method initializes jPanel4 |
|
246 |
* |
|
247 |
* @return Panel |
|
248 |
*/ |
|
249 |
private JPanel getJPanel4() { |
|
250 |
if (jPanel4 == null) { |
|
251 |
jPanel4 = new JPanel(); |
|
252 |
jPanel4.setLayout(null); |
|
253 |
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
254 |
null, PluginServices.getText(this, "layer_name"), |
|
255 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
256 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
257 |
null)); |
|
258 |
jPanel4.setBounds(5, 8, 485, 49); |
|
259 |
jPanel4.add(getJTxtNomCapa(), null); |
|
260 |
} |
|
261 |
|
|
262 |
return jPanel4; |
|
263 |
} |
|
264 |
|
|
265 |
/** |
|
266 |
* This method initializes jPanel3 |
|
267 |
* |
|
268 |
* @return Panel |
|
269 |
*/ |
|
270 |
private JPanel getTabFormats() { |
|
271 |
if (tabFormats == null) { |
|
272 |
tabFormats = new JPanel(); |
|
273 |
tabFormats.setLayout(null); |
|
274 |
tabFormats.add(getJPanelFormats(), null); |
|
275 |
tabFormats.add(getJPanelSrsSelection(), null); |
|
276 |
tabFormats.add(getJPanelInfoByPointFormat(), null); |
|
277 |
} |
|
278 |
|
|
279 |
return tabFormats; |
|
280 |
} |
|
281 |
|
|
282 |
/** |
|
283 |
* This method initializes jScrollPane1 |
|
284 |
* |
|
285 |
* @return ScrollPane |
|
286 |
*/ |
|
287 |
private JScrollPane getJScrollPane1() { |
|
288 |
if (jScrollPane1 == null) { |
|
289 |
jScrollPane1 = new JScrollPane(); |
|
290 |
jScrollPane1.setBounds(11, 22, 460, 123); |
|
291 |
jScrollPane1.setViewportView(getTreeLayers()); |
|
292 |
jScrollPane1.setPreferredSize(new java.awt.Dimension(205, 75)); |
|
293 |
} |
|
294 |
|
|
295 |
return jScrollPane1; |
|
296 |
} |
|
297 |
|
|
298 |
/** |
|
299 |
* This method initializes btnDel |
|
300 |
* |
|
301 |
* @return Button |
|
302 |
*/ |
|
303 |
private JButton getBtnDel() { |
|
304 |
if (btnDel == null) { |
|
305 |
btnDel = new JButton(); |
|
306 |
// btnDel.setPreferredSize(new java.awt.Dimension(23, 23)); |
|
307 |
btnDel.setText(PluginServices.getText(this, "remove")); |
|
308 |
btnDel.setMargin(new java.awt.Insets(2, 0, 2, 0)); |
|
309 |
btnDel.setBounds(339, 300, 101, 20); |
|
310 |
btnDel.setEnabled(false); |
|
311 |
btnDel.addActionListener(new java.awt.event.ActionListener() { |
|
312 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
313 |
delLayer(); |
|
314 |
} |
|
315 |
}); |
|
316 |
} |
|
317 |
return btnDel; |
|
318 |
} |
|
319 |
|
|
320 |
/** |
|
321 |
* This method initializes btnAdd |
|
322 |
* |
|
323 |
* @return Button |
|
324 |
*/ |
|
325 |
private JButton getBtnAdd() { |
|
326 |
if (btnAdd == null) { |
|
327 |
btnAdd = new JButton(); |
|
328 |
// btnAdd.setPreferredSize(new java.awt.Dimension(23, 23)); |
|
329 |
btnAdd.setText(PluginServices.getText(this, "add")); |
|
330 |
btnAdd.setMargin(new java.awt.Insets(2, 0, 2, 0)); |
|
331 |
btnAdd.setBounds(236, 300, 101, 20); |
|
332 |
btnAdd.setEnabled(false); |
|
333 |
btnAdd.addActionListener(new java.awt.event.ActionListener() { |
|
334 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
335 |
addLayer(); |
|
336 |
} |
|
337 |
}); |
|
338 |
} |
|
339 |
return btnAdd; |
|
340 |
} |
|
341 |
|
|
342 |
/** |
|
343 |
* This method initializes jScrollPane5 |
|
344 |
* |
|
345 |
* @return ScrollPane |
|
346 |
*/ |
|
347 |
private JScrollPane getJScrollPane5() { |
|
348 |
if (jScrollPane5 == null) { |
|
349 |
jScrollPane5 = new JScrollPane(); |
|
350 |
jScrollPane5.setBounds(11, 155, 422, 120); |
|
351 |
jScrollPane5.setViewportView(getLstSelectedLayers()); |
|
352 |
jScrollPane5.setPreferredSize(new java.awt.Dimension(205, 75)); |
|
353 |
} |
|
354 |
|
|
355 |
return jScrollPane5; |
|
356 |
} |
|
357 |
|
|
358 |
/** |
|
359 |
* This method initializes jTextField |
|
360 |
* |
|
361 |
* @return TextField |
|
362 |
*/ |
|
363 |
private JTextField getJTxtNomCapa() { |
|
364 |
if (jTxtNomCapa == null) { |
|
365 |
jTxtNomCapa = new JTextField(); |
|
366 |
jTxtNomCapa.setBounds(10, 19, 460, 20); |
|
367 |
jTxtNomCapa.setText(PluginServices.getText(this, "WMSLayer")); |
|
368 |
jTxtNomCapa.addKeyListener(new java.awt.event.KeyAdapter() { |
|
369 |
public void keyTyped(java.awt.event.KeyEvent e) { |
|
370 |
fireWizardComplete(isCorrectlyConfigured()); |
|
371 |
} |
|
372 |
}); |
|
373 |
} |
|
374 |
|
|
375 |
return jTxtNomCapa; |
|
376 |
} |
|
377 |
|
|
378 |
/** |
|
379 |
* This method initializes jPanel1 |
|
380 |
* |
|
381 |
* @return Panel |
|
382 |
*/ |
|
383 |
private JPanel getJPanelFormats() { |
|
384 |
if (jPanelFormats == null) { |
|
385 |
jPanelFormats = new JPanel(); |
|
386 |
jPanelFormats.setLayout(null); |
|
387 |
jPanelFormats.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
388 |
null, PluginServices.getText(this, "select_formats"), |
|
389 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
390 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
391 |
null)); |
|
392 |
jPanelFormats.setBounds(5, 10, 485, 145); |
|
393 |
jPanelFormats.add(getJScrollPaneFormats(), null); |
|
394 |
jPanelFormats.add(getChkTransparency(), null); |
|
395 |
} |
|
396 |
return jPanelFormats; |
|
397 |
} |
|
398 |
|
|
399 |
/** |
|
400 |
* This method initializes jPanel5 |
|
401 |
* |
|
402 |
* @return Panel |
|
403 |
*/ |
|
404 |
private JPanel getJPanelSrsSelection() { |
|
405 |
if (jPanelSrsSelection == null) { |
|
406 |
jPanelSrsSelection = new JPanel(); |
|
407 |
jPanelSrsSelection.setLayout(null); |
|
408 |
jPanelSrsSelection.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
409 |
null, PluginServices.getText(this, "seleccionar_srs"), |
|
410 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
411 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
412 |
null)); |
|
413 |
jPanelSrsSelection.setBounds(5, 162, 485, 126); |
|
414 |
jPanelSrsSelection.add(getJScrollPane2(), null); |
|
415 |
} |
|
416 |
return jPanelSrsSelection; |
|
417 |
} |
|
418 |
|
|
419 |
/** |
|
420 |
* This method initializes jPanel6 |
|
421 |
* |
|
422 |
* @return Panel |
|
423 |
*/ |
|
424 |
private JPanel getJPanelInfoByPointFormat() { |
|
425 |
if (jPanelInfoByPointFormat == null) { |
|
426 |
jPanelInfoByPointFormat = new JPanel(); |
|
427 |
jPanelInfoByPointFormat.setLayout(null); |
|
428 |
jPanelInfoByPointFormat.setBorder(javax.swing.BorderFactory.createTitledBorder( |
|
429 |
null, PluginServices.getText(this, "seleccionar_infobypoint_format"), |
|
430 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
|
431 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, |
|
432 |
null)); |
|
433 |
jPanelInfoByPointFormat.setBounds(5, 273, 485, 78); |
|
434 |
jPanelInfoByPointFormat.add(getJScrollPane3(), null); |
|
435 |
} |
|
436 |
return jPanelInfoByPointFormat; |
|
437 |
} |
|
438 |
|
|
439 |
/** |
|
440 |
* This method initializes jScrollPane6 |
|
441 |
* |
|
442 |
* @return ScrollPane |
|
443 |
*/ |
|
444 |
private JScrollPane getJScrollPaneFormats() { |
|
445 |
if (jScrollPane6 == null) { |
|
446 |
jScrollPane6 = new JScrollPane(); |
|
447 |
jScrollPane6.setBounds(5, 23, 470, 85); |
|
448 |
jScrollPane6.setViewportView(getLstFormats()); |
|
449 |
jScrollPane6.setPreferredSize(new java.awt.Dimension(250, 85)); |
|
450 |
} |
|
451 |
|
|
452 |
return jScrollPane6; |
|
453 |
} |
|
454 |
|
|
455 |
|
|
456 |
/** |
|
457 |
* This method initializes chkTrasparency |
|
458 |
* |
|
459 |
* @return CheckBox |
|
460 |
*/ |
|
461 |
private JCheckBox getChkTransparency() { |
|
462 |
if (chkTransparency == null) { |
|
463 |
chkTransparency = new JCheckBox(); |
|
464 |
chkTransparency.setText(PluginServices.getText(this, |
|
465 |
"wms_transparency")); |
|
466 |
chkTransparency.setSelected(true); |
|
467 |
chkTransparency.addItemListener(new java.awt.event.ItemListener() { |
|
468 |
public void itemStateChanged(java.awt.event.ItemEvent e) { |
|
469 |
fireWizardComplete(isCorrectlyConfigured()); |
|
470 |
} |
|
471 |
}); |
|
472 |
chkTransparency.setBounds(15, 115, 421, 21); |
|
473 |
chkTransparency.setVisible(true); |
|
474 |
} |
|
475 |
return chkTransparency; |
|
476 |
} |
|
477 |
|
|
478 |
/** |
|
479 |
* This method initializes jScrollPane2 |
|
480 |
* |
|
481 |
* @return ScrollPane |
|
482 |
*/ |
|
483 |
private JScrollPane getJScrollPane2() { |
|
484 |
if (jScrollPane2 == null) { |
|
485 |
jScrollPane2 = new JScrollPane(); |
|
486 |
jScrollPane2.setBounds(5, 23, 470, 91); |
|
487 |
jScrollPane2.setViewportView(getLstSRSs()); |
|
488 |
jScrollPane2.setPreferredSize(new java.awt.Dimension(250, 91)); |
|
489 |
} |
|
490 |
|
|
491 |
return jScrollPane2; |
|
492 |
} |
|
493 |
|
|
494 |
/** |
|
495 |
* This method initializes jScrollPane3 |
|
496 |
* |
|
497 |
* @return ScrollPane |
|
498 |
*/ |
|
499 |
private JScrollPane getJScrollPane3() { |
|
500 |
if (jScrollPane3 == null) { |
|
501 |
jScrollPane3 = new JScrollPane(); |
|
502 |
jScrollPane3.setBounds(5, 23, 470, 45); |
|
503 |
jScrollPane3.setViewportView(getLstInfoFormats()); |
|
504 |
jScrollPane3.setPreferredSize(new java.awt.Dimension(250, 120)); |
|
505 |
} |
|
506 |
|
|
507 |
return jScrollPane3; |
|
508 |
} |
|
509 |
|
|
510 |
/** |
|
511 |
* Gets the available layers in WMS maintaining the tree structure |
|
512 |
* |
|
513 |
* @return |
|
514 |
*/ |
|
515 |
public LayerTree getLayerStructure() { |
|
516 |
return treeLayers; |
|
517 |
} |
|
518 |
|
|
519 |
/** |
|
520 |
* This method initializes treeLayers |
|
521 |
* |
|
522 |
* @return Tree |
|
523 |
*/ |
|
524 |
private LayerTree getTreeLayers() { |
|
525 |
if (treeLayers == null) { |
|
526 |
treeLayers = new LayerTree(); |
|
527 |
treeLayers.setRootVisible(true); |
|
528 |
treeLayers.addMouseListener(new java.awt.event.MouseAdapter() { |
|
529 |
public void mouseClicked(java.awt.event.MouseEvent e) { |
|
530 |
if (e.getClickCount() == 2) { |
|
531 |
addLayer(); |
|
532 |
} |
|
533 |
} |
|
534 |
}); |
|
535 |
treeLayers |
|
536 |
.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() { |
|
537 |
public void valueChanged( |
|
538 |
javax.swing.event.TreeSelectionEvent e) { |
|
539 |
|
|
540 |
boolean isGetMapable = false; |
|
541 |
TreePath[] selecciones = getTreeLayers() |
|
542 |
.getSelectionPaths(); |
|
543 |
if (selecciones != null) { |
|
544 |
for (int i = 0; i < selecciones.length |
|
545 |
&& !isGetMapable; i++) { |
|
546 |
WMSLayerNode layer = ((WMSLayerNode) selecciones[i] |
|
547 |
.getLastPathComponent()); |
|
548 |
isGetMapable = layer.getChildren().size() == 0 |
|
549 |
|| layer.getName() != null; |
|
550 |
} |
|
551 |
|
|
552 |
} |
|
553 |
getBtnAdd().setEnabled(isGetMapable); |
|
554 |
fireWizardComplete(isCorrectlyConfigured()); |
|
555 |
} |
|
556 |
}); |
|
557 |
} |
|
558 |
|
|
559 |
return treeLayers; |
|
560 |
} |
|
561 |
|
|
562 |
/** |
|
563 |
* This method checks for the options selected within the configuration |
|
564 |
* dialog are correct and enough to perform a GetMap request. |
|
565 |
* |
|
566 |
* @return true if you're done, false if not. |
|
567 |
*/ |
|
568 |
public boolean isCorrectlyConfigured() { |
|
569 |
|
|
570 |
boolean b; |
|
571 |
this.repaint(); |
|
572 |
boolean infoFormatOk = ((getLstInfoFormats().getModel().getSize()!= 0 && |
|
573 |
getLstInfoFormats().getSelectedIndex() != -1) || |
|
574 |
getLstInfoFormats().getModel().getSize() == 0); |
|
575 |
if ((getLstSRSs().getSelectedIndex() != -1) |
|
576 |
&& (getLstFormats().getSelectedIndex() != -1) |
|
577 |
&& infoFormatOk |
|
578 |
&& (getLstSelectedLayers().getModel().getSize() > 0)) { |
|
579 |
b = true; |
|
580 |
} else { |
|
581 |
b = false; |
|
582 |
} |
|
583 |
|
|
584 |
// Enable or disable del button. |
|
585 |
int[] selectedIndices = getLstSelectedLayers().getSelectedIndices(); |
|
586 |
|
|
587 |
getBtnDel().setEnabled(selectedIndices != null && selectedIndices.length > 0); |
|
588 |
|
|
589 |
return b; |
|
590 |
} |
|
591 |
|
|
592 |
public WMSLayerNode[] selectedLayersToArray() { |
|
593 |
JDnDListModel modelo = ((JDnDListModel) lstSelectedLayers.getModel()); |
|
594 |
ArrayList elements = modelo.getElements(); |
|
595 |
WMSLayerNode[] layers = (WMSLayerNode[]) elements |
|
596 |
.toArray(new WMSLayerNode[0]); |
|
597 |
return layers; |
|
598 |
} |
|
599 |
|
|
600 |
/** |
|
601 |
* DOCUMENT ME! |
|
602 |
*/ |
|
603 |
private void delLayer() { |
|
604 |
int[] indices = lstSelectedLayers.getSelectedIndices(); |
|
605 |
|
|
606 |
try { |
|
607 |
ArrayList removeList = new ArrayList(); |
|
608 |
WMSLayerNode[] infos = selectedLayersToArray(); |
|
609 |
JDnDListModel modelo = ((JDnDListModel) lstSelectedLayers |
|
610 |
.getModel()); |
|
611 |
for (int i = 0; i < indices.length; i++) { |
|
612 |
removeList.add(infos[indices[i]]); |
|
613 |
} |
|
614 |
modelo.delIndices(indices); |
|
615 |
lstSelectedLayers.clearSelection(); |
|
616 |
fireWizardComplete(isCorrectlyConfigured()); |
|
617 |
|
|
618 |
// delete from selectedPaths as well |
|
619 |
WMSLayerNode elemento = null; |
|
620 |
WMSLayerNode last = null; |
|
621 |
TreePath path = null; |
|
622 |
for (int i = removeList.size() - 1; i >= 0; i--) { |
|
623 |
elemento = (WMSLayerNode) removeList.get(i); |
|
624 |
for (int j = 0; j < selectedPaths.size(); j++) { |
|
625 |
path = (TreePath) selectedPaths.get(j); |
|
626 |
last = (WMSLayerNode) path.getLastPathComponent(); |
|
627 |
if (last.getTitle().compareTo(elemento.getTitle()) == 0) { |
|
628 |
selectedPaths.remove(path); |
|
629 |
} |
|
630 |
} |
|
631 |
} |
|
632 |
|
|
633 |
refreshData(); |
|
634 |
refreshInfo(); |
|
635 |
} catch (ArrayIndexOutOfBoundsException ex) { |
|
636 |
// if you reach this, please, tell me how you did it. |
|
637 |
ex.printStackTrace(); |
|
638 |
} |
|
639 |
} |
|
640 |
|
|
641 |
/** |
|
642 |
* Fires a notification to this wizard listeners telling them if the |
|
643 |
* configuration is fair enough to send a GetMap request. |
|
644 |
* |
|
645 |
* @param b |
|
646 |
*/ |
|
647 |
private void fireWizardComplete(boolean b) { |
|
648 |
listenerSupport.callStateChanged(b); |
|
649 |
callStateChanged(b); |
|
650 |
} |
|
651 |
|
|
652 |
/** |
|
653 |
* Refreshes the content shown by this. |
|
654 |
*/ |
|
655 |
public void refreshData() { |
|
656 |
JDnDListModel model = (JDnDListModel) lstSelectedLayers.getModel(); |
|
657 |
if(model.getSize() > 1) |
|
658 |
setLayerName(groupName); |
|
659 |
else if(model.getSize() == 1) |
|
660 |
setLayerName(model.getElementAt(0).toString()); |
|
661 |
else |
|
662 |
setLayerName(PluginServices.getText(this, "WMSLayer")); |
|
663 |
refreshSRS(); |
|
664 |
getLstSelectedLayers().repaint(); |
|
665 |
refreshStyleTree(); |
|
666 |
refreshDimensions(); |
|
667 |
|
|
668 |
} |
|
669 |
|
|
670 |
/** |
|
671 |
* Refreshes the info tab |
|
672 |
* |
|
673 |
*/ |
|
674 |
public void refreshInfo() { |
|
675 |
getTabInfo().refresh(explorer, selectedLayersVector(), |
|
676 |
getStyleTitles(), getFormat(), getInfoFormat(), getSRS(), getDimensions()); |
|
677 |
} |
|
678 |
|
|
679 |
private void refreshDimensions() { |
|
680 |
int size = getLstSelectedLayers().getModel().getSize(); |
|
681 |
boolean enable = false; |
|
682 |
for (int i = 0; i < size; i++) { |
|
683 |
WMSLayerNode node = (WMSLayerNode) getLstSelectedLayers() |
|
684 |
.getModel().getElementAt(i); |
|
685 |
if (node.getDimensions() == null) { |
|
686 |
continue; |
|
687 |
} |
|
688 |
|
|
689 |
for (int j = 0; j < node.getDimensions().size(); j++) { |
|
690 |
RemoteTimeDimension dim = (RemoteTimeDimension) node |
|
691 |
.getDimensions().get(j); |
|
692 |
|
|
693 |
try { |
|
694 |
getTabDimensions().addDimension(dim); |
|
695 |
enable = true; |
|
696 |
} catch (IllegalArgumentException e) { |
|
697 |
NotificationManager.addWarning( |
|
698 |
"Unrecognized dimension expression: " |
|
699 |
+ dim.getExpression() + " (for " |
|
700 |
+ dim.getName() + " in layer '" |
|
701 |
+ node.getName() + "')", null); |
|
702 |
} |
|
703 |
} |
|
704 |
} |
|
705 |
jTabbedPane.setEnabledAt(dimensionTabIndex, enable); |
|
706 |
|
|
707 |
} |
|
708 |
|
|
709 |
/** |
|
710 |
* |
|
711 |
*/ |
|
712 |
private void refreshStyleTree() { |
|
713 |
|
|
714 |
int size = getLstSelectedLayers().getModel().getSize(); |
|
715 |
WMSLayerNode styleRoot = new WMSLayerNode(); |
|
716 |
styleRoot.setTitle(PluginServices.getText(this, "selected_layers")); |
|
717 |
|
|
718 |
StyleTreeModel model = new StyleTreeModel(styleRoot); |
|
719 |
jTabbedPane.setEnabledAt(stylesTabIndex, false); |
|
720 |
for (int i = 0; i < size; i++) { |
|
721 |
WMSLayerNode node = (WMSLayerNode) getLstSelectedLayers() |
|
722 |
.getModel().getElementAt(i); |
|
723 |
// If any of the layers defines styles, the tab will be enabled. |
|
724 |
if (model.addLayerBranch(node)) { |
|
725 |
jTabbedPane.setEnabledAt(stylesTabIndex, true); |
|
726 |
} |
|
727 |
} |
|
728 |
|
|
729 |
getStyleTree().setModel(model); |
|
730 |
getStyleTree().expandAll(); |
|
731 |
getStyleTree().repaint(); |
|
732 |
} |
|
733 |
|
|
734 |
/** |
|
735 |
* Takes the array of selected layers and a vector containing the style |
|
736 |
* names and set them as selected in the styles panel |
|
737 |
* |
|
738 |
* @param selectedLayers |
|
739 |
* @param styles |
|
740 |
*/ |
|
741 |
public void setStyleSelections(List<RemoteWMSStyle> styles) { |
|
742 |
|
|
743 |
WMSLayerNode[] layers = selectedLayersToArray(); |
|
744 |
int length = layers.length; |
|
745 |
for (int i = 0; i < length; i++) { |
|
746 |
String styleName = styles.get(i).getName(); |
|
747 |
layers[length - i - 1].setSelectedStyleByName(styleName); |
|
748 |
} |
|
749 |
} |
|
750 |
|
|
751 |
/** |
|
752 |
* Gets the currently shown style tree. |
|
753 |
* |
|
754 |
* @return |
|
755 |
*/ |
|
756 |
private StyleTree getStyleTree() { |
|
757 |
return getTabStyle().getStyleTree(); |
|
758 |
} |
|
759 |
|
|
760 |
/** |
|
761 |
* Method called when pressing the Add layer button or when double-clicking |
|
762 |
* on a layer from the server's layer tree. |
|
763 |
*/ |
|
764 |
public void addLayer() { |
|
765 |
boolean alguno = false; |
|
766 |
|
|
767 |
TreePath[] selecciones = getTreeLayers().getSelectionPaths(); |
|
768 |
if (selecciones == null) { |
|
769 |
return; |
|
770 |
} |
|
771 |
for (int i = 0; i < selecciones.length; i++) { |
|
772 |
selectedPaths.add(selecciones[i]); |
|
773 |
WMSLayerNode nodo = (WMSLayerNode) selecciones[i] |
|
774 |
.getLastPathComponent(); |
|
775 |
if (nodo.getName() == null || nodo.getName().equals("")) { |
|
776 |
continue; |
|
777 |
} |
|
778 |
if (nodo.isSizeFixed()) { |
|
779 |
if (sizeFixed == null) { |
|
780 |
sizeFixed = nodo.getFixedSize(); |
|
781 |
} else if ((sizeFixed.getHeight() != nodo.getFixedSize() |
|
782 |
.getHeight()) |
|
783 |
|| (sizeFixed.getWidth() != nodo.getFixedSize() |
|
784 |
.getWidth())) { |
|
785 |
JOptionPane.showMessageDialog((Component) PluginServices |
|
786 |
.getMainFrame(), PluginServices.getText(this, |
|
787 |
"server_cant_render_layers")); |
|
788 |
continue; |
|
789 |
} |
|
790 |
} |
|
791 |
// s'afegeix a la llista de capes seleccionades |
|
792 |
JDnDListModel modelo = (JDnDListModel) lstSelectedLayers.getModel(); |
|
793 |
|
|
794 |
try { |
|
795 |
if (modelo.addElement(modelo.getSize(), nodo.clone())) { |
|
796 |
alguno = true; |
|
797 |
} |
|
798 |
} catch (CloneNotSupportedException e) { |
|
799 |
} |
|
800 |
} |
|
801 |
|
|
802 |
if (alguno) { |
|
803 |
refreshData(); |
|
804 |
} |
|
805 |
refreshInfo(); |
|
806 |
} |
|
807 |
|
|
808 |
/** |
|
809 |
* This method initializes lstSelectedLayers |
|
810 |
* |
|
811 |
* @return List |
|
812 |
*/ |
|
813 |
public LayerList getLstSelectedLayers() { |
|
814 |
if (lstSelectedLayers == null) { |
|
815 |
lstSelectedLayers = new LayerList(); |
|
816 |
lstSelectedLayers.setModel(new JDnDListModel()); |
|
817 |
lstSelectedLayers |
|
818 |
.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); |
|
819 |
lstSelectedLayers |
|
820 |
.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
821 |
public void valueChanged( |
|
822 |
javax.swing.event.ListSelectionEvent e) { |
|
823 |
fireWizardComplete(isCorrectlyConfigured()); |
|
824 |
} |
|
825 |
}); |
|
826 |
lstSelectedLayers.addMouseListener(new MouseAdapter() { |
|
827 |
public void mouseReleased(MouseEvent e) { |
|
828 |
refreshData(); |
|
829 |
} |
|
830 |
}); |
|
831 |
} |
|
832 |
|
|
833 |
return lstSelectedLayers; |
|
834 |
} |
|
835 |
|
|
836 |
/** |
|
837 |
* This method initializes lstSRSs |
|
838 |
* |
|
839 |
* @return JList |
|
840 |
*/ |
|
841 |
public JList getLstSRSs() { |
|
842 |
if (lstSRSs == null) { |
|
843 |
lstSRSs = new JList(); |
|
844 |
lstSRSs.setModel(new SRSListModel()); |
|
845 |
lstSRSs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
|
846 |
lstSRSs.addListSelectionListener(new javax.swing.event.ListSelectionListener() { |
|
847 |
public void valueChanged(javax.swing.event.ListSelectionEvent e) { |
|
848 |
int i = lstSRSs.getSelectedIndex(); |
|
849 |
if (i != -1) { |
|
850 |
oldSRS = (String) lstSRSs.getModel().getElementAt(i); |
|
851 |
} |
|
852 |
fireWizardComplete(isCorrectlyConfigured()); |
|
853 |
} |
|
854 |
}); |
Also available in: Unified diff