Revision 12202 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/listeners/ImportNewCrsDialogListener.java

View differences:

ImportNewCrsDialogListener.java
79 79
		}
80 80
		
81 81
		if (e.getSource() == dialog.getJButtonCancel()) {
82
			dialog.setCode(-1);
82 83
			PluginServices.getMDIManager().closeWindow(dialog);
83 84
		}		
84 85
	}
85 86

  
86 87
	public void valueChanged(ListSelectionEvent e) {
87 88
		if (e.getSource() == dialog.getEpsgPanel().getJTable().getSelectionModel()){
88
			String[] not_soported = {"engineering", "vertical", "compound", "geocentric"};
89
			String[] not_soported= new String[6];// = {"engineering", "vertical", "compound", "geocentric"};
89 90
			boolean soported = true;
90 91
			ListSelectionModel lsm = (ListSelectionModel)e.getSource();
91
								
92
			if (dialog.getOption().equals(PluginServices.getText(this, "projected"))) {
93
				not_soported[0] = "engineering";
94
				not_soported[1]= "vertical";
95
				not_soported[2] = "compound";
96
				not_soported[3] ="geocentric";
97
				not_soported[4]= "geographic 3D";
98
				not_soported[5] = "geographic 2D";
99
			} else {
100
				not_soported[0] = "engineering";
101
				not_soported[1]= "vertical";
102
				not_soported[2] = "compound";
103
				not_soported[3] ="geocentric";
104
				not_soported[4]= "geographic 3D";				
105
			}
106
			
92 107
	        if (lsm.isSelectionEmpty()) {	        	
108
	        	dialog.getEpsgPanel().setCodeCRS(-1);
93 109
	        	dialog.getJButtonAccept().setEnabled(false);        	
94 110
	        	dialog.getEpsgPanel().getInfoCrs().setEnabled(false);
95 111
	        	dialog.setCode(-1);     	        	
......
102 118
	        			soported = false;	        		
103 119
	        	}
104 120
	        	if (soported){
105
	        		dialog.setCode(Integer.parseInt((String)dialog.getEpsgPanel().sorter.getValueAt(dialog.getEpsgPanel().selectedRowTable,0)));
106
	            	dialog.getJButtonAccept().setEnabled(true);
121
	        		int code = Integer.parseInt((String)dialog.getEpsgPanel().sorter.getValueAt(dialog.getEpsgPanel().selectedRowTable,0));
122
	        		dialog.setCode(code);
123
	        		dialog.getEpsgPanel().setCodeCRS(code);
124
	        		dialog.getJButtonAccept().setEnabled(true);
107 125
	            	dialog.getEpsgPanel().getInfoCrs().setEnabled(true);
108 126
	            	
109 127
	        	}
110 128
	        	else {
111
	        		JOptionPane.showMessageDialog(dialog, PluginServices.getText(this,"crs_not_soported"), "Warning...",
129
	        		if (dialog.getOption().equals(PluginServices.getText(this, "projected"))) {
130
	        			JOptionPane.showMessageDialog(dialog, PluginServices.getText(this,"crs_not_projected"), "Warning...",
131
								JOptionPane.WARNING_MESSAGE);
132
	        		} else {        			
133
	        			JOptionPane.showMessageDialog(dialog, PluginServices.getText(this,"crs_not_soported"), "Warning...",
112 134
							JOptionPane.WARNING_MESSAGE);
135
	        		}
113 136
	        		dialog.setCode(-1);
137
	        		dialog.getEpsgPanel().setCodeCRS(-1);
114 138
	        		dialog.getJButtonAccept().setEnabled(false);
115 139
	        		dialog.getEpsgPanel().getInfoCrs().setEnabled(false);
116 140
	        	}	        	

Also available in: Unified diff