Statistics
| Revision:

root / tags / v1_0_2_Build_916 / extensions / extCatalogYNomenclator / src / es / gva / cit / gvsig / catalogClient / gui / ShowResultsDialog.java @ 12327

History | View | Annotate | Download (4.06 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.catalogClient.gui;
42

    
43
import java.awt.Component;
44
import java.awt.Frame;
45
import java.util.Collection;
46

    
47
import javax.swing.JDialog;
48
import javax.swing.JOptionPane;
49

    
50
import org.gvsig.i18n.Messages;
51

    
52
import com.iver.andami.PluginServices;
53
import com.iver.andami.ui.mdiManager.IWindow;
54
import com.iver.andami.ui.mdiManager.WindowInfo;
55

    
56
import es.gva.cit.catalogClient.CatalogClient;
57
import es.gva.cit.catalogClient.metadataXML.XMLNode;
58
import es.gva.cit.catalogClient.schemas.discoverer.Resource;
59
import es.gva.cit.catalogClient.ui.showResults.ShowResultsDialogPanel;
60
import es.gva.cit.catalogClient.utils.Frames;
61

    
62

    
63
/**
64
 * DOCUMENT ME!
65
 *
66
 * @author luisw
67
 */
68
public class ShowResultsDialog extends ShowResultsDialogPanel implements IWindow {
69
    private JDialog frame = null;
70
    /**
71
     * DOCUMENT ME!
72
     *
73
     * @param client
74
     * @param nodes
75
     * @param currentRecord
76
     */
77
    public ShowResultsDialog(JDialog frame,CatalogClient client, Collection nodes,
78
        int currentRecord) {
79
        super(client, nodes, currentRecord);
80
        this.frame = frame;
81
    }
82

    
83
    /**
84
     * DOCUMENT ME!
85
     */
86
    public void descriptionButtonActionPerformed() {
87
            XMLNode node = (XMLNode)nodes.toArray()[getCurrentNode()];
88
            if (node == null){
89
                    JOptionPane.showMessageDialog(this,Messages.getText("Error_accediendo_a_los_datos"));
90
            }else{
91
                    
92
                    JDialog panel = new JDialog((Frame) PluginServices.getMainFrame(), false);
93
                    Frames.centerFrame(panel, 796, 675);
94
                    //panel.setBounds(0, 0, 796, 675);
95
                    panel.setTitle(Messages.getText("metadata_tree"));
96
                    panel.setResizable(false);
97
                    
98
                    ShowTreeDialog dialog = new ShowTreeDialog(panel,node);
99
                    
100
                    panel.getContentPane().add(dialog);
101
                    panel.show();
102
            }
103
        
104
//        PluginServices.getMDIManager().addView(dialog);
105
    }
106

    
107
    /**
108
     * DOCUMENT ME!
109
     */
110
    public void mapButtonActionPerformed() {
111
        Resource[] resources = controlsPanel.getTags().getResources();
112
        Collection col = new java.util.ArrayList();
113
        for (int i=0 ; i<resources.length ;i++){
114
            col.add(resources[i]);
115
        }
116
        ChooseResourceDialog dialog = new ChooseResourceDialog(col);
117
        dialog.setBounds(0, 0, 586, 145);
118
        dialog.setName(Messages.getText("Recursos Disponibles"));
119
        dialog.setVisible(true);
120
        PluginServices.getMDIManager().addWindow(dialog);
121
    }
122

    
123
    /**
124
     * DOCUMENT ME!
125
     */
126
    public void closeButtonActionPerformed() {
127
        closeJDialog();
128
    }
129

    
130
    /**
131
     * Cierra el Dialog
132
     */
133
    public void closeJDialog() {
134
        frame.setVisible(false);
135
    }
136

    
137
    /* (non-Javadoc)
138
     * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
139
     */
140
    public WindowInfo getWindowInfo() {
141
        WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
142
        m_viewinfo.setTitle(getName());
143

    
144
        return m_viewinfo;
145
    }
146
}