Statistics
| Revision:

root / branches / v2_0_0_prep / extensions / extGazetteer / src / org / gvsig / gazetteer / gui / ShowResultsDialog.java @ 29628

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

    
43

    
44
import javax.swing.JDialog;
45

    
46
import org.gvsig.andami.ui.mdiManager.IWindow;
47
import org.gvsig.andami.ui.mdiManager.WindowInfo;
48
import org.gvsig.gazetteer.GazetteerClient;
49
import org.gvsig.gazetteer.loaders.FeatureLoader;
50
import org.gvsig.gazetteer.querys.Feature;
51
import org.gvsig.gazetteer.querys.GazetteerQuery;
52
import org.gvsig.gazetteer.ui.showresults.ShowResultsDialogPanel;
53
import org.gvsig.i18n.Messages;
54

    
55

    
56
/**
57
 * @author Jorge Piera Llodra (piera_jor@gva.es)
58
 */
59
public class ShowResultsDialog extends ShowResultsDialogPanel implements IWindow  {
60
    private SearchDialog searchDialog = null;
61
    private JDialog frame = null;
62
    /**
63
     * @param client
64
     * @param features
65
     * @param recordsByPage
66
     */
67
    public ShowResultsDialog(JDialog frame,GazetteerClient client, Feature[] features, int recordsByPage, GazetteerQuery query) {
68
        super(client, features, recordsByPage,query);
69
        this.frame = frame;
70
    }
71

    
72
      /* (non-Javadoc)
73
     * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
74
     */
75
    public WindowInfo getWindowInfo() {
76
        WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
77
                m_viewinfo.setTitle(Messages.getText( "gazetteer_search"));
78
                return m_viewinfo;
79
    }
80
    public Object getWindowProfile(){
81
                return WindowInfo.DIALOG_PROFILE;
82
        }
83
    
84
    public void closeButtonActionPerformed() {
85
             closeJDialog();
86
         }
87
   
88
    public void closeJDialog() {
89
        frame.setVisible(false);
90
        }
91
   
92
   /**
93
    * This method have to load the selected feature into gvSIG
94
    */
95
   public void loadButtonActionPerformed() {
96
       Feature feature = ppalPanel.getFeature();
97
       if (feature != null){
98
    
99
               new FeatureLoader(client.getProjection()).load(feature,query);
100
       }
101
       closeJDialog();
102
       //getSearchDialog().closeJDialog();
103
   }    
104
    
105
    /**
106
     * @return Returns the searchDialog.
107
     */
108
    public SearchDialog getSearchDialog() {
109
        return searchDialog;
110
    }
111
    /**
112
     * @param searchDialog The searchDialog to set.
113
     */
114
    public void setSearchDialog(SearchDialog searchDialog) {
115
        this.searchDialog = searchDialog;
116
    }
117
}