Statistics
| Revision:

root / trunk / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / panelServices / LayersControlsPanel.java @ 8979

History | View | Annotate | Download (4.85 KB)

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

    
3
import java.awt.BorderLayout;
4
import java.awt.Dimension;
5
import java.awt.FlowLayout;
6
import java.awt.event.ActionListener;
7
import java.util.Properties;
8

    
9
import javax.swing.JPanel;
10

    
11
import org.gvsig.gui.beans.swing.JButton;
12

    
13
import com.iver.andami.PluginServices;
14
import com.iver.cit.gvsig.publish.servers.PublishControler;
15
import com.iver.cit.gvsig.publish.servers.ServicePanel;
16
import com.iver.cit.gvsig.publish.servers.mapserver.ServiceWMSPanel;
17

    
18
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
19
 *
20
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
21
 *
22
 * This program is free software; you can redistribute it and/or
23
 * modify it under the terms of the GNU General Public License
24
 * as published by the Free Software Foundation; either version 2
25
 * of the License, or (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
35
 *
36
 * For more information, contact:
37
 *
38
 *  Generalitat Valenciana
39
 *   Conselleria d'Infraestructures i Transport
40
 *   Av. Blasco Ib??ez, 50
41
 *   46010 VALENCIA
42
 *   SPAIN
43
 *
44
 *      +34 963862235
45
 *   gvsig@gva.es
46
 *      www.gvsig.gva.es
47
 *
48
 *    or
49
 *
50
 *   IVER T.I. S.A
51
 *   Salamanca 50
52
 *   46005 Valencia
53
 *   Spain
54
 *
55
 *   +34 963163400
56
 *   dac@iver.es
57
 */
58
/* CVS MESSAGES:
59
 *
60
 * $Id: LayersControlsPanel.java 8979 2006-11-22 19:32:13Z jorpiell $
61
 * $Log$
62
 * Revision 1.2  2006-11-22 19:32:13  jorpiell
63
 * Minimzado el tama?o de la ventana
64
 *
65
 * Revision 1.1  2006/11/22 15:57:03  jorpiell
66
 * Se ha ajustado el interfaz de usuario
67
 *
68
 *
69
 */
70
/**
71
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
72
 */
73
public class LayersControlsPanel extends JPanel{
74
        private LayersPanel layersPanel = null;
75
        private JPanel buttonsPanel = null;
76
        private JButton lastButton = null;
77
        private JButton acceptButton = null;
78
        /**
79
         * This method initializes 
80
         * 
81
         */
82
        public LayersControlsPanel() {
83
                super();
84
                initialize();
85
        }
86

    
87
        /**
88
         * This method initializes this
89
         * 
90
         */
91
        private void initialize() {
92
                  this.setLayout(new BorderLayout());
93
                  this.setSize(new java.awt.Dimension(500,100));
94
              this.add(getLayersPanel(), java.awt.BorderLayout.NORTH);
95
              this.add(getButtonsPanel(), java.awt.BorderLayout.SOUTH);
96
                }        
97
        
98
                /**
99
                 * This method initializes serverOptionsPanel        
100
                 *         
101
                 * @return javax.swing.JPanel        
102
                 */
103
                private LayersPanel getLayersPanel() {
104
                        if (layersPanel == null) {
105
                                layersPanel = new LayersPanel();
106
                                layersPanel.setSize(new java.awt.Dimension(500,180));
107
                                layersPanel.setPreferredSize(new java.awt.Dimension(500,180));
108
                                layersPanel.setName("LayersPanel");                        
109
                        }
110
                        return layersPanel;
111
                }        
112

    
113

    
114
                /**
115
                 * This method initializes buttonsPanel        
116
                 *         
117
                 * @return javax.swing.JPanel        
118
                 */
119
                private JPanel getButtonsPanel() {
120
                        if (buttonsPanel == null) {
121
                                FlowLayout flowLayout = new FlowLayout();
122
                                flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
123
                                buttonsPanel = new JPanel();
124
                                buttonsPanel.setPreferredSize(new java.awt.Dimension(500,30));
125
                                buttonsPanel.setName("buttonsPanel");
126
                                buttonsPanel.setLayout(flowLayout);                        
127
                                buttonsPanel.add(getLastButton(), null);
128
                                buttonsPanel.add(getAcceptButton(), null);
129
                        }
130
                        return buttonsPanel;
131
                }
132

    
133
                /**
134
                 * This method initializes lastButton        
135
                 *         
136
                 * @return javax.swing.JButton        
137
                 */
138
                private JButton getLastButton() {
139
                        if (lastButton == null) {
140
                                lastButton = new JButton();
141
                                lastButton.setText(PluginServices.getText(this, "previous"));
142
                                lastButton.setPreferredSize(new Dimension(100,20));
143
                                lastButton.setActionCommand("previous");
144
                        }
145
                        return lastButton;
146
                }
147

    
148
                /**
149
                 * This method initializes acceptButton        
150
                 *         
151
                 * @return javax.swing.JButton        
152
                 */
153
                private JButton getAcceptButton() {
154
                        if (acceptButton == null) {
155
                                acceptButton = new JButton();
156
                                acceptButton.setText(PluginServices.getText(this, "accept"));
157
                                acceptButton.setPreferredSize(new Dimension(100,20));
158
                                acceptButton.setActionCommand("accept");
159
                        }
160
                        return acceptButton;
161
                }
162
                
163
                public void addButtonsListener(ActionListener listener){
164
                        getLastButton().addActionListener(listener);
165
                        getAcceptButton().addActionListener(listener);
166
                }
167
                
168
                public void setPublishControler(PublishControler publishControler){
169
                        getLayersPanel().setPublishControler(publishControler);                        
170
                }
171
                
172
                public PublishControler getPublishControler() {
173
                        return getLayersPanel().getPublishControler();
174
                }
175
                
176
                public void restoreLayers() {
177
                        getLayersPanel().restoreLayers();                        
178
                }
179
                
180
                public void setSelectedRoot(){
181
                        getLayersPanel().setSelectedRoot();
182
                }
183
        
184
}