Revision 11570 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/wizard/MainPanel.java
MainPanel.java | ||
---|---|---|
9 | 9 |
import javax.swing.JButton; |
10 | 10 |
import javax.swing.JPanel; |
11 | 11 |
|
12 |
import org.gvsig.crs.ICrs; |
|
13 |
|
|
12 | 14 |
import com.iver.andami.PluginServices; |
13 | 15 |
import com.iver.andami.ui.mdiManager.IWindow; |
14 | 16 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
... | ... | |
16 | 18 |
|
17 | 19 |
/** |
18 | 20 |
* |
19 |
* @author Luisa Marina Fern?ndez (luisam.fernandez@uclm.es)
|
|
21 |
* @author Luisa Marina Fernndez (luisam.fernandez@uclm.es) |
|
20 | 22 |
* |
21 | 23 |
*/ |
22 | 24 |
public class MainPanel extends JPanel implements ActionListener,IWindow { |
... | ... | |
37 | 39 |
final static String CRSUSUARIOPANEL = "CrsUsuario"; |
38 | 40 |
final static String DEFINIRDATUMPANEL = "DefinirDatum"; |
39 | 41 |
final static String SISTEMACOORDENADASPANEL = "SistemaCoordenadas"; |
42 |
|
|
43 |
private ICrs currentCrs; |
|
40 | 44 |
|
41 |
public MainPanel() { |
|
45 |
public MainPanel(ICrs crs) {
|
|
42 | 46 |
super(); |
47 |
setCrs(crs); |
|
43 | 48 |
this.setLayout(new BorderLayout()); |
44 | 49 |
this.add(getPCard(),BorderLayout.CENTER); |
45 | 50 |
this.add(getPSouth(),BorderLayout.SOUTH); |
46 | 51 |
} |
47 | 52 |
/** |
48 |
* Inicilizar el bot?n Anterior
|
|
53 |
* Inicilizar el botn Anterior |
|
49 | 54 |
* @return |
50 | 55 |
*/ |
51 | 56 |
public JButton getBtnAnterior() { |
... | ... | |
58 | 63 |
return btnAnterior; |
59 | 64 |
} |
60 | 65 |
/** |
61 |
* Inicilizar el bot?n Cancelar
|
|
66 |
* Inicilizar el botn Cancelar |
|
62 | 67 |
* @return |
63 | 68 |
*/ |
64 | 69 |
public JButton getBtnCancelar() { |
... | ... | |
70 | 75 |
return btnCancelar; |
71 | 76 |
} |
72 | 77 |
/** |
73 |
* Inicilizar el bot?n Finalizar
|
|
78 |
* Inicilizar el botn Finalizar |
|
74 | 79 |
* @return |
75 | 80 |
*/ |
76 | 81 |
public JButton getBtnFinalizar() { |
... | ... | |
82 | 87 |
return btnFinalizar; |
83 | 88 |
} |
84 | 89 |
/** |
85 |
* Inicilizar el bot?n Siguiente
|
|
90 |
* Inicilizar el botn Siguiente |
|
86 | 91 |
* @return |
87 | 92 |
*/ |
88 | 93 |
public JButton getBtnSiguiente() { |
... | ... | |
128 | 133 |
} |
129 | 134 |
public DefCrsUsr getPCrsUsr() { |
130 | 135 |
if(pCrsUsr==null){ |
131 |
pCrsUsr=new DefCrsUsr(); |
|
136 |
pCrsUsr=new DefCrsUsr(getCrs());
|
|
132 | 137 |
} |
133 | 138 |
return pCrsUsr; |
134 | 139 |
} |
... | ... | |
151 | 156 |
if(e.getSource().equals(getBtnAnterior())){ |
152 | 157 |
|
153 | 158 |
if(getPCrsUsr().isShowing()){ |
154 |
//Se est? mostrando el primer panel del Wizard
|
|
155 |
|
|
159 |
//Se est mostrando el primer panel del Wizard |
|
160 |
getBtnAnterior().setVisible(false); |
|
156 | 161 |
}else{ |
157 | 162 |
//Mostrar el panel anterior |
158 | 163 |
cl.previous(pCard); |
... | ... | |
163 | 168 |
System.out.println("Dentro de botonAnterior"); |
164 | 169 |
} |
165 | 170 |
}else if(e.getSource().equals(getBtnSiguiente())){ |
166 |
cl.next(pCard); |
|
171 |
if (getPCrsUsr().isShowing() && getPCrsUsr().getRbCrsExistente().isSelected() ){ |
|
172 |
String authority = getPCrsUsr().getLblCrs().getText(); |
|
173 |
fillData(authority); |
|
174 |
} |
|
175 |
cl.next(pCard); |
|
176 |
getBtnAnterior().setVisible(true); |
|
177 |
//Si aparece el ultimo panel visualizar el botn finalizar |
|
178 |
if (getPSistCoord().isShowing()){ |
|
179 |
getBtnFinalizar().setVisible(true); |
|
180 |
getBtnSiguiente().setVisible(false); |
|
167 | 181 |
getBtnAnterior().setVisible(true); |
168 |
//Si aparece el ultimo panel visualizar el bot?n finalizar |
|
169 |
if (getPSistCoord().isShowing()){ |
|
170 |
getBtnFinalizar().setVisible(true); |
|
171 |
getBtnSiguiente().setVisible(false); |
|
172 |
getBtnAnterior().setVisible(true); |
|
173 | 182 |
} |
183 |
|
|
184 |
|
|
174 | 185 |
}else if(e.getSource().equals(getBtnFinalizar())){ |
175 | 186 |
//Realizar las acciones de fin del Wizard |
176 | 187 |
System.out.println("Finalizar el Asistente"); |
... | ... | |
190 | 201 |
m_viewinfo.setHeight(390); |
191 | 202 |
return m_viewinfo; |
192 | 203 |
} |
204 |
|
|
205 |
public ICrs getCrs () { |
|
206 |
return currentCrs; |
|
207 |
} |
|
208 |
|
|
209 |
public void setCrs (ICrs crs) { |
|
210 |
currentCrs = crs; |
|
211 |
} |
|
212 |
|
|
213 |
|
|
214 |
|
|
215 |
private void fillData(String authority) { |
|
216 |
getPDatum().fillData(getCrs()); |
|
217 |
getPSistCoord().fillData(getCrs()); |
|
218 |
} |
|
193 | 219 |
|
194 | 220 |
|
195 | 221 |
} |
Also available in: Unified diff