Statistics
| Revision:

root / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / SelectServerControlsPanel.java @ 6956

History | View | Annotate | Download (3.85 KB)

1
package com.iver.cit.gvsig.publish.gui;
2

    
3
import java.awt.Dimension;
4
import java.awt.FlowLayout;
5
import java.awt.event.ActionListener;
6

    
7
import javax.swing.JPanel;
8

    
9
import org.gvsig.gui.beans.swing.JButton;
10

    
11
import com.iver.andami.PluginServices;
12
import com.iver.cit.gvsig.publish.gui.comboServer.ServerData;
13

    
14
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
15
 *
16
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
17
 *
18
 * This program is free software; you can redistribute it and/or
19
 * modify it under the terms of the GNU General Public License
20
 * as published by the Free Software Foundation; either version 2
21
 * of the License, or (at your option) any later version.
22
 *
23
 * This program is distributed in the hope that it will be useful,
24
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 * GNU General Public License for more details.
27
 *
28
 * You should have received a copy of the GNU General Public License
29
 * along with this program; if not, write to the Free Software
30
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
31
 *
32
 * For more information, contact:
33
 *
34
 *  Generalitat Valenciana
35
 *   Conselleria d'Infraestructures i Transport
36
 *   Av. Blasco Ib??ez, 50
37
 *   46010 VALENCIA
38
 *   SPAIN
39
 *
40
 *      +34 963862235
41
 *   gvsig@gva.es
42
 *      www.gvsig.gva.es
43
 *
44
 *    or
45
 *
46
 *   IVER T.I. S.A
47
 *   Salamanca 50
48
 *   46005 Valencia
49
 *   Spain
50
 *
51
 *   +34 963163400
52
 *   dac@iver.es
53
 */
54
/* CVS MESSAGES:
55
 *
56
 * $Id: SelectServerControlsPanel.java 6956 2006-08-31 19:19:38Z jorpiell $
57
 * $Log$
58
 * Revision 1.1  2006-08-31 19:19:04  jorpiell
59
 * *** empty log message ***
60
 *
61
 *
62
 */
63
/**
64
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
65
 */
66
public class SelectServerControlsPanel extends JPanel {
67

    
68
        private SelectServerPanel controlsPanel = null;
69
        private JPanel buttonsPanel = null;
70
        private JButton nextButton = null;
71
        /**
72
         * This method initializes 
73
         * 
74
         */
75
        public SelectServerControlsPanel() {
76
                super();
77
                initialize();
78
        }
79

    
80
        /**
81
         * This method initializes this
82
         * 
83
         */
84
        private void initialize() {
85
        this.setLayout(new FlowLayout());
86
        this.setSize(new java.awt.Dimension(405,136));
87
        this.add(getControlsPanel(), null);
88
        this.add(getButtonsPanel(), null);
89
                        
90
        }
91

    
92
        /**
93
         * This method initializes controlsPanel        
94
         *         
95
         * @return javax.swing.JPanel        
96
         */
97
        private SelectServerPanel getControlsPanel() {
98
                if (controlsPanel == null) {
99
                        controlsPanel = new SelectServerPanel();
100
                }
101
                return controlsPanel;
102
        }
103

    
104
        /**
105
         * This method initializes buttonsPanel        
106
         *         
107
         * @return javax.swing.JPanel        
108
         */
109
        private JPanel getButtonsPanel() {
110
                if (buttonsPanel == null) {
111
                        FlowLayout flowLayout = new FlowLayout();
112
                        flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
113
                        buttonsPanel = new JPanel();
114
                        buttonsPanel.setPreferredSize(new java.awt.Dimension(400,30));
115
                        buttonsPanel.setLayout(flowLayout);
116
                        buttonsPanel.add(getNextButton(), null);
117
                }
118
                return buttonsPanel;
119
        }
120

    
121
        /**
122
         * This method initializes nextButton        
123
         *         
124
         * @return javax.swing.JButton        
125
         */
126
        private JButton getNextButton() {
127
                if (nextButton == null) {
128
                        nextButton = new JButton();
129
                        nextButton.setText(PluginServices.getText(this, "next"));
130
                        nextButton.setPreferredSize(new Dimension(100,20));
131
                        nextButton.setActionCommand("next");
132
                }
133
                return nextButton;
134
        }
135
        
136
        public void setServerBrands(String[] brands){
137
                for (int i=0 ; i<brands.length ; i++){
138
                        getControlsPanel().getCmbServerName().addItem(brands[i]);
139
                }        
140
        }
141
        
142
        public void setServerTypes(String[] types){
143
                for (int i=0 ; i<types.length ; i++){
144
                        getControlsPanel().getCmbServerType().addItem(types[i]);
145
                }        
146
        }
147
        
148
        public void setServersList(ServerData[] servers){
149
                getControlsPanel().getServerCombo().setServerList(servers);
150
        }
151
        
152
        public void addButtonsListener(ActionListener listener){
153
                getNextButton().addActionListener(listener);
154
        }
155
        
156

    
157
}  //  @jve:decl-index=0:visual-constraint="10,10"