Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extCatalog / src / org / gvsig / catalog / gui / ShowResultsDialog.java @ 28383

History | View | Annotate | Download (4.25 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 org.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.catalog.CatalogClient;
50
import org.gvsig.catalog.drivers.GetRecordsReply;
51
import org.gvsig.catalog.metadataxml.XMLNode;
52
import org.gvsig.catalog.schemas.Record;
53
import org.gvsig.catalog.schemas.Resource;
54
import org.gvsig.catalog.ui.showresults.ShowResultsDialogPanel;
55
import org.gvsig.catalog.utils.Frames;
56
import org.gvsig.i18n.Messages;
57

    
58
import com.iver.andami.PluginServices;
59
import com.iver.andami.ui.mdiManager.IWindow;
60
import com.iver.andami.ui.mdiManager.WindowInfo;
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, GetRecordsReply recordsReply,
78
        int currentRecord) {
79
        super(client, recordsReply, currentRecord);
80
        this.frame = frame;
81
    }
82

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

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

    
127
    /**
128
     * DOCUMENT ME!
129
     */
130
    public void closeButtonActionPerformed() {
131
        closeJDialog();
132
    }
133

    
134
    /**
135
     * Cierra el Dialog
136
     */
137
    public void closeJDialog() {
138
        frame.setVisible(false);
139
    }
140

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

    
148
        return m_viewinfo;
149
    }
150
    public Object getWindowProfile(){
151
                return WindowInfo.DIALOG_PROFILE;
152
        }
153
}