svn-gvsig-desktop / trunk / extensions / extCatalogAndGazetteer / src / es / gva / cit / gvsig / catalog / gui / ShowResultsDialog.java @ 15557
History | View | Annotate | Download (4.18 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package es.gva.cit.gvsig.catalog.gui; |
42 |
|
43 |
import java.awt.Frame; |
44 |
import java.util.Collection; |
45 |
|
46 |
import javax.swing.JDialog; |
47 |
import javax.swing.JOptionPane; |
48 |
|
49 |
import org.gvsig.i18n.Messages; |
50 |
|
51 |
import com.iver.andami.PluginServices; |
52 |
import com.iver.andami.ui.mdiManager.IWindow; |
53 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
54 |
|
55 |
import es.gva.cit.catalog.CatalogClient; |
56 |
import es.gva.cit.catalog.drivers.GetRecordsReply; |
57 |
import es.gva.cit.catalog.metadataxml.XMLNode; |
58 |
import es.gva.cit.catalog.schemas.Record; |
59 |
import es.gva.cit.catalog.schemas.Resource; |
60 |
import es.gva.cit.catalog.ui.showresults.ShowResultsDialogPanel; |
61 |
import es.gva.cit.catalog.utils.Frames; |
62 |
|
63 |
|
64 |
/**
|
65 |
* DOCUMENT ME!
|
66 |
*
|
67 |
* @author luisw
|
68 |
*/
|
69 |
public class ShowResultsDialog extends ShowResultsDialogPanel implements IWindow { |
70 |
private JDialog frame = null; |
71 |
/**
|
72 |
* DOCUMENT ME!
|
73 |
*
|
74 |
* @param client
|
75 |
* @param nodes
|
76 |
* @param currentRecord
|
77 |
*/
|
78 |
public ShowResultsDialog(JDialog frame,CatalogClient client, GetRecordsReply recordsReply, |
79 |
int currentRecord) {
|
80 |
super(client, recordsReply, currentRecord);
|
81 |
this.frame = frame;
|
82 |
} |
83 |
|
84 |
/**
|
85 |
* DOCUMENT ME!
|
86 |
*/
|
87 |
public void descriptionButtonActionPerformed() { |
88 |
Record record = recordsReply.getRecordAt(getCurrentNode()); |
89 |
if (record == null){ |
90 |
return;
|
91 |
} |
92 |
XMLNode node = record.getNode(); |
93 |
if (node == null){ |
94 |
JOptionPane.showMessageDialog(this,Messages.getText("Error_accediendo_a_los_datos")); |
95 |
}else{
|
96 |
|
97 |
JDialog panel = new JDialog((Frame) PluginServices.getMainFrame(), false); |
98 |
Frames.centerFrame(panel, 796, 675); |
99 |
//panel.setBounds(0, 0, 796, 675);
|
100 |
panel.setTitle(Messages.getText("metadata_tree"));
|
101 |
panel.setResizable(false);
|
102 |
|
103 |
ShowTreeDialog dialog = new ShowTreeDialog(panel,node);
|
104 |
|
105 |
panel.getContentPane().add(dialog); |
106 |
panel.show(); |
107 |
} |
108 |
|
109 |
// PluginServices.getMDIManager().addView(dialog);
|
110 |
} |
111 |
|
112 |
/**
|
113 |
* DOCUMENT ME!
|
114 |
*/
|
115 |
public void mapButtonActionPerformed() { |
116 |
Resource[] resources = controlsPanel.getRecord().getResources();
|
117 |
Collection col = new java.util.ArrayList(); |
118 |
for (int i=0 ; i<resources.length ;i++){ |
119 |
col.add(resources[i]); |
120 |
} |
121 |
ChooseResourceDialog dialog = new ChooseResourceDialog(col);
|
122 |
dialog.setBounds(0, 0, 586, 145); |
123 |
dialog.setName(Messages.getText("Recursos Disponibles"));
|
124 |
dialog.setVisible(true);
|
125 |
PluginServices.getMDIManager().addWindow(dialog); |
126 |
} |
127 |
|
128 |
/**
|
129 |
* DOCUMENT ME!
|
130 |
*/
|
131 |
public void closeButtonActionPerformed() { |
132 |
closeJDialog(); |
133 |
} |
134 |
|
135 |
/**
|
136 |
* Cierra el Dialog
|
137 |
*/
|
138 |
public void closeJDialog() { |
139 |
frame.setVisible(false);
|
140 |
} |
141 |
|
142 |
/* (non-Javadoc)
|
143 |
* @see com.iver.andami.ui.mdiManager.View#getViewInfo()
|
144 |
*/
|
145 |
public WindowInfo getWindowInfo() {
|
146 |
WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
|
147 |
m_viewinfo.setTitle(getName()); |
148 |
|
149 |
return m_viewinfo;
|
150 |
} |
151 |
} |