svn-gvsig-desktop / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / saveraster / ui / SaveRasterPanel.java @ 21738
History | View | Annotate | Download (6.75 KB)
1 | 15620 | nbrodin | /* 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.rastertools.saveraster.ui; |
||
20 | |||
21 | import java.awt.GridBagConstraints; |
||
22 | import java.awt.GridBagLayout; |
||
23 | |||
24 | import javax.swing.JButton; |
||
25 | import javax.swing.JComboBox; |
||
26 | import javax.swing.JLabel; |
||
27 | import javax.swing.JPanel; |
||
28 | import javax.swing.JRadioButton; |
||
29 | |||
30 | import org.cresques.cts.IProjection; |
||
31 | import org.gvsig.gui.beans.datainput.DataInputContainer; |
||
32 | import org.gvsig.rastertools.saveraster.ui.panels.SelectFilePanel; |
||
33 | import org.gvsig.rastertools.saveraster.ui.panels.SelectionParamsPanel; |
||
34 | import org.gvsig.rastertools.saveraster.ui.panels.WCCoordsInputPanel; |
||
35 | |||
36 | /**
|
||
37 | * Panel General de salvar a raster.
|
||
38 | *
|
||
39 | * 05/10/2007
|
||
40 | * @author Nacho Brodin nachobrodin@gmail.com
|
||
41 | */
|
||
42 | public class SaveRasterPanel extends JPanel { |
||
43 | private static final long serialVersionUID = 1L; |
||
44 | private WCCoordsInputPanel wcCoordsPanel = null; |
||
45 | private SelectionParamsPanel paramsPanel = null; |
||
46 | private SelectFilePanel filePanel = null; |
||
47 | private IProjection proj = null; |
||
48 | |||
49 | /**
|
||
50 | * This is the default constructor
|
||
51 | */
|
||
52 | public SaveRasterPanel() {
|
||
53 | super();
|
||
54 | initialize(); |
||
55 | } |
||
56 | |||
57 | /**
|
||
58 | * This method initializes this
|
||
59 | *
|
||
60 | * @return void
|
||
61 | */
|
||
62 | private void initialize() { |
||
63 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
||
64 | gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
|
||
65 | gridBagConstraints.weightx = 1.0;
|
||
66 | |||
67 | setLayout(new GridBagLayout()); |
||
68 | |||
69 | gridBagConstraints.gridy = 0;
|
||
70 | add(getWCCoordsPanel(), gridBagConstraints); |
||
71 | |||
72 | gridBagConstraints.weighty = 1.0;
|
||
73 | gridBagConstraints.fill = GridBagConstraints.BOTH;
|
||
74 | gridBagConstraints.gridy = 1;
|
||
75 | add(getSelectionParamsPanel(), gridBagConstraints); |
||
76 | |||
77 | gridBagConstraints.gridy = 2;
|
||
78 | add(getSelectFilePanel(), gridBagConstraints); |
||
79 | } |
||
80 | |||
81 | /**
|
||
82 | * Obtiene el panel de selecci?n de coordenadas
|
||
83 | * @return WCCoordsInputPanel
|
||
84 | */
|
||
85 | public WCCoordsInputPanel getWCCoordsPanel() {
|
||
86 | if(wcCoordsPanel == null) |
||
87 | wcCoordsPanel = new WCCoordsInputPanel();
|
||
88 | return wcCoordsPanel;
|
||
89 | } |
||
90 | |||
91 | /**
|
||
92 | * Obtiene el panel de selecci?n de par?metros
|
||
93 | * @return SelectionParamsPanel
|
||
94 | */
|
||
95 | public SelectionParamsPanel getSelectionParamsPanel() {
|
||
96 | if(paramsPanel == null) |
||
97 | paramsPanel = new SelectionParamsPanel();
|
||
98 | return paramsPanel;
|
||
99 | } |
||
100 | |||
101 | /**
|
||
102 | * Obtiene el panel de selecci?n de ficheros
|
||
103 | * @return SelectFilePanel
|
||
104 | */
|
||
105 | public SelectFilePanel getSelectFilePanel() {
|
||
106 | if(filePanel == null) |
||
107 | filePanel = new SelectFilePanel();
|
||
108 | return filePanel;
|
||
109 | } |
||
110 | |||
111 | //-------------------------------------------
|
||
112 | /**
|
||
113 | * Obtiene la etiqueta del nombre de fichero seleccionado
|
||
114 | * return JLabel
|
||
115 | */
|
||
116 | public JLabel getLFileName() { |
||
117 | return getSelectFilePanel().getLabelText();
|
||
118 | } |
||
119 | |||
120 | /**
|
||
121 | * Obtiene el bot?n de propiedades
|
||
122 | * @return JButton
|
||
123 | */
|
||
124 | public JButton getBProperties() { |
||
125 | return getSelectFilePanel().getBProperties();
|
||
126 | } |
||
127 | |||
128 | /**
|
||
129 | * Obtiene la entrada de texto correspondiente a la X de la esquina superior izquierda
|
||
130 | * @return DataInputContainer
|
||
131 | */
|
||
132 | public DataInputContainer getTSupIzqX() {
|
||
133 | return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer11();
|
||
134 | } |
||
135 | |||
136 | /**
|
||
137 | * Obtiene la entrada de texto correspondiente a la Y de la esquina superior izquierda
|
||
138 | * @return DataInputContainer
|
||
139 | */
|
||
140 | public DataInputContainer getTSupIzqY() {
|
||
141 | return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer12();
|
||
142 | } |
||
143 | |||
144 | /**
|
||
145 | * Obtiene la entrada de texto correspondiente a la X de la esquina inferior derecha
|
||
146 | * @return DataInputContainer
|
||
147 | */
|
||
148 | public DataInputContainer getTInfDerX() {
|
||
149 | return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer21();
|
||
150 | } |
||
151 | |||
152 | /**
|
||
153 | * Obtiene la entrada de texto correspondiente a la Y de la esquina inferior derecha
|
||
154 | * @return DataInputContainer
|
||
155 | */
|
||
156 | public DataInputContainer getTInfDerY() {
|
||
157 | return getWCCoordsPanel().getCoordinatesPanel().getDataInputContainer22();
|
||
158 | } |
||
159 | |||
160 | /**
|
||
161 | * Obtiene el bot?n de selecci?n de fichero
|
||
162 | * @return JButton
|
||
163 | */
|
||
164 | public JButton getBSelect() { |
||
165 | return getSelectFilePanel().getBSelect();
|
||
166 | } |
||
167 | |||
168 | /**
|
||
169 | * Obtiene la entrada de texto correspondiente al ancho
|
||
170 | * @return DataInputContainer
|
||
171 | */
|
||
172 | public DataInputContainer getTWidth() {
|
||
173 | return getSelectionParamsPanel().getInputSizePanel().getTWidth();
|
||
174 | } |
||
175 | |||
176 | /**
|
||
177 | * Obtiene la entrada de texto correspondiente al alto
|
||
178 | * @return DataInputContainer
|
||
179 | */
|
||
180 | public DataInputContainer getTHeight() {
|
||
181 | return getSelectionParamsPanel().getInputSizePanel().getTHeight();
|
||
182 | } |
||
183 | |||
184 | public JComboBox getCbMeasureType() { |
||
185 | return getSelectionParamsPanel().getInputSizePanel().getCbMeasureType();
|
||
186 | } |
||
187 | |||
188 | /**
|
||
189 | * Obtiene la entrada de texto correspondiente a la escala
|
||
190 | * @return DataInputContainer
|
||
191 | */
|
||
192 | public DataInputContainer getTScale() {
|
||
193 | return getSelectionParamsPanel().getInputScalePanel().getTScale();
|
||
194 | } |
||
195 | |||
196 | /**
|
||
197 | * Obtiene el combo que informa de la resoluci?n seleccionada
|
||
198 | * @return JComboBox
|
||
199 | */
|
||
200 | public JComboBox getCbResolution() { |
||
201 | return getSelectionParamsPanel().getInputScalePanel().getCbResolution();
|
||
202 | } |
||
203 | |||
204 | /**
|
||
205 | * Obtiene la entrada de texto correspondiente a los metros por pixel
|
||
206 | * @return DataInputContainer
|
||
207 | */
|
||
208 | public DataInputContainer getTMtsPixel() {
|
||
209 | return getSelectionParamsPanel().getInputScalePanel().getTMtsPixel();
|
||
210 | } |
||
211 | |||
212 | /**
|
||
213 | * Obtiene el RadioButton correspondiente a la escala
|
||
214 | * @return JRadioButton
|
||
215 | */
|
||
216 | public JRadioButton getRbScale() { |
||
217 | return getSelectionParamsPanel().getSelectorPanel().getRbScale();
|
||
218 | } |
||
219 | |||
220 | /**
|
||
221 | * Obtiene el RadioButton correspondiente a los metros por pixel
|
||
222 | * @return JRadioButton
|
||
223 | */
|
||
224 | public JRadioButton getRbMtsPixel() { |
||
225 | return getSelectionParamsPanel().getSelectorPanel().getRbMtsPixel();
|
||
226 | } |
||
227 | |||
228 | /**
|
||
229 | * Obtiene el RadioButton correspondiente al tama?o
|
||
230 | * @return JRadioButton
|
||
231 | */
|
||
232 | public JRadioButton getRbSize() { |
||
233 | return getSelectionParamsPanel().getSelectorPanel().getRbSize();
|
||
234 | } |
||
235 | |||
236 | /**
|
||
237 | * Asigna la proyecci?n
|
||
238 | * @param proj Interfaz IProjection
|
||
239 | */
|
||
240 | public void setProjection(IProjection proj) { |
||
241 | this.proj = proj;
|
||
242 | } |
||
243 | |||
244 | /**
|
||
245 | * Obtiene la proyecci?n
|
||
246 | * @return Interfaz IProjection
|
||
247 | */
|
||
248 | public IProjection getProjection() {
|
||
249 | return proj;
|
||
250 | } |
||
251 | } |