Revision 674 org.gvsig.projection.jcrs/trunk/org.gvsig.projection.jcrs/org.gvsig.projection.app.jcrs/org.gvsig.projection.app.jcrs.common/src/main/java/org/gvsig/crs/gui/CRSMainPanel.java

View differences:

CRSMainPanel.java
68 68

  
69 69

  
70 70
/**
71
 * Clase que genera el panel principal para la seleccin de CRS 
72
 * 
71
 * Clase que genera el panel principal para la seleccin de CRS
72
 *
73 73
 * @author Jos Luis Gmez Martnez (jolugomar@gmail.com)
74 74
 * @author Luisa Marina Fernandez (luisam.fernandez@uclm.es)
75 75
 *
76 76
 */
77 77
public class CRSMainPanel extends JPanel implements IWindow {
78
		
78

  
79 79
	private static final long serialVersionUID = 1L;
80
	
81
	private JComboBox jComboOptions = null;	
82
	private JPanel Combopanel = null;	
83
	private JPanel USGSpanel = null;	
84
	
80

  
81
	private JComboBox jComboOptions = null;
82
	private JPanel Combopanel = null;
83
	private JPanel USGSpanel = null;
84

  
85 85
	final String recientes = PluginServices.getText(this,"recientes");
86
	final String epsg = PluginServices.getText(this,"EPSG"); 
86
	final String epsg = PluginServices.getText(this,"EPSG");
87 87
	final String usgs = PluginServices.getText(this,"USGS");
88 88
    final String esri = PluginServices.getText(this,"ESRI");
89 89
    final String noAuth = PluginServices.getText(this,"CRS");
90 90
	final String iau2000 = PluginServices.getText(this,"IAU2000");
91 91
	final String newCRS = PluginServices.getText(this,"newCRS");
92
	
92

  
93 93
	//String[] selection = {recientes, epsg, usgs, esri, iau2000, newCRS};
94 94
	String[] selection = {recientes, epsg, noAuth, esri, iau2000, newCRS};//, esri};
95
	
96
	boolean inAnApplet = true;	
95

  
96
	boolean inAnApplet = true;
97 97
	public CrsRecentsPanel crsRecentsPanel = null;
98 98
	public CrsAndTransformationRecentsPanel crsAndTransformationRecentsPanel = null;
99 99
	public EPSGpanel epsgPanel = null;
......
102 102
	public ESRIpanel esriPanel = null;
103 103
	public IAU2000panel iauPanel = null;
104 104
	public NewCRSPanel newCrsPanel=null;
105
	
106
	private JPanel jPanelMain = null;	
107
	
105

  
106
	private JPanel jPanelMain = null;
107

  
108 108
	private JPanel jPanelButtons;
109 109
	private JButton jButtonAccept;
110 110
	private JButton jButonCancel;
111
	
111

  
112 112
	private ICrs viewCrs;
113
	
113

  
114 114
	String dataSource = "";
115 115

  
116 116
	public CRSMainPanel(ICrs crs) {
117 117
        CrsFactory.initializeDatabaseInbackground();
118
        
118

  
119 119
		viewCrs = crs;
120 120
		crsRecentsPanel = new CrsRecentsPanel();
121 121
		epsgPanel = new EPSGpanel();
......
123 123
		esriPanel = new ESRIpanel();
124 124
		iauPanel = new IAU2000panel();
125 125
		newCrsPanel=new NewCRSPanel(viewCrs);
126
		
127
		this.add(vista(), BorderLayout.NORTH);		
126

  
127
		this.setLayout(new BorderLayout());
128
		this.add(vista(), BorderLayout.NORTH);
128 129
		this.add(getJPanelButtons(), BorderLayout.SOUTH);
129
		
130

  
130 131
	    setDataSource(selection[0]);
131
        
132

  
132 133
	}
133
	
134

  
134 135
	public CRSMainPanel(int target, ICrs crs) {
135 136
		viewCrs = crs;
136 137
		crsAndTransformationRecentsPanel = new CrsAndTransformationRecentsPanel();
......
139 140
		esriPanel = new ESRIpanel();
140 141
		iauPanel = new IAU2000panel();
141 142
		newCrsPanel=new NewCRSPanel(viewCrs);
142
		
143

  
143 144
		setDataSource(selection[0]);
144 145
	}
145
	
146

  
146 147
	/**
147
	 * Panel con los controles necesarios para visualizarlo en el panel de 
148
	 * Panel con los controles necesarios para visualizarlo en el panel de
148 149
	 * seleccin de CRS y transformacin de la capa a aadir
149 150
	 * @return
150 151
	 */
......
161 162
		p.add(getJPanelLayerMain(),BorderLayout.CENTER);
162 163
		return p;
163 164
	}
