Revision 10786 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/CRSMainTrPanel.java

View differences:

CRSMainTrPanel.java
44 44
import java.awt.CardLayout;
45 45
import java.awt.Dimension;
46 46
import java.awt.FlowLayout;
47
import java.awt.GridLayout;
48 47

  
49 48
import javax.swing.JButton;
50 49
import javax.swing.JComboBox;
51 50
import javax.swing.JLabel;
52 51
import javax.swing.JPanel;
53 52
import javax.swing.ListSelectionModel;
53
import javax.swing.border.EmptyBorder;
54 54

  
55 55
import org.cresques.cts.IProjection;
56 56
import org.gvsig.crs.CrsException;
......
73 73
 * asignarle una transformaci?n.
74 74
 * 
75 75
 * @author Jos? Luis G?mez Mart?nez (jolugomar@gmail.com)
76
 * @author Luisa Marina Fernandez (luisam.fernandez@uclm.es)
76 77
 *
77 78
 */
78 79

  
......
91 92
	private JButton jButtonAccept = null;
92 93
	private JButton jButtonBefore = null;
93 94
	private JPanel jPanelButtons = null;
95
	private JLabel jLabelTrans=null;
94 96
	
95 97
	boolean targetNad = false;	
96 98
	
......
99 101
		
100 102
	int transformation_code = 0;	
101 103
	
102
	private JPanel panel = null;
104
	//**private JPanel panel = null;
103 105
	CRSMainPanel viewPan = null;
104 106
	
105 107
	private JPanel jPanelMain = null;
......
147 149
		jPanelMain.add("epsg", epsgTrPanel);
148 150
		jPanelMain.add("nad", nadsTrPanel);
149 151
		jPanelMain.add("recents", recentsTrPanel);
150
				
151
		this.add(jPanelMain, BorderLayout.CENTER);
152 152
		
153
		this.setLayout(new BorderLayout());	
154
		this.add(jPanelMain, BorderLayout.CENTER);
153 155
		this.add(getButtons(), BorderLayout.SOUTH);
154 156
		
155 157
		setListeners();
......
165 167
	 */
166 168
	private JPanel viewPanel(){
167 169
		JPanel integro = new JPanel();
168
		integro.setLayout(new GridLayout(0,1));
169
		integro.setLayout(new FlowLayout(FlowLayout.LEFT,10,10));
170
		integro.setPreferredSize(new Dimension(560,300));
171
		
172
		integro.add(viewPan.capa(), null);
173
		integro.add(getJPanel(), null);
170
		integro.setLayout(new BorderLayout());
171
		integro.setBorder(new EmptyBorder(5,5,5,5));
172
	
173
		integro.add(viewPan.capa(),BorderLayout.CENTER);
174
		//**integro.add(getJPanel(), null);
175
		integro.add(getCombopanel(),BorderLayout.SOUTH);
174 176
		return integro;
175 177
	}
176 178
	
177
	 
178
	private JPanel getJPanel() {
179
		if (panel == null){
180
			panel = new JPanel();
181
			panel.setPreferredSize(new Dimension(540,80));
182
			panel.setLayout(new GridLayout(0,2));
183
			panel.setLayout(new FlowLayout(FlowLayout.LEFT,10,10));			
184
			panel.add(getCombopanel(), null);			
185
		}
186
		return panel;
187
	}	
188
	
179
	/**
180
	 * Define el panel en el que se integran el label y el combobox 
181
	 * de transformaciones
182
	 */
189 183
	public JPanel getCombopanel(){
190 184
		if (jPanelCombo == null){
191 185
			jPanelCombo = new JPanel();
192
			jPanelCombo.setPreferredSize(new Dimension(400,30));			
186
			jPanelCombo.setLayout(new FlowLayout(FlowLayout.LEFT,10,10));
193 187
			jPanelCombo.add(getJLabelTrans());
194 188
			jPanelCombo.add(getJComboOptions());
195 189
		}
196 190
		
197 191
		return jPanelCombo;
198 192
	}
199
	
193
	/**
194
	 * Inicializa la etiqueta 'Seleccione Transformaci?n'
195
	 * @return
196
	 */
200 197
	private JLabel getJLabelTrans(){
201
		JLabel jLabelTrans = new JLabel();
202
		jLabelTrans.setPreferredSize(new Dimension(180, 25));
203
		jLabelTrans.setText(PluginServices.getText(this, "seleccione_transformacion")+":");
198
		if (jLabelTrans==null){
199
			jLabelTrans = new JLabel();
200
			jLabelTrans.setPreferredSize(new Dimension(180, 25));
201
			jLabelTrans.setText(PluginServices.getText(this, "seleccione_transformacion")+":");
202
		}
204 203
		return jLabelTrans;
205 204
	}
