Statistics
| Revision:

root / trunk / extensions / extCatalogYNomenclator / src / es / gva / cit / gvsig / catalogClient / gui / SearchDialog.java @ 3073

History | View | Annotate | Download (4.01 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 com.iver.andami.PluginServices;
44
import com.iver.andami.ui.mdiManager.View;
45
import com.iver.andami.ui.mdiManager.ViewInfo;
46

    
47
import es.gva.cit.catalogClient.metadataXML.XMLNode;
48
import es.gva.cit.catalogClient.ui.AbstractSearchPanel;
49
import es.gva.cit.catalogClient.ui.SearchDialogPanel;
50
import es.gva.cit.catalogClient.ui.SearchMiniPanel;
51
import es.gva.cit.catalogClient.ui.SearchPanel;
52
import es.gva.cit.catalogClient.ui.ShowResultsPanel;
53

    
54
/**
55
 * @author luisw
56
 */
57
public class SearchDialog extends SearchDialogPanel implements
58
                View {
59

    
60
    /**
61
     * 
62
     * @param isMinimized
63
     * If the window is/isn't minimized
64
     * @param title
65
     * Title to load into the title field of the form
66
     */
67
        public SearchDialog(boolean isMinimized,String title) {
68
                super(null,isMinimized,title);
69
        }
70

    
71
        public void searchButtonActionPerformed() {
72
        doSearch();
73
                if (nodesRecords != null && nodesRecords.length > 1) {
74
                        showResults(nodesRecords);
75
                }
76
        }
77
        
78
        public void showResults(XMLNode[] nodesRecords) {
79
                ShowResultsPanel.mustShowThumbnails = true;
80
                ShowResultsDialog dialog =
81
                        new ShowResultsDialog(client,nodesRecords,1);
82
                dialog.setBounds(0, 0, 625, 390);
83
                dialog.setName(PluginServices.getText(this, "search_results")+":");
84
                dialog.setVisible(true);
85
                PluginServices.getMDIManager().addView(dialog);
86
        }
87
        
88
        /**
89
         * Cierra el Dialog
90
         */
91
        public void closeJDialog() {
92
                setVisible(true);
93
                PluginServices.getMDIManager().closeView(SearchDialog.this);
94
        }
95
        
96
        /* (non-Javadoc)
97
         * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
98
         */
99
        public ViewInfo getViewInfo() {
100
                ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
101
                m_viewinfo.setTitle(getName());
102
                return m_viewinfo;
103
        }
104
        
105
        
106
         public void closeButtonActionPerformed() {
107
             closeJDialog();
108
         }
109
         
110
         public void sizeButtonActionPerformed(){
111
             closeJDialog();
112
             SearchDialog dialog = new SearchDialog(!(isMinimized),controlsPanel.getTitle());
113
             dialog.setCatalogClient(client);
114
             dialog.setCurrentServer(getCurrentServer());
115
             dialog.setName(PluginServices.getText(this, "catalog_search") + " ["+getCurrentServer()+"]");
116
             PluginServices.getMDIManager().addView(dialog);
117
         }
118
         
119
         public AbstractSearchPanel getControlsPanel() {
120
                if (isMinimized){
121
                    setSize(275, 100);  
122
                    controlsPanel = new SearchMiniPanel();
123
                    controlsPanel.setSize(200,55);
124
                    //controlsPanel.setPreferredSize(new java.awt.Dimension(200, 55));
125
                    //controlsPanel.setLocation(0, 0);
126
                }else{
127
                    setSize(675, 485);
128
                    controlsPanel = new SearchPanel();
129
                    controlsPanel.setSize(700,455);
130
                    //controlsPanel.setPreferredSize(new java.awt.Dimension(700, 455));
131
                    //controlsPanel.setLocation(0, 0);
132
                }
133
                controlsPanel.repaint();
134
                return controlsPanel;
135
            }
136
            
137
}