Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.swing / org.gvsig.raster.wmts.swing.impl / src / main / java / org / gvsig / raster / wmts / swing / impl / panel / format / IFormatsPanel.java @ 2613

History | View | Annotate | Download (7.61 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
* MA  02110-1301, USA.
20
*
21
*/
22
package org.gvsig.raster.wmts.swing.impl.panel.format;
23

    
24
import java.awt.GridBagConstraints;
25
import java.awt.GridBagLayout;
26

    
27
import javax.swing.JCheckBox;
28
import javax.swing.JList;
29
import javax.swing.JPanel;
30
import javax.swing.JScrollPane;
31

    
32
import org.gvsig.i18n.Messages;
33
import org.gvsig.raster.wmts.swing.impl.wizard.WMTSParametersListModel;
34

    
35
/**
36
 * Formats panel
37
 *
38
 * @author Nacho Brodin (nachobrodin@gmail.com)
39
 */
40
public class IFormatsPanel extends JPanel {
41
        private static final long      serialVersionUID   = 1L;
42
        private JScrollPane            jScrollImageFormats        = null;
43
        private JList                  lstImageFormats            = null;
44
        private JScrollPane            jScrollInfoFormats         = null;
45
        private JList                  lstInfoFormats             = null;
46
        private JScrollPane            jScrollLstSrs              = null;
47
        private JList                  lstSRSs                    = null;
48
        private JPanel                 jPanelImageFormats         = null;
49
        private JPanel                 jPanelInfoFormats          = null;
50
        private JPanel                 jPanelLstSrs               = null;
51
        private JCheckBox              chkTransparency            = null;
52
        
53
        public IFormatsPanel() {
54
                init();
55
        }
56
        
57
        public void init() {
58
                setLayout(new GridBagLayout());
59
                
60
                GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
61
                gridBagConstraints1.fill = GridBagConstraints.BOTH;
62
                gridBagConstraints1.anchor = GridBagConstraints.CENTER;
63
                gridBagConstraints1.weightx = 1.0;
64
                gridBagConstraints1.weighty = 1.0;
65
                gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
66
                add(getJPanelImageFormats(), gridBagConstraints1);
67
                
68
                gridBagConstraints1.gridy = 1;
69
                add(getJPanelLstSrs(), gridBagConstraints1);
70
                
71
                gridBagConstraints1.gridy = 2;
72
                add(getJPanelInfoFormats(), gridBagConstraints1);
73
        }
74
        
75
        /**
76
         * This method initializes jPanelImageFormats
77
         * @return Panel
78
         */
79
        private JPanel getJPanelInfoFormats() {
80
                if (jPanelInfoFormats == null) {
81
                        jPanelInfoFormats = new JPanel();
82
                        jPanelInfoFormats.setLayout(new GridBagLayout());
83
                        jPanelInfoFormats.setBorder(javax.swing.BorderFactory.createTitledBorder(
84
                                        null, Messages.getText("select_info_formats"),
85
                                        javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
86
                                        javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
87
                                        null));
88
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
89
                        gridBagConstraints1.fill = GridBagConstraints.BOTH;
90
                        gridBagConstraints1.anchor = GridBagConstraints.CENTER;
91
                        gridBagConstraints1.weightx = 1.0;
92
                        gridBagConstraints1.weighty = 1.0;
93
                        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
94
                        jPanelInfoFormats.add(getJScrollInfoFormats(), gridBagConstraints1);
95
                }
96
                return jPanelInfoFormats;
97
        }
98
        
99
        /**
100
         * This method initializes jPanel5
101
         *
102
         * @return Panel
103
         */
104
        private JPanel getJPanelLstSrs() {
105
                if (jPanelLstSrs == null) {
106
                        jPanelLstSrs = new JPanel();
107
                        jPanelLstSrs.setLayout(new GridBagLayout());
108
                        jPanelLstSrs.setBorder(javax.swing.BorderFactory.createTitledBorder(
109
                                        null, Messages.getText("seleccionar_srs"),
110
                                        javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
111
                                        javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
112
                                        null));
113
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
114
                        gridBagConstraints1.fill = GridBagConstraints.BOTH;
115
                        gridBagConstraints1.anchor = GridBagConstraints.CENTER;
116
                        gridBagConstraints1.weightx = 1.0;
117
                        gridBagConstraints1.weighty = 1.0;
118
                        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
119
                        jPanelLstSrs.add(getJScrollLstSrs(), gridBagConstraints1);
120
                }
121
                return jPanelLstSrs;
122
        }
123

    
124
        /**
125
         * This method initializes jPanelImageFormats
126
         * @return Panel
127
         */
128
        private JPanel getJPanelImageFormats() {
129
                if (jPanelImageFormats == null) {
130
                        jPanelImageFormats = new JPanel();
131
                        jPanelImageFormats.setLayout(new GridBagLayout());
132
                        jPanelImageFormats.setBorder(javax.swing.BorderFactory.createTitledBorder(
133
                                        null, Messages.getText("select_formats"),
134
                                        javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
135
                                        javax.swing.border.TitledBorder.DEFAULT_POSITION, null,
136
                                        null));
137
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
138
                        gridBagConstraints1.fill = GridBagConstraints.BOTH;
139
                        gridBagConstraints1.anchor = GridBagConstraints.CENTER;
140
                        gridBagConstraints1.weightx = 1.0;
141
                        gridBagConstraints1.weighty = 1.0;
142
                        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
143
                        jPanelImageFormats.add(getJScrollImageFormats(), gridBagConstraints1);
144
                        /*gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
145
                        gridBagConstraints1.gridy = 1;
146
                        gridBagConstraints1.weighty = 0.0;
147
                        jPanelImageFormats.add(getChkTransparency(), gridBagConstraints1);*/
148
                }
149
                return jPanelImageFormats;
150
        }
151
        
152
        /**
153
         * This method initializes jScrollPane6
154
         * @return ScrollPane
155
         */
156
        private JScrollPane getJScrollInfoFormats() {
157
                if (jScrollInfoFormats == null) {
158
                        jScrollInfoFormats = new JScrollPane();
159
                        jScrollInfoFormats.setViewportView(getLstInfoFormats());
160
                }
161

    
162
                return jScrollInfoFormats;
163
        }
164

    
165
        /**
166
         * This method initializes jScrollImageFormats
167
         * @return ScrollPane
168
         */
169
        private JScrollPane getJScrollImageFormats() {
170
                if (jScrollImageFormats == null) {
171
                        jScrollImageFormats = new JScrollPane();
172
                        jScrollImageFormats.setViewportView(getLstImageFormats());
173
                }
174

    
175
                return jScrollImageFormats;
176
        }
177
        
178
        /**
179
         * This method initializes lstFormats
180
         * @return List
181
         */
182
        public JList getLstImageFormats() {
183
                if (lstImageFormats == null) {
184
                        lstImageFormats = new JList();
185
                        lstImageFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
186
                }
187
                return lstImageFormats;
188
        }
189
        
190
        /**
191
         * This method initializes lstFormats
192
         * @return List
193
         */
194
        public JList getLstInfoFormats() {
195
                if (lstInfoFormats == null) {
196
                        lstInfoFormats = new JList();
197
                        lstInfoFormats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
198
                }
199
                return lstInfoFormats;
200
        }
201
        
202
        /**
203
         * This method initializes lstSRSs
204
         *
205
         * @return JList
206
         */
207
        public JList getLstSRSs() {
208
                if (lstSRSs == null) {
209
                        lstSRSs = new JList();
210
                        lstSRSs.setModel(new WMTSParametersListModel());
211
                        lstSRSs.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
212
                }
213
                return lstSRSs;
214
        }
215
        
216
        /**
217
         * This method initializes jScrollLstSrs
218
         * @return ScrollPane
219
         */
220
        private JScrollPane getJScrollLstSrs() {
221
                if (jScrollLstSrs == null) {
222
                        jScrollLstSrs = new JScrollPane();
223
                        jScrollLstSrs.setViewportView(getLstSRSs());
224
                }
225

    
226
                return jScrollLstSrs;
227
        }
228
        
229
        /**
230
         * This method initializes chkTrasparency
231
         * @return CheckBox
232
         */
233
        public JCheckBox getChkTransparency() {
234
                if (chkTransparency == null) {
235
                        chkTransparency = new JCheckBox();
236
                        chkTransparency.setText(Messages.getText("wms_transparency"));
237
                        chkTransparency.setSelected(true);
238
                }
239
                return chkTransparency;
240
        }
241
        
242
}