svn-gvsig-desktop / trunk / extensions / extGeoreferencing / src / org / gvsig / georeferencing / ui / options / CheckOptionsPanel.java @ 18530
History | View | Annotate | Download (3.98 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.raster.util.RasterToolsUtil; |
30 |
|
31 |
/**
|
32 |
* Panel de selecci?n de tipo de georreferenciaci?n.
|
33 |
*
|
34 |
* 10/01/2008
|
35 |
* @author Nacho Brodin nachobrodin@gmail.com
|
36 |
*/
|
37 |
public class CheckOptionsPanel extends JPanel { |
38 |
private static final long serialVersionUID = 1L; |
39 |
|
40 |
private JCheckBox showNumber = null; |
41 |
private JCheckBox addErrorInCSV = null; |
42 |
private JCheckBox centerPoint = null; |
43 |
private ColorSelector backgroundColorSel = null; |
44 |
private ColorSelector textColorSel = null; |
45 |
|
46 |
/**
|
47 |
* Constructor. Asigna la lista de nombres de vistas para el selector.
|
48 |
* @param viewList
|
49 |
*/
|
50 |
public CheckOptionsPanel() {
|
51 |
init(); |
52 |
} |
53 |
|
54 |
/**
|
55 |
* Acciones de inicializaci?n del panel
|
56 |
*/
|
57 |
public void init() { |
58 |
GridBagLayout gl = new GridBagLayout(); |
59 |
setLayout(gl); |
60 |
setBorder(javax.swing.BorderFactory.createTitledBorder(null, RasterToolsUtil.getText(this, "options"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
61 |
|
62 |
GridBagConstraints gbc = new GridBagConstraints(); |
63 |
gbc.anchor = GridBagConstraints.WEST;
|
64 |
gbc.insets = new Insets(0, 5, 5, 0); |
65 |
add(getBackGroundColorSelector(), gbc); |
66 |
|
67 |
gbc.gridy = 1;
|
68 |
add(getTextSelector(), gbc); |
69 |
|
70 |
gbc.weightx = 1.0;
|
71 |
gbc.fill = GridBagConstraints.HORIZONTAL;
|
72 |
|
73 |
gbc.gridy = 2;
|
74 |
add(getShowNumberCheck(), gbc); |
75 |
|
76 |
gbc.gridy = 3;
|
77 |
add(getAddErrorsCSVCheck(), gbc); |
78 |
|
79 |
gbc.gridy = 4;
|
80 |
add(getCenterViewCheck(), gbc); |
81 |
} |
82 |
|
83 |
/**
|
84 |
* Obtiene el selector de color para el fondo
|
85 |
* @return JButton
|
86 |
*/
|
87 |
public ColorSelector getBackGroundColorSelector() {
|
88 |
if(backgroundColorSel == null) { |
89 |
backgroundColorSel = new ColorSelector(Color.BLACK, RasterToolsUtil.getText(this, "background_color")); |
90 |
} |
91 |
return backgroundColorSel;
|
92 |
} |
93 |
|
94 |
/**
|
95 |
* Obtiene el selector de color para el texto
|
96 |
* @return JButton
|
97 |
*/
|
98 |
public ColorSelector getTextSelector() {
|
99 |
if(textColorSel == null) { |
100 |
textColorSel = new ColorSelector(Color.RED, RasterToolsUtil.getText(this, "text_color")); |
101 |
} |
102 |
return textColorSel;
|
103 |
} |
104 |
|
105 |
/**
|
106 |
* Obtiene el check de mostrar numeraci?n
|
107 |
* @return JCheckBox
|
108 |
*/
|
109 |
public JCheckBox getShowNumberCheck() { |
110 |
if(showNumber == null) { |
111 |
showNumber = new JCheckBox(RasterToolsUtil.getText(this, "show_number")); |
112 |
} |
113 |
return showNumber;
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* Obtiene el check de a?adir errores al fichero CSV o no
|
118 |
* @return JCheckBox
|
119 |
*/
|
120 |
public JCheckBox getAddErrorsCSVCheck() { |
121 |
if(addErrorInCSV == null) { |
122 |
addErrorInCSV = new JCheckBox(RasterToolsUtil.getText(this, "add_errors_csv")); |
123 |
} |
124 |
return addErrorInCSV;
|
125 |
} |
126 |
|
127 |
/**
|
128 |
* Obtiene el check de centrar la vista sobre el punto seleccionado
|
129 |
* @return JCheckBox
|
130 |
*/
|
131 |
public JCheckBox getCenterViewCheck() { |
132 |
if(centerPoint == null) { |
133 |
centerPoint = new JCheckBox(RasterToolsUtil.getText(this, "center_view")); |
134 |
} |
135 |
return centerPoint;
|
136 |
} |
137 |
|
138 |
//-------Consulta de propiedades seleccionadas---------
|
139 |
|
140 |
} |
141 |
|