svn-gvsig-desktop / trunk / extensions / extGeoreferencing / src / com / iver / cit / gvsig / gui / panels / GeorefOptionsPanel.java @ 4831
History | View | Annotate | Download (5.4 KB)
1 |
package com.iver.cit.gvsig.gui.panels; |
---|---|
2 |
|
3 |
import java.awt.BorderLayout; |
4 |
import java.awt.FlowLayout; |
5 |
import java.awt.GridBagConstraints; |
6 |
import java.awt.GridBagLayout; |
7 |
import java.awt.event.ActionListener; |
8 |
import java.io.File; |
9 |
|
10 |
import javax.swing.JComboBox; |
11 |
import javax.swing.JFileChooser; |
12 |
import javax.swing.JLabel; |
13 |
import javax.swing.JPanel; |
14 |
|
15 |
import com.iver.andami.PluginServices; |
16 |
import com.iver.cit.gvsig.gui.dialogs.GeoreferencingDialog; |
17 |
/**
|
18 |
* Panel que contiene opciones de georreferenciaci?n a elegir por
|
19 |
* el usuario. Esta clase no maneja eventos.
|
20 |
*
|
21 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
22 |
*
|
23 |
*/
|
24 |
public class GeorefOptionsPanel extends JPanel implements ActionListener{ |
25 |
|
26 |
|
27 |
private JPanel pGeneral = null; |
28 |
private JPanel pGrado = null; |
29 |
private GeoreferencingDialog grd = null; |
30 |
|
31 |
private JLabel lGrado = null; |
32 |
private JComboBox cbGrado = null; |
33 |
private JPanel pAlgoritmo = null; |
34 |
private JLabel lAlgoritmo = null; |
35 |
private JComboBox cbAlgoritmo = null; |
36 |
private JPanel jPanel = null; |
37 |
private JPanel jPanel1 = null; |
38 |
|
39 |
/**
|
40 |
* This is the default constructor
|
41 |
*/
|
42 |
public GeorefOptionsPanel(GeoreferencingDialog grd) {
|
43 |
super();
|
44 |
this.grd = grd;
|
45 |
initialize(); |
46 |
} |
47 |
|
48 |
/**
|
49 |
* This method initializes this
|
50 |
*
|
51 |
* @return void
|
52 |
*/
|
53 |
private void initialize() { |
54 |
this.setLayout(new BorderLayout()); |
55 |
this.setPreferredSize(new java.awt.Dimension(380,160)); |
56 |
this.setBounds(0, 0, 380, 160); |
57 |
this.add(getPGeneral(), java.awt.BorderLayout.CENTER);
|
58 |
} |
59 |
|
60 |
/**
|
61 |
* This method initializes jPanel
|
62 |
*
|
63 |
* @return javax.swing.JPanel
|
64 |
*/
|
65 |
private JPanel getPGeneral() { |
66 |
if (pGeneral == null) { |
67 |
GridBagConstraints gridBagConstraints7 = new GridBagConstraints(); |
68 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
69 |
GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); |
70 |
pGeneral = new JPanel(); |
71 |
pGeneral.setLayout(new GridBagLayout()); |
72 |
pGeneral.setPreferredSize(new java.awt.Dimension(380,20)); |
73 |
gridBagConstraints5.gridx = 0;
|
74 |
gridBagConstraints5.gridy = 0;
|
75 |
gridBagConstraints5.anchor = java.awt.GridBagConstraints.CENTER; |
76 |
gridBagConstraints5.gridheight = 1;
|
77 |
gridBagConstraints5.gridwidth = 1;
|
78 |
gridBagConstraints1.gridx = 0;
|
79 |
gridBagConstraints1.gridy = 1;
|
80 |
gridBagConstraints7.gridx = 0;
|
81 |
gridBagConstraints7.gridy = 2;
|
82 |
pGeneral.add(getPGrado(), gridBagConstraints5); |
83 |
pGeneral.add(getPAlgoritmo(), gridBagConstraints1); |
84 |
pGeneral.add(getJPanel(), gridBagConstraints7); |
85 |
} |
86 |
return pGeneral;
|
87 |
} |
88 |
/**
|
89 |
* This method initializes jPanel1
|
90 |
*
|
91 |
* @return javax.swing.JPanel
|
92 |
*/
|
93 |
private JPanel getPGrado() { |
94 |
if (pGrado == null) { |
95 |
lGrado = new JLabel(); |
96 |
FlowLayout flowLayout6 = new FlowLayout(); |
97 |
pGrado = new JPanel(); |
98 |
pGrado.setLayout(flowLayout6); |
99 |
pGrado.setPreferredSize(new java.awt.Dimension(370,30)); |
100 |
pGrado.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0)); |
101 |
flowLayout6.setAlignment(java.awt.FlowLayout.LEFT); |
102 |
flowLayout6.setHgap(10);
|
103 |
flowLayout6.setVgap(3);
|
104 |
lGrado.setText(PluginServices.getText(this,"grado_polinomio")); |
105 |
pGrado.add(lGrado, null);
|
106 |
pGrado.add(getCbGrado(), null);
|
107 |
} |
108 |
return pGrado;
|
109 |
} |
110 |
|
111 |
/*if(e.getSource() == this.){
|
112 |
|
113 |
}*/
|
114 |
/**
|
115 |
* This method initializes jComboBox
|
116 |
*
|
117 |
* @return javax.swing.JComboBox
|
118 |
*/
|
119 |
private JComboBox getCbGrado() { |
120 |
if (cbGrado == null) { |
121 |
cbGrado = new JComboBox(); |
122 |
} |
123 |
return cbGrado;
|
124 |
} |
125 |
/**
|
126 |
* This method initializes jPanel
|
127 |
*
|
128 |
* @return javax.swing.JPanel
|
129 |
*/
|
130 |
private JPanel getPAlgoritmo() { |
131 |
if (pAlgoritmo == null) { |
132 |
lAlgoritmo = new JLabel(); |
133 |
FlowLayout flowLayout2 = new FlowLayout(); |
134 |
pAlgoritmo = new JPanel(); |
135 |
pAlgoritmo.setLayout(flowLayout2); |
136 |
lAlgoritmo.setText(PluginServices.getText(this,"algoritmo")); |
137 |
pAlgoritmo.setPreferredSize(new java.awt.Dimension(370,30)); |
138 |
flowLayout2.setAlignment(java.awt.FlowLayout.LEFT); |
139 |
flowLayout2.setHgap(10);
|
140 |
flowLayout2.setVgap(3);
|
141 |
pAlgoritmo.add(lAlgoritmo, null);
|
142 |
pAlgoritmo.add(getCbAlgoritmo(), null);
|
143 |
} |
144 |
return pAlgoritmo;
|
145 |
} |
146 |
/**
|
147 |
* This method initializes jComboBox
|
148 |
*
|
149 |
* @return javax.swing.JComboBox
|
150 |
*/
|
151 |
private JComboBox getCbAlgoritmo() { |
152 |
if (cbAlgoritmo == null) { |
153 |
cbAlgoritmo = new JComboBox(); |
154 |
} |
155 |
return cbAlgoritmo;
|
156 |
} |
157 |
/**
|
158 |
* This method initializes jPanel
|
159 |
*
|
160 |
* @return javax.swing.JPanel
|
161 |
*/
|
162 |
private JPanel getJPanel() { |
163 |
if (jPanel == null) { |
164 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
165 |
gridBagConstraints.gridx = 0;
|
166 |
gridBagConstraints.insets = new java.awt.Insets(0,0,0,0); |
167 |
gridBagConstraints.gridy = 0;
|
168 |
jPanel = new JPanel(); |
169 |
jPanel.setLayout(new GridBagLayout()); |
170 |
jPanel.setPreferredSize(new java.awt.Dimension(370,75)); |
171 |
jPanel.add(getJPanel1(), gridBagConstraints); |
172 |
} |
173 |
return jPanel;
|
174 |
} |
175 |
|
176 |
/**
|
177 |
* Acci?n cuando se pulsa el bot?n de aceptar en el dialogo.
|
178 |
* <UL>
|
179 |
* <LI>Cambiamos el nombre a la capa georraster</LI>
|
180 |
* <LI>A la capa Georraster le asignamos la capa de puntos para poder recuperarla</LI>
|
181 |
* <LI>Cerramos la ventana</LI>
|
182 |
* </UL>
|
183 |
*/
|
184 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
185 |
|
186 |
} |
187 |
|
188 |
/**
|
189 |
* This method initializes jPanel1
|
190 |
*
|
191 |
* @return javax.swing.JPanel
|
192 |
*/
|
193 |
private JPanel getJPanel1() { |
194 |
if (jPanel1 == null) { |
195 |
jPanel1 = new OptionsPanel(this.grd); |
196 |
jPanel1.setPreferredSize(new java.awt.Dimension(370,20)); |
197 |
jPanel1.setSize(new java.awt.Dimension(370,20)); |
198 |
jPanel1.setVisible(true);
|
199 |
} |
200 |
return jPanel1;
|
201 |
} |
202 |
} |