Statistics
| Revision:

root / trunk / extensions / extGeoreferencing / src / org / gvsig / georeferencing / ui / options / CheckOptionsPanel.java @ 19621

History | View | Annotate | Download (4.39 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 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
package org.gvsig.georeferencing.ui.options;
20

    
21
import java.awt.Color;
22
import java.awt.GridBagConstraints;
23
import java.awt.GridBagLayout;
24
import java.awt.Insets;
25

    
26
import javax.swing.JCheckBox;
27
import javax.swing.JPanel;
28

    
29
import org.gvsig.gui.beans.datainput.DataInputContainer;
30
import org.gvsig.raster.util.RasterToolsUtil;
31

    
32
/**
33
 * Panel de selecci?n de tipo de georreferenciaci?n.
34
 * 
35
 * 10/01/2008
36
 * @author Nacho Brodin nachobrodin@gmail.com
37
 */
38
public class CheckOptionsPanel extends JPanel {
39
        private static final long     serialVersionUID    = 1L;
40
        
41
        private DataInputContainer    threshold           = null;
42
        private JCheckBox             showNumber          = null;
43
        private JCheckBox             addErrorInCSV       = null;
44
        private JCheckBox             centerPoint         = null;
45
        private ColorSelector         backgroundColorSel  = null;
46
        private ColorSelector         textColorSel        = null;
47
                
48
        /**
49
         * Constructor. Asigna la lista de nombres de vistas para el selector. 
50
         * @param viewList
51
         */
52
        public CheckOptionsPanel() {
53
                init();
54
        }
55
        
56
        /**
57
         * Acciones de inicializaci?n del panel
58
         */
59
        public void init() {            
60
                GridBagLayout gl = new GridBagLayout();
61
                setLayout(gl);
62
                setBorder(javax.swing.BorderFactory.createTitledBorder(null, RasterToolsUtil.getText(this, "options"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
63
                
64
                GridBagConstraints gbc = new GridBagConstraints();
65
                gbc.anchor = GridBagConstraints.WEST;
66
                gbc.insets = new Insets(0, 5, 5, 0);
67
                add(getBackGroundColorSelector(), gbc);
68

    
69
                gbc.gridy = 1;
70
                add(getTextSelector(), gbc);
71
                
72
                gbc.weightx = 1.0;
73
                gbc.fill = GridBagConstraints.HORIZONTAL;
74
                
75
                gbc.gridy = 2;
76
                add(getShowNumberCheck(), gbc);
77
                
78
                gbc.gridy = 3;
79
                add(getAddErrorsCSVCheck(), gbc);
80
                
81
                gbc.gridy = 4;
82
                add(getCenterViewCheck(), gbc);
83
                
84
                gbc.gridy = 5;
85
                add(getThresholdError(), gbc);
86
        }
87
                
88
        /**
89
         * Obtiene el control para selecci?n de umbral de error
90
         * @return JButton
91
         */
92
        public DataInputContainer getThresholdError() {
93
                if(threshold == null) {
94
                        threshold = new DataInputContainer();
95
                        threshold.setLabelText(RasterToolsUtil.getText(this, "umbral_error"));
96
                }
97
                return threshold;
98
        }
99
        
100
        /**
101
         * Obtiene el selector de color para el fondo
102
         * @return JButton
103
         */
104
        public ColorSelector getBackGroundColorSelector() {
105
                if(backgroundColorSel == null) {
106
                        backgroundColorSel = new ColorSelector(Color.BLACK, RasterToolsUtil.getText(this, "background_color"));
107
                }
108
                return backgroundColorSel;
109
        }
110
        
111
        /**
112
         * Obtiene el selector de color para el texto
113
         * @return JButton
114
         */
115
        public ColorSelector getTextSelector() {
116
                if(textColorSel == null) {
117
                        textColorSel = new ColorSelector(Color.RED, RasterToolsUtil.getText(this, "text_color"));
118
                }
119
                return textColorSel;
120
        }
121
        
122
        /**
123
         * Obtiene el check de mostrar numeraci?n
124
         * @return JCheckBox
125
         */
126
        public JCheckBox getShowNumberCheck() {
127
                if(showNumber == null) {
128
                        showNumber = new JCheckBox(RasterToolsUtil.getText(this, "show_number"));
129
                }
130
                return showNumber;
131
        }
132
        
133
        /**
134
         * Obtiene el check de a?adir errores al fichero CSV o no
135
         * @return JCheckBox
136
         */
137
        public JCheckBox getAddErrorsCSVCheck() {
138
                if(addErrorInCSV == null) {
139
                        addErrorInCSV = new JCheckBox(RasterToolsUtil.getText(this, "add_errors_csv"));
140
                }
141
                return addErrorInCSV;
142
        }
143
        
144
        /**
145
         * Obtiene el check de centrar la vista sobre el punto seleccionado
146
         * @return JCheckBox
147
         */
148
        public JCheckBox getCenterViewCheck() {
149
                if(centerPoint == null) {
150
                        centerPoint = new JCheckBox(RasterToolsUtil.getText(this, "center_view"));
151
                }
152
                return centerPoint;
153
        }
154
        
155
}
156