svn-gvsig-desktop / trunk / extensions / extRasterTools / src / com / iver / cit / gvsig / rasterTools / saveRaster / ui / SaveRasterControlsPanel.java @ 4468
History | View | Annotate | Download (7.95 KB)
1 |
package com.iver.cit.gvsig.rasterTools.saveRaster.ui; |
---|---|
2 |
|
3 |
import java.awt.GridBagConstraints; |
4 |
import java.awt.GridBagLayout; |
5 |
|
6 |
import javax.swing.JButton; |
7 |
import javax.swing.JComboBox; |
8 |
import javax.swing.JPanel; |
9 |
import javax.swing.JRadioButton; |
10 |
import javax.swing.JTextField; |
11 |
|
12 |
import com.iver.andami.PluginServices; |
13 |
|
14 |
/**
|
15 |
* Panel General de salvar a raster
|
16 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
17 |
*
|
18 |
*/
|
19 |
public class SaveRasterControlsPanel extends JPanel { |
20 |
|
21 |
//Panels
|
22 |
private JPanel pWorldCoordinates = null; |
23 |
private JPanel pMethod = null; |
24 |
private JPanel pButtons = null; |
25 |
private JPanel pInfDer = null; |
26 |
private JPanel pSupIzq = null; |
27 |
|
28 |
/**
|
29 |
* This is the default constructor
|
30 |
*/
|
31 |
public SaveRasterControlsPanel() {
|
32 |
super();
|
33 |
initialize(); |
34 |
} |
35 |
|
36 |
/**
|
37 |
* Asigna las traducciones del dialogo
|
38 |
*/
|
39 |
public void setTranslation(){ |
40 |
MethodDataInputPanel method = ((MethodDataInputPanel)pMethod); |
41 |
InputScaleDataPanel scaleData = ((InputScaleDataPanel)method.getPEast()); |
42 |
scaleData.getLScale().setText(PluginServices.getText(this,"scale")); |
43 |
scaleData.getLResolution().setText(PluginServices.getText(this,"resolution")); |
44 |
scaleData.getLMtsPixel().setText(PluginServices.getText(this,"mtspixel")); |
45 |
|
46 |
MethodSaveRasterSelectorPanel selector = ((MethodSaveRasterSelectorPanel)method.getPWest()); |
47 |
selector.getRbMtsPixel().setText(PluginServices.getText(this,"mtspixel")); |
48 |
selector.getRbSize().setText(PluginServices.getText(this,"size")); |
49 |
selector.getRbScale().setText(PluginServices.getText(this,"scale")); |
50 |
|
51 |
InputSizeDataPanel size = ((InputSizeDataPanel)method.getPSouth()); |
52 |
size.getLHeight().setText(PluginServices.getText(this,"height")); |
53 |
size.getLWidth().setText(PluginServices.getText(this,"width")); |
54 |
|
55 |
ButtonsPanel but = ((ButtonsPanel)pButtons); |
56 |
but.setTag(PluginServices.getText(this,"file")); |
57 |
but.getBSelect().setText(PluginServices.getText(this,"select")); |
58 |
((DoubleJTextInputPanel)pInfDer).setTexts( PluginServices.getText(this,"linf_der"), |
59 |
PluginServices.getText(this," X: "), |
60 |
PluginServices.getText(this," Y: ")); |
61 |
((DoubleJTextInputPanel)pSupIzq).setTexts( PluginServices.getText(this,"lsup_izq"), |
62 |
PluginServices.getText(this," X: "), |
63 |
PluginServices.getText(this," Y: ")); |
64 |
} |
65 |
|
66 |
/**
|
67 |
* This method initializes this
|
68 |
*
|
69 |
* @return void
|
70 |
*/
|
71 |
private void initialize() { |
72 |
GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); |
73 |
gridBagConstraints2.gridx = 0;
|
74 |
gridBagConstraints2.insets = new java.awt.Insets(3,0,0,0); |
75 |
gridBagConstraints2.gridy = 2;
|
76 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
77 |
gridBagConstraints1.gridx = 0;
|
78 |
gridBagConstraints1.insets = new java.awt.Insets(0,0,0,0); |
79 |
gridBagConstraints1.gridy = 1;
|
80 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
81 |
gridBagConstraints.gridx = 0;
|
82 |
gridBagConstraints.insets = new java.awt.Insets(0,0,3,0); |
83 |
gridBagConstraints.gridy = 0;
|
84 |
this.setLayout(new GridBagLayout()); |
85 |
this.setSize(359, 297); |
86 |
this.setPreferredSize(new java.awt.Dimension(341,232)); |
87 |
this.add(getPWorldCoordinates(), gridBagConstraints);
|
88 |
this.add(getPMethod(), gridBagConstraints1);
|
89 |
this.add(getPButtons(), gridBagConstraints2);
|
90 |
this.setTranslation();
|
91 |
} |
92 |
|
93 |
/**
|
94 |
* This method initializes jPanel
|
95 |
*
|
96 |
* @return javax.swing.JPanel
|
97 |
*/
|
98 |
public JPanel getPWorldCoordinates() { |
99 |
if (pWorldCoordinates == null) { |
100 |
GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
101 |
gridBagConstraints5.gridx = 0;
|
102 |
gridBagConstraints5.gridy = 0;
|
103 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
104 |
gridBagConstraints4.gridx = 0;
|
105 |
gridBagConstraints4.gridy = 0;
|
106 |
GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
107 |
gridBagConstraints3.gridx = 0;
|
108 |
gridBagConstraints3.gridy = 1;
|
109 |
pWorldCoordinates = new JPanel(); |
110 |
pWorldCoordinates.setLayout(new GridBagLayout()); |
111 |
pWorldCoordinates.setPreferredSize(new java.awt.Dimension(351,66)); |
112 |
pWorldCoordinates.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1), "Coordenadas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Default", java.awt.Font.PLAIN, 10), java.awt.Color.black)); |
113 |
pWorldCoordinates.add(getPInfDer(), gridBagConstraints3); |
114 |
pWorldCoordinates.add(getPSupIzq(), gridBagConstraints5); |
115 |
} |
116 |
return pWorldCoordinates;
|
117 |
} |
118 |
|
119 |
/**
|
120 |
* This method initializes jPanel1
|
121 |
*
|
122 |
* @return javax.swing.JPanel
|
123 |
*/
|
124 |
public JPanel getPMethod() { |
125 |
if (pMethod == null) { |
126 |
pMethod = new MethodDataInputPanel();
|
127 |
pMethod.setPreferredSize(new java.awt.Dimension(351,145)); |
128 |
pMethod.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Seleccion", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10), null)); |
129 |
} |
130 |
return pMethod;
|
131 |
} |
132 |
|
133 |
/**
|
134 |
* This method initializes jPanel2
|
135 |
*
|
136 |
* @return javax.swing.JPanel
|
137 |
*/
|
138 |
public JPanel getPButtons() { |
139 |
if (pButtons == null) { |
140 |
pButtons = new ButtonsPanel();
|
141 |
pButtons.setPreferredSize(new java.awt.Dimension(351,68)); |
142 |
pButtons.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fichero", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10), null)); |
143 |
} |
144 |
return pButtons;
|
145 |
} |
146 |
|
147 |
/**
|
148 |
* This method initializes jPanel
|
149 |
*
|
150 |
* @return javax.swing.JPanel
|
151 |
*/
|
152 |
public JPanel getPInfDer() { |
153 |
if (pInfDer == null) { |
154 |
pInfDer = new DoubleJTextInputPanel();
|
155 |
((DoubleJTextInputPanel)pInfDer).setWidthText1(105);
|
156 |
((DoubleJTextInputPanel)pInfDer).setWidthText2(105);
|
157 |
pInfDer.setPreferredSize(new java.awt.Dimension(337,21)); |
158 |
} |
159 |
return pInfDer;
|
160 |
} |
161 |
|
162 |
/**
|
163 |
* This method initializes jPanel1
|
164 |
*
|
165 |
* @return javax.swing.JPanel
|
166 |
*/
|
167 |
public JPanel getPSupIzq() { |
168 |
if (pSupIzq == null) { |
169 |
pSupIzq = new DoubleJTextInputPanel();
|
170 |
((DoubleJTextInputPanel)pSupIzq).setWidthText1(105);
|
171 |
((DoubleJTextInputPanel)pSupIzq).setWidthText2(105);
|
172 |
pSupIzq.setPreferredSize(new java.awt.Dimension(337,21)); |
173 |
} |
174 |
return pSupIzq;
|
175 |
} |
176 |
|
177 |
//-------------------------------------------
|
178 |
|
179 |
public JButton getBProperties(){ |
180 |
return ((ButtonsPanel)pButtons).getBProperties();
|
181 |
} |
182 |
|
183 |
public JButton getBSelect(){ |
184 |
return ((ButtonsPanel)pButtons).getBSelect();
|
185 |
} |
186 |
|
187 |
public JTextField getTSupIzqX(){ |
188 |
return ((DoubleJTextInputPanel)pSupIzq).getJTextField();
|
189 |
} |
190 |
|
191 |
public JTextField getTSupIzqY(){ |
192 |
return ((DoubleJTextInputPanel)pSupIzq).getJTextField1();
|
193 |
} |
194 |
|
195 |
public JTextField getTInfDerX(){ |
196 |
return ((DoubleJTextInputPanel)pInfDer).getJTextField();
|
197 |
} |
198 |
|
199 |
public JTextField getTInfDerY(){ |
200 |
return ((DoubleJTextInputPanel)pInfDer).getJTextField1();
|
201 |
} |
202 |
|
203 |
public JTextField getTWidth(){ |
204 |
return ((InputSizeDataPanel)((MethodDataInputPanel)pMethod).getPSouth()).getTWidth();
|
205 |
} |
206 |
|
207 |
public JTextField getTHeight(){ |
208 |
return ((InputSizeDataPanel)((MethodDataInputPanel)pMethod).getPSouth()).getTHeight();
|
209 |
} |
210 |
|
211 |
public JComboBox getCbMeasureType(){ |
212 |
return ((InputSizeDataPanel)((MethodDataInputPanel)pMethod).getPSouth()).getCbMeasureType();
|
213 |
} |
214 |
|
215 |
public JTextField getTScale(){ |
216 |
return ((InputScaleDataPanel)((MethodDataInputPanel)pMethod).getPEast()).getTScale();
|
217 |
} |
218 |
|
219 |
public JComboBox getCbResolution(){ |
220 |
return ((InputScaleDataPanel)((MethodDataInputPanel)pMethod).getPEast()).getCbResolution();
|
221 |
} |
222 |
|
223 |
public JTextField getTMtsPixel(){ |
224 |
return ((InputScaleDataPanel)((MethodDataInputPanel)pMethod).getPEast()).getTMtsPixel();
|
225 |
} |
226 |
|
227 |
public JRadioButton getRbScale(){ |
228 |
return ((MethodSaveRasterSelectorPanel)((MethodDataInputPanel)pMethod).getPEast()).getRbScale();
|
229 |
} |
230 |
|
231 |
public JRadioButton getRbMtsPixel(){ |
232 |
return ((MethodSaveRasterSelectorPanel)((MethodDataInputPanel)pMethod).getPEast()).getRbMtsPixel();
|
233 |
} |
234 |
|
235 |
public JRadioButton getRbSize(){ |
236 |
return ((MethodSaveRasterSelectorPanel)((MethodDataInputPanel)pMethod).getPEast()).getRbSize();
|
237 |
} |
238 |
|
239 |
|
240 |
} |