164
	
165

  
165 166
	public JPanel vista(){
166 167
		JPanel p = new JPanel();
167 168
		//p.setPreferredSize(new Dimension(550, 320));
......
178 179
		p.add(getJPanelMain(),BorderLayout.CENTER);
179 180
		return p;
180 181
	}
181
	
182

  
182 183
	public JPanel getJPanelMain(){
183 184
		if (jPanelMain == null){
184 185
			jPanelMain = new JPanel();
185 186
			jPanelMain.setLayout(new CardLayout());
186
			jPanelMain.setPreferredSize(new Dimension(525, 230));	
187
			jPanelMain.setPreferredSize(new Dimension(525, 230));
187 188
			jPanelMain.add(recientes, crsRecentsPanel);
188 189
			jPanelMain.add(epsg, epsgPanel);
189 190
			jPanelMain.add(newCRS,newCrsPanel);
......
192 193
			jPanelMain.add(usgs, getJPanelUSGS());
193 194
			jPanelMain.add(iau2000, iauPanel);
194 195
		}
195
		
196
		return jPanelMain;		
196

  
197
		return jPanelMain;
197 198
	}
198
	
199

  
199 200
	public JPanel getJPanelLayerMain(){
200 201
		if (jPanelMain == null){
201 202
			jPanelMain = new JPanel();
202 203
			jPanelMain.setLayout(new CardLayout());
203
			jPanelMain.setPreferredSize(new Dimension(525, 230));	
204
			jPanelMain.setPreferredSize(new Dimension(525, 230));
204 205
			jPanelMain.add(recientes, crsAndTransformationRecentsPanel);
205 206
			jPanelMain.add(epsg, epsgPanel);
206 207
			jPanelMain.add(newCRS,newCrsPanel);
......
209 210
			jPanelMain.add(usgs, getJPanelUSGS());
210 211
			jPanelMain.add(iau2000, iauPanel);
211 212
		}
212
		
213
		return jPanelMain;		
213

  
214
		return jPanelMain;
214 215
	}
215
	
216

  
216 217
	public JPanel getCombopanel(){
217 218
		if (Combopanel == null){
218 219
			Combopanel = new JPanel();
......
220 221
			Combopanel.add(getJLabelTipo());
221 222
			Combopanel.add(getJComboOptions());
222 223
		}
223
		
224

  
224 225
		return Combopanel;
225 226
	}
226
	
227

  
227 228
	private JLabel getJLabelTipo(){
228 229
		JLabel jLabelTipo = new JLabel();
229 230
		jLabelTipo.setPreferredSize(new Dimension(50,25));
230 231
		jLabelTipo.setText(PluginServices.getText(this,"tipo")+":");
231 232
		return jLabelTipo;
232 233
	}
233
	
234

  
234 235
	public JComboBox getJComboOptions(){
235 236
		if (jComboOptions == null){
236 237
			jComboOptions = new JComboBox(selection);
237
			jComboOptions.setPreferredSize(new Dimension(100,25));			
238
			jComboOptions.setPreferredSize(new Dimension(100,25));
238 239
			jComboOptions.setEditable(false);
239
			jComboOptions.setSelectedIndex(0);					
240
			jComboOptions.setSelectedIndex(0);
240 241
		}
241 242
		return jComboOptions;
242 243
	}
