Statistics
| Revision:

svn-gvsig-desktop / branches / v10 / extensions / extPublishGeoserver / src / org / gvsig / publish / geoserver / gui / GeoserverAdvancedPanel.java @ 19432

History | View | Annotate | Download (5.41 KB)

1
/* gvSIG. Sistema de Información Geográfica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 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 Ibañ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.publish.geoserver.gui;
42

    
43
import java.util.EventListener;
44

    
45
import javax.swing.JPanel;
46

    
47
import org.gvsig.publish.geoserver.model.Geoserver;
48
import org.gvsig.publish.gui.publish.IPublishPluginPanel;
49

    
50
public class GeoserverAdvancedPanel extends JPanel implements
51
IPublishPluginPanel {
52
        //Association
53
        private Geoserver model=null;
54

    
55
        /**
56
         * Default constructor
57
         */
58
        public GeoserverAdvancedPanel() {
59
                super();
60
                initComponents();
61
                initLabels();
62
        }
63
        /**
64
         * Initializes labels for multi-language
65
         */
66
        private void initLabels() {
67
                // TODO Auto-generated method stub
68

    
69
        }
70
    private void initComponents() {
71
        java.awt.GridBagConstraints gridBagConstraints;
72

    
73
        maxFeatSpinner = new javax.swing.JSpinner();
74
        maxFeatLabel = new javax.swing.JLabel();
75
        logLevelLabel = new javax.swing.JLabel();
76
        logLevelCombo = new javax.swing.JComboBox();
77
        jSeparator1 = new javax.swing.JSeparator();
78
        infoLabel = new javax.swing.JLabel();
79

    
80
        setLayout(new java.awt.GridBagLayout());
81

    
82
        maxFeatSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1000), null, null, Integer.valueOf(10)));
83
        gridBagConstraints = new java.awt.GridBagConstraints();
84
        gridBagConstraints.gridx = 2;
85
        gridBagConstraints.gridy = 1;
86
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
87
        gridBagConstraints.weightx = 1.0;
88
        gridBagConstraints.insets = new java.awt.Insets(5, 2, 2, 5);
89
        add(maxFeatSpinner, gridBagConstraints);
90

    
91
        maxFeatLabel.setText("max_features");
92
        gridBagConstraints = new java.awt.GridBagConstraints();
93
        gridBagConstraints.gridx = 1;
94
        gridBagConstraints.gridy = 1;
95
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 2, 2);
96
        add(maxFeatLabel, gridBagConstraints);
97

    
98
        logLevelLabel.setText("login_level");
99
        gridBagConstraints = new java.awt.GridBagConstraints();
100
        gridBagConstraints.gridx = 1;
101
        gridBagConstraints.gridy = 2;
102
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 2);
103
        add(logLevelLabel, gridBagConstraints);
104

    
105
        logLevelCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SEVERE", "WARNING", "INFO", "CONFIG", "FINER", "FINEST" }));
106
        gridBagConstraints = new java.awt.GridBagConstraints();
107
        gridBagConstraints.gridx = 2;
108
        gridBagConstraints.gridy = 2;
109
        gridBagConstraints.weightx = 1.0;
110
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
111
        add(logLevelCombo, gridBagConstraints);
112
        gridBagConstraints = new java.awt.GridBagConstraints();
113
        gridBagConstraints.gridx = 1;
114
        gridBagConstraints.gridy = 0;
115
        gridBagConstraints.gridwidth = 2;
116
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
117
        gridBagConstraints.weightx = 1.0;
118
        add(jSeparator1, gridBagConstraints);
119

    
120
        infoLabel.setFont(new java.awt.Font("Dialog", 1, 11));
121
        infoLabel.setText("advanced_info");
122
        gridBagConstraints = new java.awt.GridBagConstraints();
123
        gridBagConstraints.gridx = 0;
124
        gridBagConstraints.gridy = 0;
125
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 2, 5);
126
        add(infoLabel, gridBagConstraints);
127
    }// </editor-fold>
128
    
129
    
130
    // Variables declaration - do not modify
131
    private javax.swing.JLabel infoLabel;
132
    private javax.swing.JSeparator jSeparator1;
133
    private javax.swing.JComboBox logLevelCombo;
134
    private javax.swing.JLabel logLevelLabel;
135
    private javax.swing.JLabel maxFeatLabel;
136
    private javax.swing.JSpinner maxFeatSpinner;
137
    // End of variables declaration
138

    
139
        public Object getModel() {
140
                Object value = maxFeatSpinner.getModel().getValue();
141
                model.getConfig().getServices().setMaxFeatures(new Integer(value.toString()).intValue());
142
                model.getConfig().getServices().setLoginLevel(logLevelCombo.getSelectedItem().toString());
143
                return model;
144
        }
145

    
146
        public void setListener(EventListener listener) {
147
                // TODO Auto-generated method stub
148

    
149
        }
150

    
151
        public void setModel(Object entityModel) {
152
                model = (Geoserver)entityModel;
153
                logLevelCombo.setSelectedItem(model.getConfig().getServices().getLoginLevel());
154
                maxFeatSpinner.setValue(new Integer(model.getConfig().getServices().getMaxFeatures()));
155
        }
156

    
157
}