Statistics
| Revision:

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

History | View | Annotate | Download (3.99 KB)

1 2819 jorpiell
/* 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 2026 luisw
package es.gva.cit.gvsig.catalogClient.gui;
42
43
import org.w3c.dom.Node;
44
45
import com.iver.andami.PluginServices;
46
import com.iver.andami.ui.mdiManager.View;
47
import com.iver.andami.ui.mdiManager.ViewInfo;
48
49 2986 jorpiell
import es.gva.cit.catalogClient.ui.AbstractSearchPanel;
50 2149 jorpiell
import es.gva.cit.catalogClient.ui.SearchDialogPanel;
51 2986 jorpiell
import es.gva.cit.catalogClient.ui.SearchMiniPanel;
52
import es.gva.cit.catalogClient.ui.SearchPanel;
53 2149 jorpiell
import es.gva.cit.catalogClient.ui.ShowResultsPanel;
54 2026 luisw
55
/**
56
 * @author luisw
57
 */
58 2149 jorpiell
public class SearchDialog extends SearchDialogPanel implements
59 2026 luisw
                View {
60
61 2986 jorpiell
    /**
62
     *
63
     * @param isMinimized
64
     * If the window is/isn't minimized
65
     * @param title
66
     * Title to load into the title field of the form
67
     */
68
        public SearchDialog(boolean isMinimized,String title) {
69
                super(null,isMinimized,title);
70 2026 luisw
        }
71
72
        public void searchButtonActionPerformed() {
73 2873 jorpiell
        doSearch();
74 2026 luisw
                if (nodesRecords != null && nodesRecords.length > 1) {
75
                        showResults(nodesRecords);
76
                }
77
        }
78
79
        public void showResults(Node[] nodesRecords) {
80 2149 jorpiell
                ShowResultsPanel.mustShowThumbnails = true;
81 2026 luisw
                ShowResultsDialog dialog =
82 2986 jorpiell
                        new ShowResultsDialog(client,nodesRecords,1);
83 2636 jorpiell
                dialog.setBounds(0, 0, 625, 390);
84 2026 luisw
                dialog.setName(PluginServices.getText(this, "search_results")+":");
85
                dialog.setVisible(true);
86
                PluginServices.getMDIManager().addView(dialog);
87
        }
88
89
        /**
90
         * Cierra el Dialog
91
         */
92
        public void closeJDialog() {
93 2823 jorpiell
                setVisible(true);
94 2026 luisw
                PluginServices.getMDIManager().closeView(SearchDialog.this);
95
        }
96
97
        /* (non-Javadoc)
98
         * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
99
         */
100
        public ViewInfo getViewInfo() {
101
                ViewInfo m_viewinfo = new ViewInfo(ViewInfo.MODALDIALOG);
102
                m_viewinfo.setTitle(getName());
103 2309 luisw
                return m_viewinfo;
104 2026 luisw
        }
105 2309 luisw
106 2868 jorpiell
107
         public void closeButtonActionPerformed() {
108
             closeJDialog();
109
         }
110 2986 jorpiell
111
         public void sizeButtonActionPerformed(){
112
             closeJDialog();
113
             SearchDialog dialog = new SearchDialog(!(isMinimized),controlsPanel.getTitle());
114
             dialog.setCatalogClient(client);
115 3031 jorpiell
             dialog.setCurrentServer(getCurrentServer());
116
             dialog.setName(PluginServices.getText(this, "catalog_search") + " ["+getCurrentServer()+"]");
117 3018 jorpiell
             PluginServices.getMDIManager().addView(dialog);
118 2986 jorpiell
         }
119
120
         public AbstractSearchPanel getControlsPanel() {
121
                if (isMinimized){
122 3018 jorpiell
                    setSize(275, 100);
123 2986 jorpiell
                    controlsPanel = new SearchMiniPanel();
124
                    controlsPanel.setSize(200,55);
125
                    //controlsPanel.setPreferredSize(new java.awt.Dimension(200, 55));
126
                    //controlsPanel.setLocation(0, 0);
127
                }else{
128 3018 jorpiell
                    setSize(675, 485);
129 2986 jorpiell
                    controlsPanel = new SearchPanel();
130
                    controlsPanel.setSize(700,455);
131
                    //controlsPanel.setPreferredSize(new java.awt.Dimension(700, 455));
132
                    //controlsPanel.setLocation(0, 0);
133
                }
134
                controlsPanel.repaint();
135
                return controlsPanel;
136
            }
137
138 2026 luisw
}