Revision 7443

View differences:

trunk/libraries/libJCRS/src/org/gvsig/crs/gui/TransformationSelectionDialogPanel.java
31 31
	    if (contentPane == null) {
32 32
	    	int target = ((ICrs) View.m_MapControl.getProjection()).getCode();
33 33
	    	String datum = ((ICrs) View.m_MapControl.getProjection()).getCrsWkt().getDatumName();
34
        	contentPane = new CRSLayerPanel(target, datum);
35
        	
36
	    	//contentPane = new CrsView(target, datum);
37
        	//contentPane.setLayout(new GridLayout(3,3));
38
        	//contentPane.setLayout(new FlowLayout( FlowLayout.LEFT,10,10));
39
	    	//contentPane.setPreferredSize(new Dimension(680,550));        	
34
	    	if (datum.equals("")){
35
	    		datum = "EuropeanDatum1950";
36
	    	}
37
        	contentPane = new CRSLayerPanel(target, datum);        	
38
	    	      	
40 39
       }
41 40
      return contentPane;
42 41
    }
trunk/libraries/libJCRS/src/org/gvsig/crs/gui/CRSLayerPanel.java
39 39
	
40 40
	boolean tra = false; //para que si tenemos seleccionada transformacion nos muestre los parametros
41 41
	boolean inAnApplet = true;
42
	
42
	boolean cancelYes = false;
43 43
	private JButton cancel = null;
44 44
	public static JButton next = null;
45 45
	public static JButton accept = null;
......
133 133
	public JPanel getCombopanel(){
134 134
		if (Combopanel == null){
135 135
			Combopanel = new JPanel();
136
			Combopanel.setPreferredSize(new Dimension(400,30));
136
			Combopanel.setPreferredSize(new Dimension(400,30));			
137 137
			Combopanel.add(getLabel());
138 138
			Combopanel.add(getComboCrs());
139 139
		}
......
153 153
			String[] selection = {"Sin transformacion", "Transformacion manual", 
154 154
					"+nadgrids", "Transformacion EPSG"}; 
155 155
			options = new JComboBox(selection);
156
			options.setPreferredSize(new Dimension(150,25));			
156
			options.setPreferredSize(new Dimension(150,25));	
157
			options.setEnabled(false);
157 158
			options.setEditable(false);
158 159
			options.setSelectedIndex(0);
159 160
			newSelection = (String) options.getSelectedItem();
......
287 288
	}
288 289
	
289 290
	private void cancel_actionPerformed(ActionEvent e) {
290
		PluginServices.getMDIManager().closeWindow(this);		
291
		cancelYes = true;
292
		setProjection(crsfirst);
293
		PluginServices.getMDIManager().closeWindow(this);
291 294
	}
292 295
	
293 296
	public ICrs getProjection() {
294 297
		ICrs crs;
295
		try {			
296
			crs = new CrsFactory().getCRS(CRSPanel.ep.getCodeCRS(),CRSPanel.ep.getWKT());
297
			return crs;
298
		try {
299
			if(CRSPanel.ep.getCodeCRS() == -1 || cancelYes == true){
300
				cancelYes = false;
301
				return (ICrs)crsfirst;
302
			}
303
			else {
304
				crs = new CrsFactory().getCRS(CRSPanel.ep.getCodeCRS(),CRSPanel.ep.getWKT());			
305
				return crs;
306
			}
298 307
			
299 308
		} catch (CrsException e) {
300 309
			e.printStackTrace();
......
311 320
		 if (lsm.isSelectionEmpty()) {
312 321
	        	CRSPanel.ep.selectedRowTable = -1;
313 322
	        	CRSPanel.ep.setCodeCRS(-1);
323
	        	options.setEnabled(false);
314 324
		 }
315 325
		 else {
316 326
	        	CRSPanel.ep.selectedRowTable = lsm.getMinSelectionIndex();
......
360 370
					e1.printStackTrace();
361 371
				}	
362 372
				    
363
				if (!(datum_target.equals(datum.replaceAll(" ","")))){							 
373
				if (!(datum_target.equals(datum.replaceAll(" ","")))){
374
					options.setEnabled(true);
364 375
				}
365 376
				else {
377
					options.setEnabled(false);
366 378
				}
379
				
367 380
	        }
368 381
	        CRSPanel.ep.getInfoCrs().setEnabled(true);	
369 382
        		

Also available in: Unified diff