243
			
244
	public JPanel getJPanelUSGS() {	
244

  
245
	public JPanel getJPanelUSGS() {
245 246
		if (USGSpanel == null){
246 247
			USGSpanel = new JPanel();
247 248
			USGSpanel.setLayout(new GridLayout(3,4));
248 249
			USGSpanel.setLayout(new FlowLayout(FlowLayout.LEFT,10,10));
249
			USGSpanel.setPreferredSize(new Dimension(525, 400));			
250
		}	
250
			USGSpanel.setPreferredSize(new Dimension(525, 400));
251
		}
251 252
		return USGSpanel;
252
	}			
253
	
253
	}
254

  
254 255
	private JPanel getJPanelButtons() {
255 256
		if(jPanelButtons == null) {
256 257
			jPanelButtons = new JPanel();
257 258
			jPanelButtons.setLayout(new FlowLayout(FlowLayout.RIGHT));
258 259
			//jPanelButtons.setPreferredSize(new Dimension(525,50));
259 260
			jPanelButtons.add(getJButtonCancel(),null);
260
			jPanelButtons.add(getJButtonAccept(),null);			
261
			jPanelButtons.add(getJButtonAccept(),null);
261 262
		}
262 263
		return jPanelButtons;
263 264
	}
264
	
265

  
265 266
	public JButton getJButtonCancel() {
266 267
		if(jButonCancel == null) {
267 268
			jButonCancel = new JButton();
268 269
			jButonCancel.setText(PluginServices.getText(this,"cancel"));
269 270
			jButonCancel.setPreferredSize(new Dimension(100,25));
270 271
			jButonCancel.setMnemonic('C');
271
			jButonCancel.setToolTipText("Cancel");			
272
			jButonCancel.setToolTipText("Cancel");
272 273
		}
273 274
		return jButonCancel;
274 275
	}
275
	
276
	public void cancelButton_actionPerformed(ActionEvent e) {		
276

  
277
	public void cancelButton_actionPerformed(ActionEvent e) {
277 278
		 PluginServices.getMDIManager().closeWindow(this);
278 279
	}
279
	
280

  
280 281
	public JButton getJButtonAccept() {
281 282
		if(jButtonAccept == null) {
282 283
			jButtonAccept = new JButton();
......
284 285
			jButtonAccept.setPreferredSize(new Dimension(100,25));
285 286
			jButtonAccept.setEnabled(false);
286 287
			jButtonAccept.setMnemonic('A');
287
			jButtonAccept.setToolTipText(PluginServices.getText(this,"ok"));			
288
			jButtonAccept.setToolTipText(PluginServices.getText(this,"ok"));
288 289
		}
289 290
		return jButtonAccept;
290 291
	}
291
	
292

  
292 293
	public ICrs getProjection() {
293 294
		if (getDataSource().equals(PluginServices.getText(this,"EPSG"))){
294 295
			return epsgPanel.getProjection();
......
310 311
		}
311 312
		return null;
312 313
	}
313
	
314

  
314 315
	public void setProjection(IProjection crs) {
315 316
		//setCrs((ICrs) crs);
316 317
	}
317
	
318

  
318 319
	public void setDataSource(String sour){
319 320
		dataSource = sour;
320 321
	}
321
	
322

  
322 323
	public String getDataSource(){
323 324
		return dataSource;
324 325
	}
......
336 337
    public NoAuthCRSpanel getNoAuthPanel() {
337 338
        return noAuthPanel;
338 339
    }
339
	
340 340

  
341

  
341 342
	public ESRIpanel getEsriPanel() {
342 343
		return esriPanel;
343 344
	}
......
348 349
	public CrsRecentsPanel getRecentsPanel() {
349 350
		return crsRecentsPanel;
350 351
	}
351
	
352

  
352 353
	public CrsAndTransformationRecentsPanel getCrsAndTransformationRecentsPanel() {
353 354
		return crsAndTransformationRecentsPanel;
354 355
	}

Also available in: Unified diff