Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.app / org.gvsig.raster.wmts.app.wmtsclient / src / main / java / org / gvsig / raster / wmts / app / wmtsclient / gui / panel / layer / AddDelLayerPanel.java @ 393

History | View | Annotate | Download (3.85 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.app.wmtsclient.gui.panel.layer;
23

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

    
27
import javax.swing.JButton;
28
import javax.swing.JCheckBox;
29
import javax.swing.JPanel;
30

    
31
import org.gvsig.andami.PluginServices;
32

    
33
/**
34
 * Layer list panel
35
 *
36
 * @author Nacho Brodin (nachobrodin@gmail.com)
37
 */
38
public class AddDelLayerPanel extends JPanel {
39
        private static final long      serialVersionUID           = 1L;
40
        private JCheckBox              chkDisagregate             = null;
41
        private JButton                btnAdd                     = null;
42
        private JButton                btnRemove                  = null;
43
        private JPanel                 jPanelAddRemoveLayer       = null;
44
        
45
        public AddDelLayerPanel() {
46
                init();
47
        }
48
        
49
        private void init() {
50
                setLayout(new GridBagLayout());
51
                
52
                GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
53
                gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
54
                gridBagConstraints1.weightx = 1.0;
55
                gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 2);
56
                add(getJPanelAddRemoveLayer(), gridBagConstraints1);
57
        }
58
        
59
        /**
60
         * This method initializes jPanel4
61
         * @return Panel
62
         */
63
        private JPanel getJPanelAddRemoveLayer() {
64
                if (jPanelAddRemoveLayer == null) {
65
                        jPanelAddRemoveLayer = new JPanel();
66
                        jPanelAddRemoveLayer.setLayout(new GridBagLayout());
67

    
68
                        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
69
                        gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
70
                        gridBagConstraints1.anchor = GridBagConstraints.WEST;
71
                        gridBagConstraints1.weightx = 1.0;
72
                        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
73
                        
74
                        jPanelAddRemoveLayer.add(getChkDisagregate(), gridBagConstraints1);
75
                        
76
                        gridBagConstraints1.anchor = GridBagConstraints.EAST;
77
                        gridBagConstraints1.weightx = 0.0;
78
                        gridBagConstraints1.gridx = 1;
79
                        jPanelAddRemoveLayer.add(getBtnAdd(), gridBagConstraints1);
80
                        
81
                        gridBagConstraints1.gridx = 2;
82
                        jPanelAddRemoveLayer.add(getBtnRemove(), gridBagConstraints1);
83
                }
84

    
85
                return jPanelAddRemoveLayer;
86
        }
87
        
88
        /**
89
         * This method initializes chkDisagregate
90
         * @return CheckBox
91
         */
92
        public JCheckBox getChkDisagregate() {
93
                if (chkDisagregate == null) {
94
                        chkDisagregate = new JCheckBox();
95
                        chkDisagregate.setText(PluginServices.getText(this, "disagregate_layers"));
96
                        chkDisagregate.setSelected(false);
97
                }
98
                return chkDisagregate;
99
        }
100

    
101
        /**
102
         * This method initializes btnConnect
103
         * @return javax.swing.JButton
104
         */
105
        public JButton getBtnAdd() {
106
                if (btnAdd == null) {
107
                        btnAdd = new JButton();
108
                        btnAdd.setPreferredSize(new java.awt.Dimension(100, 20));
109
                        btnAdd.setText(PluginServices.getText(this, "add"));
110
                }
111
                return btnAdd;
112
        }
113
        
114
        /**
115
         * This method initializes btnCancel
116
         * @return javax.swing.JButton
117
         */
118
        public JButton getBtnRemove() {
119
                if (btnRemove == null) {
120
                        btnRemove = new JButton();
121
                        btnRemove.setEnabled(false);
122
                        btnRemove.setPreferredSize(new java.awt.Dimension(100, 20));
123
                        btnRemove.setText(PluginServices.getText(this, "remove"));
124
                }
125
                return btnRemove;
126
        }
127
}