Revision 23383 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/gui/panels/annotation/ConfigureLabel.java

View differences:

ConfigureLabel.java
13 13
import javax.swing.JComboBox;
14 14
import javax.swing.JLabel;
15 15

  
16
import org.gvsig.fmap.datasources.SelectableDataSource;
17
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrAnnotation;
16
//import org.gvsig.fmap.datasources.SelectableDataSource;
17
//import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrAnnotation;
18 18

  
19 19
import jwizardcomponent.JWizardComponents;
20 20
import jwizardcomponent.JWizardPanel;
21 21

  
22
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
22
//import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
23 23
import com.iver.andami.PluginServices;
24 24

  
25 25

  
26

  
26
//TODO comentado para que compile
27 27
public class ConfigureLabel extends JWizardPanel {
28 28

  
29
	public ConfigureLabel(JWizardComponents wizardComponents) {
30
		super(wizardComponents);
31
		// TODO Auto-generated constructor stub
32
	}
33

  
29 34
	public static final String TEXT_FOR_DEFAULT_VALUE = "- Default -";
30 35

  
31
	private FLyrAnnotation layer;
36
//	private FLyrAnnotation layer;
32 37

  
33 38
	private HashMap fieldsNames = new HashMap() ;
34 39
	private JLabel lblDescription;
......
109 114
	private EventsListener eventsListener = new EventsListener();
110 115

  
111 116

  
112
	public ConfigureLabel(JWizardComponents arg0,FLyrAnnotation layer) {
113
		super(arg0);
114
		this.layer =layer;
115
		this.initialize();
116
	}
117
//	public ConfigureLabel(JWizardComponents arg0,FLyrAnnotation layer) {
118
//		super(arg0);
119
//		this.layer =layer;
120
//		this.initialize();
121
//	}
117 122

  
118 123
	protected void initialize() {
119 124
		this.setLayout(null);
......
187 192
		if (types == null) {
188 193

  
189 194
			String[] allNames = (String[])this.fieldsNames.get("ALL");
190
			if (allNames == null) {
191
				try {
192
					SelectableDataSource dataSource = this.layer.getRecordset();
193

  
194
					allNames = dataSource.getFieldNames();
195
					this.fieldsNames.put("ALL",allNames);
196

  
197
				} catch (ReadDriverException e) {
198
					e.printStackTrace();
199
				}
200
			}
195
//			if (allNames == null) {
196
//				try {
197
//					SelectableDataSource dataSource = this.layer.getRecordset();
198
//
199
//					allNames = dataSource.getFieldNames();
200
//					this.fieldsNames.put("ALL",allNames);
201
//
202
//				} catch (ReadDriverException e) {
203
//					e.printStackTrace();
204
//				}
205
//			}
201 206
			for (int i=0; i < allNames.length; i++) {
202 207
				cmb.addItem(allNames[i]);
203 208
			}
......
223 228
	}
224 229
	private Collection getFieldsFromType(int type){
225 230
		ArrayList result = new ArrayList();
226
		try {
227
			SelectableDataSource dataSource = this.layer.getRecordset();
228

  
229
			for (int i=0; i < dataSource.getFieldCount(); i++) {
230
				if (dataSource.getFieldType(i) == type){
231
					result.add(dataSource.getFieldName(i));
232
				}
233
			}
234
		} catch (ReadDriverException e) {
235
			e.printStackTrace();
236
		}
231
//		try {
232
//			SelectableDataSource dataSource = this.layer.getRecordset();
233
//
234
//			for (int i=0; i < dataSource.getFieldCount(); i++) {
235
//				if (dataSource.getFieldType(i) == type){
236
//					result.add(dataSource.getFieldName(i));
237
//				}
238
//			}
239
//		} catch (ReadDriverException e) {
240
//			e.printStackTrace();
241
//		}
237 242
		if (result.size() == 0){
238 243
			return null;
239 244
		}

Also available in: Unified diff