206
	
205
	/**
206
	 * Inicializa el comboBox de Tansformaciones
207
	 * @return
208
	 */
207 209
	public JComboBox getJComboOptions(){
208 210
		if (jComboOptions == null){
209 211
			String[] selection = {PluginServices.getText(this, "sin_transformacion"),
......
218 220
			jComboOptions.setSelectedIndex(0);
219 221
			newSelection = (String) jComboOptions.getSelectedItem();			
220 222
		}
221
//		jComboOptions.addActionListener(this);
222 223
		return jComboOptions;
223 224
	}
224
	
225
	/**
226
	 * Agrega los botones: Aceptar, cancelar, siguiente y finalizar
227
	 * @return
228
	 */
225 229
	private JPanel getButtons() {
226 230
		if(jPanelButtons == null) {
227 231
			jPanelButtons = new JPanel();
228
			jPanelButtons.setPreferredSize(new Dimension(550,50));
229
			jPanelButtons.setLayout(new GridLayout(0,1));
230
			jPanelButtons.setLayout(new FlowLayout(FlowLayout.RIGHT,5,5));
231
			jPanelButtons.add(getJButtonCancel(), null);
232
			jPanelButtons.add(getJButtonBefore(), null);
233
			jPanelButtons.add(getJButtonNext(), null);
234
			jPanelButtons.add(getJButtonAccept(), null);
232
			jPanelButtons.setLayout(new FlowLayout(FlowLayout.RIGHT,10,10));
233
			jPanelButtons.add(getJButtonCancel());
234
			jPanelButtons.add(getJButtonBefore());
235
			jPanelButtons.add(getJButtonNext());
236
			jPanelButtons.add(getJButtonAccept());
235 237
		}
236 238
		return jPanelButtons;
237 239
	}
238
	
240
	/**
241
	 * Inicializa el bot?n 'Anterior'
242
	 * @return
243
	 */
239 244
	public JButton getJButtonBefore(){
240 245
		if(jButtonBefore == null) {
241 246
			jButtonBefore = new JButton();
......
243 248
			jButtonBefore.setMnemonic('B');			
244 249
			jButtonBefore.setPreferredSize(new Dimension(100,25));			
245 250
			jButtonBefore.setEnabled(false);
246
//			jButtonBefore.addActionListener(this);
247 251
		}
248 252
		return jButtonBefore;
249 253
	}
250
	
254
	/**
255
	 * Inicializa el bot?n 'Finalizar'
256
	 * @return
257
	 */
251 258
	public JButton getJButtonAccept() {
252 259
		if(jButtonAccept == null) {
253 260
			jButtonAccept = new JButton();
......
256 263
			jButtonAccept.setVisible(true);
257 264
			jButtonAccept.setEnabled(false);
258 265
			jButtonAccept.setPreferredSize(new Dimension(100,25));
259
//			jButtonAccept.addActionListener(this);
260 266
		}
261 267
		return jButtonAccept;
262 268
	}
263
	
269
	/**
270
	 * Inicializa el bot?n 'Siguiente'
271
	 * @return
272
	 */
264 273
	public JButton getJButtonNext() {
265 274
		if(jButtonNext == null) {
266 275
			jButtonNext = new JButton();
......
268 277
			jButtonNext.setMnemonic('S');
269 278
			jButtonNext.setVisible(false);
270 279
			jButtonNext.setPreferredSize(new Dimension(100,25));
271
//			jButtonNext.addActionListener(this);
272 280
		}
273 281
		return jButtonNext;
274 282
	}
275
		
283
	/**
284
	 * Inicializa el bot?n 'Cancelar'
285
	 * @return
286
	 */
276 287
	public JButton getJButtonCancel() {
277 288
		if(jButtonCancel == null) {
278 289
			jButtonCancel = new JButton();
279 290
			jButtonCancel.setText(PluginServices.getText(this,"cancel"));
280 291
			jButtonCancel.setMnemonic('C');
281 292
			jButtonCancel.setPreferredSize(new Dimension(100,25));
282
//			jButtonCancel.addActionListener(this);
283 293
		}
284 294
		return jButtonCancel;
285 295
	}
......
396 406
		return m_viewinfo;
397 407
	}
398 408

  
399

  
400

  
401

  
402

  
403

  
404

  
405

  
406

  
407

  
408

  
409

  
410

  
411 409
	public CRSMainPanel getCrsMainPanel() {
412 410
		return crsMainPanel;
413 411
	}

Also available in: Unified diff