Revision 10661
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/ProjectDocument.java | ||
---|---|---|
215 | 215 |
* |
216 | 216 |
* @return DOCUMENT ME! |
217 | 217 |
* @throws XMLException |
218 |
* @throws DriverException |
|
219 |
* @throws DriverIOException |
|
220 |
* @throws CancelationException |
|
221 |
* @throws ClassNotFoundException |
|
222 |
* @throws InstantiationException |
|
223 |
* @throws IllegalAccessException |
|
224 |
* @throws DriverIOException |
|
225 |
* @throws DriverLoadException |
|
226 | 218 |
*/ |
227 | 219 |
public static ProjectDocument createFromXML03(XMLEntity xml, Project p) throws XMLException{ |
228 | 220 |
ProjectDocument pe = null; |
... | ... | |
288 | 280 |
* @param p DOCUMENT ME! |
289 | 281 |
* |
290 | 282 |
* @throws XMLException |
291 |
* @throws DriverException |
|
292 |
* @throws DriverIOException |
|
293 | 283 |
* @throws OpenException |
294 | 284 |
* @throws ReadDriverException |
295 | 285 |
*/ |
... | ... | |
310 | 300 |
* @param p DOCUMENT ME! |
311 | 301 |
* |
312 | 302 |
* @throws XMLException |
313 |
* @throws DriverException |
|
314 | 303 |
* @throws ReadDriverException |
315 | 304 |
* @throws DriverIOException |
316 | 305 |
*/ |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/Table.java | ||
---|---|---|
261 | 261 |
model.getModelo().getRecordset().addSelectionListener(selectionListener); |
262 | 262 |
|
263 | 263 |
updateSelection(); |
264 |
} catch (DriverLoadException e) { |
|
265 |
NotificationManager.addError("No se pudo leer la informaci?n", e); |
|
266 | 264 |
} catch (ReadDriverException e) { |
267 | 265 |
NotificationManager.addError("No se pudo leer la informaci?n", e); |
268 | 266 |
} |
... | ... | |
360 | 358 |
"."); |
361 | 359 |
if (PluginServices.getMainFrame() != null) |
362 | 360 |
PluginServices.getMainFrame().enableControls(); |
363 |
} catch (DriverLoadException e) { |
|
364 |
e.printStackTrace(); |
|
365 | 361 |
} catch (ReadDriverException e) { |
366 | 362 |
// TODO Auto-generated catch block |
367 | 363 |
e.printStackTrace(); |
... | ... | |
410 | 406 |
try { |
411 | 407 |
dataModel = Table.this.model.getModelo() |
412 | 408 |
.getRecordset(); |
413 |
} catch (DriverLoadException e1) { |
|
414 |
e1.printStackTrace(); |
|
415 | 409 |
} catch (ReadDriverException e1) { |
416 | 410 |
e1.printStackTrace(); |
417 | 411 |
} |
... | ... | |
1331 | 1325 |
} |
1332 | 1326 |
|
1333 | 1327 |
public void afterFieldEditEvent(AfterFieldEditEvent e) { |
1334 |
try { |
|
1335 | 1328 |
// getModel().createAlias(); |
1336 | 1329 |
clearSelectedFields(); |
1337 | 1330 |
// refresh(); |
1338 | 1331 |
refreshControls(); |
1339 | 1332 |
// ((DataSourceDataModel) getTable().getModel()).fireTableDataChanged(); |
1340 |
} catch (DriverLoadException e1) { |
|
1341 |
// TODO Auto-generated catch block |
|
1342 |
e1.printStackTrace(); |
|
1343 |
/* } catch (DriverException e1) { |
|
1344 |
// TODO Auto-generated catch block |
|
1345 |
e1.printStackTrace(); */ |
|
1346 |
} |
|
1347 | 1333 |
|
1348 | 1334 |
} |
1349 | 1335 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/tablemodel/DataSourceDataModel.java | ||
---|---|---|
140 | 140 |
try { |
141 | 141 |
if (pt.getModelo().getRecordset().getFieldType(columnIndex)==Types.STRUCT) |
142 | 142 |
return true; |
143 |
} catch (DriverLoadException e) { |
|
144 |
e.printStackTrace(); |
|
145 | 143 |
} catch (ReadDriverException e) { |
146 | 144 |
e.printStackTrace(); |
147 | 145 |
} |
... | ... | |
193 | 191 |
} catch (ParseException e) { |
194 | 192 |
JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),"formato_del_campo_incorrecto"); |
195 | 193 |
return; |
196 |
} catch (DriverLoadException e) { |
|
197 |
throw new RuntimeException(e); |
|
198 | 194 |
} catch (NumberFormatException e) { |
199 | 195 |
/* NotificationManager.addError(PluginServices.-getText(this,"numero_incorrecto")+ |
200 | 196 |
"\n"+PluginServices.-getText(this,"fila")+" = "+rowIndex+ |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/DlgFieldManager.java | ||
---|---|---|
146 | 146 |
public int getRowCount() { |
147 | 147 |
try { |
148 | 148 |
return myIes.getRecordset().getFieldCount(); |
149 |
} catch (DriverLoadException e) { |
|
150 |
e.printStackTrace(); |
|
151 | 149 |
} catch (ReadDriverException e) { |
152 | 150 |
e.printStackTrace(); |
153 | 151 |
} |
... | ... | |
156 | 154 |
|
157 | 155 |
public Object getValueAt(int rowIndex, int columnIndex) { |
158 | 156 |
FieldDescription[] myFields; |
159 |
try { |
|
160 |
myFields = myIes.getFieldsDescription(); |
|
161 |
FieldDescription aux = myFields[rowIndex]; |
|
162 |
switch (columnIndex) { |
|
157 |
myFields = myIes.getFieldsDescription(); |
|
158 |
FieldDescription aux = myFields[rowIndex]; |
|
159 |
switch (columnIndex) { |
|
163 | 160 |
case 0: |
164 | 161 |
return aux.getFieldAlias(); |
165 | 162 |
case 1: |
... | ... | |
185 | 182 |
return aux.getDefaultValue(); |
186 | 183 |
|
187 | 184 |
} |
188 |
} catch (DriverLoadException e) { |
|
189 |
e.printStackTrace(); |
|
190 |
} |
|
191 |
|
|
192 | 185 |
return null; |
193 | 186 |
} |
194 | 187 |
|
... | ... | |
252 | 245 |
fDesc.setFieldDecimalCount(5); |
253 | 246 |
} |
254 | 247 |
} |
255 |
} catch (DriverLoadException e) { |
|
256 |
e.printStackTrace(); |
|
257 | 248 |
} catch (ReadDriverException e) { |
258 | 249 |
e.printStackTrace(); |
259 | 250 |
} |
... | ... | |
272 | 263 |
initialize(); |
273 | 264 |
// Add a new row |
274 | 265 |
TableModel tm; |
275 |
try { |
|
276 |
tm = new MyTableModel(ies); |
|
277 |
getJTableFields().setModel(tm); |
|
278 |
// Esto lo a?ado aqu? porque si no tiene registros, no hace caso. |
|
279 |
// (Por eso no |
|
280 |
// lo pongo en getJTable() |
|
281 |
TableColumn typeColumn = jTableFields.getColumnModel().getColumn(1); |
|
282 |
JComboBox comboBox = new JComboBox(); |
|
283 |
comboBox.addItem("Boolean"); |
|
284 |
comboBox.addItem("Date"); |
|
285 |
comboBox.addItem("Integer"); |
|
286 |
comboBox.addItem("Double"); |
|
287 |
comboBox.addItem("String"); |
|
288 |
typeColumn.setCellEditor(new DefaultCellEditor(comboBox)); |
|
266 |
tm = new MyTableModel(ies); |
|
267 |
getJTableFields().setModel(tm); |
|
268 |
// Esto lo a?ado aqu? porque si no tiene registros, no hace caso. |
|
269 |
// (Por eso no |
|
270 |
// lo pongo en getJTable() |
|
271 |
TableColumn typeColumn = jTableFields.getColumnModel().getColumn(1); |
|
272 |
JComboBox comboBox = new JComboBox(); |
|
273 |
comboBox.addItem("Boolean"); |
|
274 |
comboBox.addItem("Date"); |
|
275 |
comboBox.addItem("Integer"); |
|
276 |
comboBox.addItem("Double"); |
|
277 |
comboBox.addItem("String"); |
|
278 |
typeColumn.setCellEditor(new DefaultCellEditor(comboBox)); |
|
289 | 279 |
|
290 |
|
|
291 |
} catch (DriverLoadException e) { |
|
292 |
// TODO Auto-generated catch block |
|
293 |
e.printStackTrace(); |
|
294 |
} |
|
295 |
|
|
296 | 280 |
} |
297 | 281 |
|
298 | 282 |
/** |
... | ... | |
477 | 461 |
PluginServices.getMDIManager().closeWindow(panelNewField); |
478 | 462 |
} catch (ParseException e2) { |
479 | 463 |
NotificationManager.addError(e2); |
480 |
} catch (DriverLoadException e3) { |
|
481 |
NotificationManager.addError(e3); |
|
482 | 464 |
} catch (ReadDriverException e3) { |
483 | 465 |
NotificationManager.addError(e3); |
484 | 466 |
} |
... | ... | |
567 | 549 |
|
568 | 550 |
|
569 | 551 |
edAdapter.renameField(fieldName, newName); |
570 |
} catch (DriverLoadException e1) { |
|
571 |
// TODO Auto-generated catch block |
|
572 |
e1.printStackTrace(); |
|
573 | 552 |
} catch (ReadDriverException e1) { |
574 | 553 |
// TODO Auto-generated catch block |
575 | 554 |
e1.printStackTrace(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/TableModelProperties.java | ||
---|---|---|
101 | 101 |
} catch (ReadDriverException e) { |
102 | 102 |
NotificationManager.addError("No se pudo leer la informaci?n de la tabla", e); |
103 | 103 |
return 0; |
104 |
} catch (DriverLoadException e) { |
|
105 |
NotificationManager.addError("No se pudo leer la informaci?n de la tabla", e); |
|
106 |
return 0; |
|
107 |
} |
|
104 |
} |
|
108 | 105 |
} |
109 | 106 |
|
110 | 107 |
/* (non-Javadoc) |
... | ... | |
119 | 116 |
} catch (ReadDriverException e) { |
120 | 117 |
NotificationManager.addError("Error accediendo al nombre del campo", e); |
121 | 118 |
return "error!"; |
122 |
} catch (DriverLoadException e) { |
|
123 |
NotificationManager.addError("Error accediendo al nombre del campo", e); |
|
124 |
return "error!"; |
|
125 |
} |
|
119 |
} |
|
126 | 120 |
} else { |
127 | 121 |
// rowIndex++; |
128 | 122 |
return alias[rowIndex]; |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTableFactory.java | ||
---|---|---|
204 | 204 |
|
205 | 205 |
try { |
206 | 206 |
t.createAlias(); |
207 |
} catch (DriverLoadException e) { |
|
208 |
e.printStackTrace(); |
|
209 | 207 |
} catch (ReadDriverException e) { |
210 | 208 |
e.printStackTrace(); |
211 | 209 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTable.java | ||
---|---|---|
231 | 231 |
original = esModel; |
232 | 232 |
} |
233 | 233 |
setModel(es); |
234 |
try { |
|
235 |
es.getRecordset().setSelectionSupport((original |
|
234 |
es.getRecordset().setSelectionSupport((original |
|
236 | 235 |
.getRecordset()).getSelectionSupport()); |
237 | 236 |
|
238 | 237 |
createAlias(); |
239 |
} catch (DriverLoadException e1) { |
|
240 |
throw new ReadDriverException(getName(),e1); |
|
241 |
} |
|
242 | 238 |
// FJP: |
243 | 239 |
// Si la tabla proviene de un layer, cambiamos su recordset |
244 | 240 |
if (associatedTable != null) { |
245 | 241 |
if (associatedTable instanceof FLyrVect) { |
246 |
try { |
|
247 |
// ((EditableAdapter)((FLyrVect) |
|
248 |
// associatedTable).getSource()).setRecordSet((SelectableDataSource)es.getRecordset()); |
|
249 |
FLyrVect lyrVect = (FLyrVect) associatedTable; |
|
250 |
lyrVect.setRecordset(es.getRecordset()); |
|
251 |
((FLyrVect) associatedTable).setIsJoined(true); |
|
252 |
} catch (DriverLoadException e) { |
|
253 |
throw new ReadDriverException(getName(),e); |
|
254 |
} |
|
242 |
// ((EditableAdapter)((FLyrVect) |
|
243 |
// associatedTable).getSource()).setRecordSet((SelectableDataSource)es.getRecordset()); |
|
244 |
FLyrVect lyrVect = (FLyrVect) associatedTable; |
|
245 |
lyrVect.setRecordset(es.getRecordset()); |
|
246 |
((FLyrVect) associatedTable).setIsJoined(true); |
|
255 | 247 |
} |
256 | 248 |
} |
257 | 249 |
|
... | ... | |
724 | 716 |
try { |
725 | 717 |
getModelo().getRecordset() |
726 | 718 |
.removeLinksSelectionListener(); |
727 |
} catch (DriverLoadException e) { |
|
728 |
e.printStackTrace(); |
|
729 | 719 |
} catch (ReadDriverException e) { |
730 | 720 |
e.printStackTrace(); |
731 | 721 |
} |
... | ... | |
759 | 749 |
if (mapping==null) { |
760 | 750 |
createAlias(); |
761 | 751 |
} |
762 |
} catch (DriverLoadException e) { |
|
763 |
e.printStackTrace(); |
|
764 |
NotificationManager.addError(e); |
|
765 | 752 |
} catch (ReadDriverException e) { |
766 | 753 |
e.printStackTrace(); |
767 | 754 |
NotificationManager.addError(e); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/LayoutControl.java | ||
---|---|---|
684 | 684 |
* It does a full extent of the layers that contains the view of the |
685 | 685 |
* FFrameView selected. |
686 | 686 |
* |
687 |
* @throws DriverException |
|
687 |
* @throws ReadDriverException
|
|
688 | 688 |
*/ |
689 | 689 |
public void viewFull() throws ReadDriverException { |
690 | 690 |
IFFrame[] fframes = layoutContext.getFFrameSelected(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutDraw.java | ||
---|---|---|
106 | 106 |
* @param imgBase Si es null, est?s imprimiendo. Si no, la usas para el |
107 | 107 |
* c?digo de optimizaci?n. |
108 | 108 |
* |
109 |
* @throws DriverException |
|
109 |
* @throws ReadDriverException
|
|
110 | 110 |
*/ |
111 | 111 |
public void drawLayout(Graphics2D g2, BufferedImage imgBase) |
112 | 112 |
throws ReadDriverException { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameOverView.java | ||
---|---|---|
98 | 98 |
* @param rv DOCUMENT ME! |
99 | 99 |
* @param imgBase DOCUMENT ME! |
100 | 100 |
* |
101 |
* @throws DriverException DOCUMENT ME!
|
|
101 |
* @throws ReadDriverException
|
|
102 | 102 |
*/ |
103 | 103 |
public void print(Graphics2D g, AffineTransform at) |
104 | 104 |
throws ReadDriverException { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameTable.java | ||
---|---|---|
42 | 42 |
* |
43 | 43 |
* $Id$ |
44 | 44 |
* $Log$ |
45 |
* Revision 1.4 2007-03-06 16:36:19 caballero
|
|
45 |
* Revision 1.5 2007-03-08 11:33:01 caballero
|
|
46 | 46 |
* Exceptions |
47 | 47 |
* |
48 |
* Revision 1.4 2007/03/06 16:36:19 caballero |
|
49 |
* Exceptions |
|
50 |
* |
|
48 | 51 |
* Revision 1.3 2007/01/23 13:10:17 caballero |
49 | 52 |
* valor no num?rico |
50 | 53 |
* |
... | ... | |
174 | 177 |
* @param g DOCUMENT ME! |
175 | 178 |
* @param at DOCUMENT ME! |
176 | 179 |
* |
177 |
* @throws DriverException DOCUMENT ME!
|
|
180 |
* @throws ReadDriverException
|
|
178 | 181 |
*/ |
179 | 182 |
public void print(Graphics2D g, AffineTransform at) |
180 | 183 |
throws ReadDriverException { |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/ProjectMap.java | ||
---|---|---|
109 | 109 |
* @throws SaveException |
110 | 110 |
* @throws XMLException |
111 | 111 |
* |
112 |
* @throws DriverException |
|
112 |
* @throws ReadDriverException
|
|
113 | 113 |
*/ |
114 | 114 |
public XMLEntity getXMLEntity() throws SaveException { |
115 | 115 |
XMLEntity xml = super.getXMLEntity(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java | ||
---|---|---|
1276 | 1276 |
.getRecordset()).addSelectionListener(lsl); |
1277 | 1277 |
|
1278 | 1278 |
} |
1279 |
} catch (DriverLoadException e) { |
|
1280 |
e.printStackTrace(); |
|
1281 | 1279 |
} catch (ReadDriverException e) { |
1282 | 1280 |
e.printStackTrace(); |
1283 | 1281 |
} |
... | ... | |
1435 | 1433 |
throws ReadDriverException { |
1436 | 1434 |
ArrayList tables = getDocumentsByType(ProjectTableFactory.registerName); |
1437 | 1435 |
SelectableDataSource dataSource = null; |
1438 |
try { |
|
1439 |
for (int i = 0; i < tables.size(); i++) { |
|
1440 |
ProjectTable pt = (ProjectTable) tables.get(i); |
|
1441 |
if (pt.getOriginal() == ((AlphanumericData) layer) |
|
1442 |
.getRecordset()) { |
|
1436 |
for (int i = 0; i < tables.size(); i++) { |
|
1437 |
ProjectTable pt = (ProjectTable) tables.get(i); |
|
1438 |
if (pt.getOriginal() == ((AlphanumericData) layer) |
|
1439 |
.getRecordset()) { |
|
1440 |
dataSource = pt.getModelo().getRecordset(); |
|
1441 |
break; |
|
1442 |
} else if (pt.getModelo() == ((AlphanumericData) layer) |
|
1443 |
.getRecordset()) { |
|
1443 | 1444 |
dataSource = pt.getModelo().getRecordset(); |
1444 | 1445 |
break; |
1445 |
} else if (pt.getModelo() == ((AlphanumericData) layer) |
|
1446 |
.getRecordset()) { |
|
1447 |
|
|
1448 |
dataSource = pt.getModelo().getRecordset(); |
|
1449 |
|
|
1450 |
break; |
|
1451 |
} |
|
1452 | 1446 |
} |
1453 |
} catch (DriverLoadException e) { |
|
1454 |
e.printStackTrace(); |
|
1455 | 1447 |
} |
1456 | 1448 |
|
1457 | 1449 |
if (dataSource == null) { |
... | ... | |
1488 | 1480 |
.getName(), t.getOriginal()); |
1489 | 1481 |
usedDataSources.put(ds.getName(), ds); |
1490 | 1482 |
} |
1491 |
} catch (DriverLoadException e) { |
|
1492 |
e.printStackTrace(); |
|
1493 | 1483 |
} catch (ReadDriverException e) { |
1494 | 1484 |
e.printStackTrace(); |
1495 | 1485 |
} |
... | ... | |
1526 | 1516 |
} |
1527 | 1517 |
|
1528 | 1518 |
} // for i |
1529 |
} catch (DriverLoadException e) { |
|
1530 |
e.printStackTrace(); |
|
1531 | 1519 |
} catch (ReadDriverException e) { |
1532 | 1520 |
e.printStackTrace(); |
1533 | 1521 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/preferencespage/DriverCSVPage.java | ||
---|---|---|
45 | 45 |
import javax.swing.JPanel; |
46 | 46 |
import javax.swing.JTextField; |
47 | 47 |
|
48 |
import com.hardcode.driverManager.DriverLoadException; |
|
48 | 49 |
import com.hardcode.driverManager.DriverManager; |
49 | 50 |
import com.hardcode.gdbms.driver.csvstring.CSVStringDriver; |
50 | 51 |
import com.iver.andami.PluginServices; |
... | ... | |
83 | 84 |
String separator; |
84 | 85 |
separator = txtSeparator.getText(); |
85 | 86 |
DriverManager dm=LayerFactory.getDM(); |
86 |
CSVStringDriver cvsDriver=(CSVStringDriver)dm.getDriver("csv string"); |
|
87 |
CSVStringDriver cvsDriver=null; |
|
88 |
try { |
|
89 |
cvsDriver = (CSVStringDriver)dm.getDriver("csv string"); |
|
90 |
} catch (DriverLoadException e) { |
|
91 |
throw new StoreException(); |
|
92 |
} |
|
87 | 93 |
cvsDriver.setSeparator(separator); |
88 | 94 |
PluginServices ps = PluginServices.getPluginServices(this); |
89 | 95 |
XMLEntity xml = ps.getPersistentXML(); |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/panels/TextFieldEdit.java | ||
---|---|---|
78 | 78 |
|
79 | 79 |
|
80 | 80 |
vea.modifyRow(index, newRow,"Editar valor de texto", EditionEvent.GRAPHIC); |
81 |
} catch (DriverLoadException e1) { |
|
82 |
e1.printStackTrace(); |
|
83 | 81 |
} catch (ReadDriverException e1) { |
84 | 82 |
e1.printStackTrace(); |
85 | 83 |
} catch (ParseException e1) { |
... | ... | |
122 | 120 |
int columnText=lyr.getMapping().getColumnText(); |
123 | 121 |
value = vea.getRecordset().getFieldValue(index,columnText); |
124 | 122 |
txt.setText(value.toString()); |
125 |
} catch (DriverLoadException e) { |
|
126 |
e.printStackTrace(); |
|
127 | 123 |
} catch (ReadDriverException e) { |
128 | 124 |
e.printStackTrace(); |
129 | 125 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableNumericFieldOperations.java | ||
---|---|---|
56 | 56 |
SelectableDataSource ds=null; |
57 | 57 |
try { |
58 | 58 |
ds = table.getModel().getModelo().getRecordset(); |
59 |
} catch (DriverLoadException e1) { |
|
60 |
e1.printStackTrace(); |
|
61 | 59 |
} catch (ReadDriverException e) { |
62 | 60 |
e.printStackTrace(); |
63 | 61 |
} |
... | ... | |
130 | 128 |
} |
131 | 129 |
|
132 | 130 |
protected boolean doIsEnabled(Table table){ |
133 |
try{ |
|
134 |
BitSet indices = table.getSelectedFieldIndices(); |
|
135 |
|
|
136 |
// System.out.println("TableNumericFieldOperations.isEnabled: Tabla: " + table.getModel().getModelo().getRecordset().getName() ); |
|
137 |
|
|
138 |
if (indices.cardinality() == 1){ |
|
139 |
try { |
|
140 |
int index=indices.nextSetBit(0); |
|
141 |
if (table.getModel().getModelo().getRecordset().getFieldCount()<index+1) |
|
142 |
return false; |
|
143 |
int type = table.getModel().getModelo().getRecordset().getFieldType(index); |
|
144 |
if ((type == Types.BIGINT) || |
|
145 |
(type == Types.DECIMAL) || |
|
146 |
(type == Types.DOUBLE) || |
|
147 |
(type == Types.FLOAT) || |
|
148 |
(type == Types.INTEGER) || |
|
149 |
(type == Types.SMALLINT) || |
|
150 |
(type == Types.TINYINT) || |
|
151 |
(type == Types.REAL) || |
|
152 |
(type == Types.NUMERIC)){ |
|
153 |
return true; |
|
154 |
} |
|
155 |
} catch (ReadDriverException e) { |
|
131 |
BitSet indices = table.getSelectedFieldIndices(); |
|
132 |
// System.out.println("TableNumericFieldOperations.isEnabled: Tabla: " + table.getModel().getModelo().getRecordset().getName() ); |
|
133 |
if (indices.cardinality() == 1){ |
|
134 |
try { |
|
135 |
int index=indices.nextSetBit(0); |
|
136 |
if (table.getModel().getModelo().getRecordset().getFieldCount()<index+1) |
|
156 | 137 |
return false; |
138 |
int type = table.getModel().getModelo().getRecordset().getFieldType(index); |
|
139 |
if ((type == Types.BIGINT) || |
|
140 |
(type == Types.DECIMAL) || |
|
141 |
(type == Types.DOUBLE) || |
|
142 |
(type == Types.FLOAT) || |
|
143 |
(type == Types.INTEGER) || |
|
144 |
(type == Types.SMALLINT) || |
|
145 |
(type == Types.TINYINT) || |
|
146 |
(type == Types.REAL) || |
|
147 |
(type == Types.NUMERIC)){ |
|
148 |
return true; |
|
157 | 149 |
} |
150 |
} catch (ReadDriverException e) { |
|
151 |
return false; |
|
158 | 152 |
} |
159 |
} catch (DriverLoadException e1) { |
|
160 |
// TODO Auto-generated catch block |
|
161 |
e1.printStackTrace(); |
|
162 | 153 |
} |
163 | 154 |
return false; |
164 | 155 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java | ||
---|---|---|
121 | 121 |
SelectableDataSource sds=null; |
122 | 122 |
try { |
123 | 123 |
sds = sourceProjectTable.getModelo().getRecordset(); |
124 |
} catch (DriverLoadException e1) { |
|
125 |
e1.printStackTrace(); |
|
126 | 124 |
} catch (ReadDriverException e) { |
127 | 125 |
e.printStackTrace(); |
128 | 126 |
} |
... | ... | |
131 | 129 |
ProjectTable targetProjectTable = (ProjectTable) targetTable.getSelected(); |
132 | 130 |
try { |
133 | 131 |
sds = targetProjectTable.getModelo().getRecordset(); |
134 |
} catch (DriverLoadException e1) { |
|
135 |
e1.printStackTrace(); |
|
136 | 132 |
} catch (ReadDriverException e) { |
137 | 133 |
e.printStackTrace(); |
138 | 134 |
} |
... | ... | |
188 | 184 |
} catch (SelectionException e) { |
189 | 185 |
NotificationManager.addError("Error obteniendo los campos de la tabla", |
190 | 186 |
e); |
191 |
} catch (DriverLoadException e) { |
|
192 |
NotificationManager.addError("Error obteniendo los campos de la tabla", |
|
193 |
e); |
|
194 | 187 |
} catch (ReadDriverException e) { |
195 | 188 |
NotificationManager.addError("Error obteniendo los campos de la tabla", |
196 | 189 |
e); |
... | ... | |
216 | 209 |
} catch (ReadDriverException e) { |
217 | 210 |
NotificationManager.addError("Error obteniendo los campos de la tabla", |
218 | 211 |
e); |
219 |
} catch (DriverLoadException e) { |
|
220 |
// TODO Auto-generated catch block |
|
221 |
e.printStackTrace(); |
|
222 | 212 |
} |
223 | 213 |
} |
224 | 214 |
} |
... | ... | |
326 | 316 |
} catch (ReadDriverException e) { |
327 | 317 |
NotificationManager.addError("Error obteniendo los campos de la tabla", |
328 | 318 |
e); |
329 |
} catch (DriverLoadException e) { |
|
330 |
// TODO Auto-generated catch block |
|
331 |
e.printStackTrace(); |
|
332 | 319 |
} |
333 | 320 |
} |
334 | 321 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FiltroExtension.java | ||
---|---|---|
123 | 123 |
* |
124 | 124 |
*/ |
125 | 125 |
protected void doExecute(){ |
126 |
try{ |
|
127 |
DefaultExpressionDataSource ds = new DefaultExpressionDataSource(); |
|
128 |
ds.setTable(dataSource); |
|
129 |
|
|
130 |
FilterDialog dlg = new FilterDialog(filterTitle); |
|
131 |
dlg.addExpressionListener(this); |
|
132 |
dlg.addExceptionListener(new ExceptionListener() { |
|
133 |
public void exceptionThrown(Throwable t) { |
|
134 |
NotificationManager.addError(t.getMessage(), t); |
|
135 |
} |
|
136 |
}); |
|
137 |
|
|
138 |
dlg.setModel(ds); |
|
139 |
PluginServices.getMDIManager().addWindow(dlg); |
|
140 |
} catch (DriverLoadException e) { |
|
141 |
// TODO Auto-generated catch block |
|
142 |
e.printStackTrace(); |
|
143 |
} |
|
126 |
DefaultExpressionDataSource ds = new DefaultExpressionDataSource(); |
|
127 |
ds.setTable(dataSource); |
|
128 |
FilterDialog dlg = new FilterDialog(filterTitle); |
|
129 |
dlg.addExpressionListener(this); |
|
130 |
dlg.addExceptionListener(new ExceptionListener() { |
|
131 |
public void exceptionThrown(Throwable t) { |
|
132 |
NotificationManager.addError(t.getMessage(), t); |
|
133 |
} |
|
134 |
}); |
|
135 |
dlg.setModel(ds); |
|
136 |
PluginServices.getMDIManager().addWindow(dlg); |
|
144 | 137 |
} |
145 | 138 |
|
146 | 139 |
/** |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableRowsOperations.java | ||
---|---|---|
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
} |
134 |
} catch (DriverLoadException e1) { |
|
135 |
e1.printStackTrace(); |
|
136 | 134 |
} catch (ReadDriverException e) { |
137 | 135 |
e.printStackTrace(); |
138 | 136 |
} |
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/AddLayer.java | ||
---|---|---|
272 | 272 |
try { |
273 | 273 |
drivers[i] = LayerFactory.getDM().getDriver(driverNames[i]); |
274 | 274 |
} catch (DriverLoadException e) { |
275 |
DriverNotLoadedExceptionType type = new DriverNotLoadedExceptionType(); |
|
276 |
type.setDriverName(driverNames[i]); |
|
275 |
// DriverNotLoadedExceptionType type = new DriverNotLoadedExceptionType();
|
|
276 |
// type.setDriverName(driverNames[i]);
|
|
277 | 277 |
// DriverException exception = new DriverException(e, type); |
278 | 278 |
errors.add(e); |
279 | 279 |
// NotificationManager.addError("No se pudo cargar el driver", e); |
trunk/examples/exaLoadLayer/src/org/gvsig/example/postgis/LoadLayer.java | ||
---|---|---|
12 | 12 |
import org.cresques.cts.ICoordTrans; |
13 | 13 |
import org.cresques.cts.IProjection; |
14 | 14 |
|
15 |
import com.hardcode.driverManager.DriverLoadException; |
|
15 | 16 |
import com.iver.andami.PluginServices; |
16 | 17 |
import com.iver.andami.plugins.Extension; |
17 | 18 |
import com.iver.andami.ui.mdiManager.IWindow; |
... | ... | |
29 | 30 |
public class LoadLayer extends Extension { |
30 | 31 |
|
31 | 32 |
public void initialize() { |
32 |
|
|
33 |
|
|
33 | 34 |
} |
34 | 35 |
|
35 | 36 |
public void execute(String actionCommand) { |
36 | 37 |
// IN CONFIG.XML, the actionCommand should be the layer name. (table name) |
37 | 38 |
View v = (View) PluginServices.getMDIManager().getActiveWindow(); |
38 | 39 |
MapControl mapCtrl = v.getMapControl(); |
39 |
|
|
40 |
String dbURL = "jdbc:postgresql://localhost:5432/latin1"; // latin1 is the catalog name
|
|
40 |
|
|
41 |
String dbURL = "jdbc:postgresql://localhost:5432/latin1"; // latin1 is the catalog name |
|
41 | 42 |
String user = "postgres"; |
42 | 43 |
String pwd = "aquilina"; |
43 | 44 |
String layerName = actionCommand; |
... | ... | |
46 | 47 |
try { |
47 | 48 |
conn = DriverManager.getConnection(dbURL, user, pwd); |
48 | 49 |
conn.setAutoCommit(false); |
49 |
|
|
50 |
|
|
50 | 51 |
String fidField = "gid"; // BE CAREFUL => MAY BE NOT!!! |
51 | 52 |
String geomField = "the_geom"; // BE CAREFUL => MAY BE NOT!!! => You should read table GEOMETRY_COLUMNS. |
52 | 53 |
// See PostGIS help. |
53 | 54 |
|
54 |
// To obtain the fields, make a connection and get them.
|
|
55 |
// To obtain the fields, make a connection and get them. |
|
55 | 56 |
Statement st = conn.createStatement(); |
56 | 57 |
ResultSet rs = st.executeQuery("select * from " + tableName + " LIMIT 1"); |
57 | 58 |
ResultSetMetaData rsmd = rs.getMetaData(); |
... | ... | |
60 | 61 |
for (int i = 0; i < fields.length; i++) { |
61 | 62 |
if (!rsmd.getColumnName(i+1).equalsIgnoreCase(geomField)) |
62 | 63 |
{ |
63 |
fields[j++] = rsmd.getColumnName(i+1);
|
|
64 |
fields[j++] = rsmd.getColumnName(i+1); |
|
64 | 65 |
} |
65 | 66 |
} |
66 |
rs.close();
|
|
67 |
|
|
68 |
/* String[] fields = new String[1];
|
|
69 |
fields[0] = "gid"; */
|
|
70 |
|
|
67 |
rs.close(); |
|
68 |
|
|
69 |
/* String[] fields = new String[1]; |
|
70 |
fields[0] = "gid"; */ |
|
71 |
|
|
71 | 72 |
String whereClause = ""; |
72 |
|
|
73 |
|
|
73 | 74 |
VectorialJDBCDriver driver = (VectorialJDBCDriver) LayerFactory.getDM() |
74 | 75 |
.getDriver("PostGIS JDBC Driver"); |
75 |
|
|
76 |
|
|
76 | 77 |
// Here you can set the workingArea |
77 | 78 |
// driver.setWorkingArea(dbLayerDefinition.getWorkingArea()); |
78 |
|
|
79 |
|
|
79 |
|
|
80 |
|
|
80 | 81 |
String strEPSG = mapCtrl.getViewPort() |
81 | 82 |
.getProjection().getAbrev() |
82 | 83 |
.substring(5); |
83 |
DBLayerDefinition lyrDef = new DBLayerDefinition();
|
|
84 |
DBLayerDefinition lyrDef = new DBLayerDefinition(); |
|
84 | 85 |
lyrDef.setName(layerName); |
85 | 86 |
lyrDef.setTableName(tableName); |
86 | 87 |
lyrDef.setWhereClause(whereClause); |
... | ... | |
89 | 90 |
lyrDef.setFieldID(fidField); |
90 | 91 |
// if (dbLayerDefinition.getWorkingArea() != null) |
91 | 92 |
// lyrDef.setWorkingArea(dbLayerDefinition.getWorkingArea()); |
92 |
|
|
93 |
|
|
93 | 94 |
lyrDef.setSRID_EPSG(strEPSG); |
94 | 95 |
if (driver instanceof ICanReproject) |
95 |
{
|
|
96 |
{ |
|
96 | 97 |
((ICanReproject)driver).setDestProjection(strEPSG); |
97 | 98 |
} |
98 | 99 |
driver.setData(conn, lyrDef); |
99 |
IProjection proj = null;
|
|
100 |
IProjection proj = null; |
|
100 | 101 |
if (driver instanceof ICanReproject) |
101 |
{
|
|
102 |
proj = CRSFactory.getCRS("EPSG:" + ((ICanReproject)driver).getSourceProjection());
|
|
102 |
{ |
|
103 |
proj = CRSFactory.getCRS("EPSG:" + ((ICanReproject)driver).getSourceProjection()); |
|
103 | 104 |
} |
104 |
|
|
105 |
|
|
105 | 106 |
FLayer lyr = LayerFactory.createDBLayer(driver, layerName, proj); |
106 |
|
|
107 |
|
|
107 | 108 |
if (lyr != null) { |
108 | 109 |
lyr.setVisible(true); |
109 | 110 |
v.getMapControl().getMapContext().beginAtomicEvent(); |
... | ... | |
112 | 113 |
v.getMapControl().getMapContext().getLayers() |
113 | 114 |
.addLayer(lyr); |
114 | 115 |
v.getMapControl().getMapContext().endAtomicEvent(); |
115 |
|
|
116 |
|
|
116 | 117 |
} |
117 | 118 |
} catch (SQLException e) { |
118 | 119 |
// TODO Auto-generated catch block |
119 | 120 |
e.printStackTrace(); |
121 |
} catch (DriverLoadException e) { |
|
122 |
// TODO Auto-generated catch block |
|
123 |
e.printStackTrace(); |
|
120 | 124 |
} |
121 |
|
|
122 |
|
|
125 |
|
|
126 |
|
|
123 | 127 |
} |
124 | 128 |
|
125 | 129 |
public boolean isEnabled() { |
... | ... | |
134 | 138 |
else |
135 | 139 |
return false; |
136 | 140 |
} |
137 |
|
|
141 |
|
|
138 | 142 |
private void checkProjection(FLayer lyr, ViewPort viewPort) |
139 | 143 |
{ |
140 | 144 |
if (lyr instanceof FLyrVect) |
... | ... | |
144 | 148 |
// Comprobar que la projecci?n es la misma que la vista |
145 | 149 |
if (proj == null) |
146 | 150 |
{ |
147 |
// SUPONEMOS que la capa est? en la proyecci?n que
|
|
151 |
// SUPONEMOS que la capa est? en la proyecci?n que |
|
148 | 152 |
// estamos pidiendo (que ya es mucho suponer, ya). |
149 | 153 |
lyrVect.setProjection(viewPort.getProjection()); |
150 | 154 |
return; |
... | ... | |
165 | 169 |
viewPort.getProjection().getAbrev()); |
166 | 170 |
} |
167 | 171 |
} |
168 |
}
|
|
172 |
} |
|
169 | 173 |
|
170 | 174 |
} |
171 | 175 |
|
trunk/extensions/extAddEventTheme/src/com/iver/gvsig/addeventtheme/AddEventThemListener.java | ||
---|---|---|
54 | 54 |
.getSource(); |
55 | 55 |
int numRow = (int) e.getNumRow(); |
56 | 56 |
//DefaultFeature df = null; |
57 |
try { |
|
58 |
//df = (DefaultFeature) vea.getFeature(numRow); |
|
59 |
|
|
60 |
if (EditionEvent.GRAPHIC == e.getSourceType()) { |
|
61 |
double[] d = new double[4]; |
|
62 |
IGeometry g = ((DefaultFeature)feat).getGeometry(); |
|
63 |
g.getPathIterator(null).currentSegment(d); |
|
64 |
int[] xy = ((AddEventThemeDriver) vea.getDriver()) |
|
65 |
.getFieldsIndex(); |
|
66 |
Value[] values = ((DefaultFeature)feat).getAttributes(); |
|
67 |
values[xy[0]] = ValueFactory.createValue(DoubleUtilities.format(d[0],".".charAt(0),6)); |
|
68 |
values[xy[1]] = ValueFactory.createValue(DoubleUtilities.format(d[1],".".charAt(0),6)); |
|
69 |
//feat = new DefaultFeature(g, values); |
|
70 |
//Value value0=vea.getRecordset().getFieldValue(numRow,xy[0]); |
|
71 |
//((DoubleValue)value0).setValue(d[0]); |
|
72 |
//Value value1=vea.getRecordset().getFieldValue(numRow,xy[1]); |
|
73 |
//((DoubleValue)value1).setValue(d[1]); |
|
74 |
//vea.setRow(numRow, df); |
|
75 |
} else if (EditionEvent.ALPHANUMERIC == e.getSourceType()) { |
|
76 |
IGeometry g = ((DefaultFeature)feat).getGeometry(); |
|
77 |
int[] xy = ((AddEventThemeDriver) vea.getDriver()) |
|
78 |
.getFieldsIndex(); |
|
79 |
NumericValue x = (NumericValue) ((DefaultFeature) feat) |
|
80 |
.getAttribute(xy[0]); |
|
81 |
NumericValue y = (NumericValue) ((DefaultFeature) feat) |
|
82 |
.getAttribute(xy[1]); |
|
83 |
g = ShapeFactory.createPoint2D(x.doubleValue(), y |
|
84 |
.doubleValue()); |
|
85 |
((DefaultFeature)feat).setGeometry(g); |
|
86 |
//feat = new DefaultFeature(g, ((DefaultFeature) feat) |
|
87 |
// .getAttributes()); |
|
88 |
//vea.setRow(numRow, df); |
|
89 |
} |
|
90 |
} catch (DriverLoadException e1) { |
|
91 |
e1.printStackTrace(); |
|
57 |
//df = (DefaultFeature) vea.getFeature(numRow); |
|
58 |
if (EditionEvent.GRAPHIC == e.getSourceType()) { |
|
59 |
double[] d = new double[4]; |
|
60 |
IGeometry g = ((DefaultFeature)feat).getGeometry(); |
|
61 |
g.getPathIterator(null).currentSegment(d); |
|
62 |
int[] xy = ((AddEventThemeDriver) vea.getDriver()) |
|
63 |
.getFieldsIndex(); |
|
64 |
Value[] values = ((DefaultFeature)feat).getAttributes(); |
|
65 |
values[xy[0]] = ValueFactory.createValue(DoubleUtilities.format(d[0],".".charAt(0),6)); |
|
66 |
values[xy[1]] = ValueFactory.createValue(DoubleUtilities.format(d[1],".".charAt(0),6)); |
|
67 |
//feat = new DefaultFeature(g, values); |
|
68 |
//Value value0=vea.getRecordset().getFieldValue(numRow,xy[0]); |
|
69 |
//((DoubleValue)value0).setValue(d[0]); |
|
70 |
//Value value1=vea.getRecordset().getFieldValue(numRow,xy[1]); |
|
71 |
//((DoubleValue)value1).setValue(d[1]); |
|
72 |
//vea.setRow(numRow, df); |
|
73 |
} else if (EditionEvent.ALPHANUMERIC == e.getSourceType()) { |
|
74 |
IGeometry g = ((DefaultFeature)feat).getGeometry(); |
|
75 |
int[] xy = ((AddEventThemeDriver) vea.getDriver()) |
|
76 |
.getFieldsIndex(); |
|
77 |
NumericValue x = (NumericValue) ((DefaultFeature) feat) |
|
78 |
.getAttribute(xy[0]); |
|
79 |
NumericValue y = (NumericValue) ((DefaultFeature) feat) |
|
80 |
.getAttribute(xy[1]); |
|
81 |
g = ShapeFactory.createPoint2D(x.doubleValue(), y |
|
82 |
.doubleValue()); |
|
83 |
((DefaultFeature)feat).setGeometry(g); |
|
84 |
//feat = new DefaultFeature(g, ((DefaultFeature) feat) |
|
85 |
// .getAttributes()); |
|
86 |
//vea.setRow(numRow, df); |
|
92 | 87 |
} |
93 | 88 |
} |
94 | 89 |
} |
... | ... | |
106 | 101 |
values[xy[0]] = ValueFactory.createValue(DoubleUtilities.format(d[0],".".charAt(0),6)); |
107 | 102 |
values[xy[1]] = ValueFactory.createValue(DoubleUtilities.format(d[1],".".charAt(0),6)); |
108 | 103 |
} |
109 |
}
|
|
104 |
} |
|
110 | 105 |
} |
111 | 106 |
|
112 | 107 |
public void beforeFieldEditEvent(BeforeFieldEditEvent e) { |
113 | 108 |
// TODO Auto-generated method stub |
114 |
|
|
109 |
|
|
115 | 110 |
} |
116 | 111 |
|
117 | 112 |
public void afterFieldEditEvent(AfterFieldEditEvent e) { |
118 | 113 |
// TODO Auto-generated method stub |
119 |
|
|
114 |
|
|
120 | 115 |
} |
121 | 116 |
|
122 | 117 |
|
trunk/extensions/extAddEventTheme/src/com/iver/gvsig/addeventtheme/gui/AddEventThemePanel.java | ||
---|---|---|
170 | 170 |
} catch (ReadDriverException e) { |
171 | 171 |
e.printStackTrace(); |
172 | 172 |
NotificationManager.addError(e); |
173 |
} catch (DriverLoadException e) { |
|
174 |
e.printStackTrace(); |
|
175 |
} |
|
173 |
} |
|
176 | 174 |
return (String[])fieldName.toArray(new String[0]); |
177 | 175 |
} |
178 | 176 |
|
... | ... | |
206 | 204 |
mapContext.getLayers().addLayer(capa); |
207 | 205 |
} catch (ReadDriverException e1) { |
208 | 206 |
NotificationManager.addError(e1); |
209 |
} catch (DriverLoadException e) { |
|
210 |
NotificationManager.addError(e); |
|
211 |
} |
|
207 |
} |
|
212 | 208 |
|
213 | 209 |
} |
214 | 210 |
|
trunk/extensions/extCAD/src/com/iver/cit/gvsig/CreateNewLayer.java | ||
---|---|---|
5 | 5 |
import javax.swing.ImageIcon; |
6 | 6 |
|
7 | 7 |
import com.hardcode.driverManager.Driver; |
8 |
import com.hardcode.driverManager.DriverLoadException; |
|
8 | 9 |
import com.hardcode.driverManager.DriverManager; |
9 | 10 |
import com.iver.andami.PluginServices; |
10 | 11 |
import com.iver.andami.plugins.Extension; |
... | ... | |
43 | 44 |
.getActiveWindow(); |
44 | 45 |
|
45 | 46 |
if (f instanceof View) { |
46 |
View vista = (View) f; |
|
47 |
try { |
|
48 |
View vista = (View) f; |
|
47 | 49 |
|
48 |
LOGO = new javax.swing.ImageIcon(this.getClass().getClassLoader() |
|
49 |
.getResource("images/package_graphics.png")); |
|
50 |
CADToolAdapter cta=CADExtension.getCADToolAdapter(); |
|
51 |
MapControl mapControl = vista.getMapControl(); |
|
52 |
cta.setMapControl(mapControl); |
|
53 |
/* SimpleLogoJWizardFrame wizardFrame = new SimpleLogoJWizardFrame( |
|
54 |
LOGO); |
|
55 |
wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
50 |
LOGO = new javax.swing.ImageIcon(this.getClass() |
|
51 |
.getClassLoader().getResource( |
|
52 |
"images/package_graphics.png")); |
|
53 |
CADToolAdapter cta = CADExtension.getCADToolAdapter(); |
|
54 |
MapControl mapControl = vista.getMapControl(); |
|
55 |
cta.setMapControl(mapControl); |
|
56 |
/* |
|
57 |
* SimpleLogoJWizardFrame wizardFrame = new |
|
58 |
* SimpleLogoJWizardFrame( LOGO); |
|
59 |
* wizardFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
60 |
* |
|
61 |
* SwingUtilities.updateComponentTreeUI(wizardFrame); |
|
62 |
* |
|
63 |
* wizardFrame.setTitle("Creaci?n de un nuevo Tema"); |
|
64 |
*/ |
|
65 |
WizardAndami wizard = new WizardAndami(LOGO); |
|
56 | 66 |
|
57 |
SwingUtilities.updateComponentTreeUI(wizardFrame); |
|
67 |
DriverManager writerManager = LayerFactory.getDM(); |
|
68 |
ArrayList spatialDrivers = new ArrayList(); |
|
69 |
String[] writerNames = writerManager.getDriverNames(); |
|
70 |
for (int i = 0; i < writerNames.length; i++) { |
|
71 |
Driver drv = writerManager.getDriver(writerNames[i]); |
|
72 |
if (drv instanceof ISpatialWriter) |
|
73 |
spatialDrivers.add(drv.getName()); |
|
74 |
} |
|
58 | 75 |
|
59 |
wizardFrame.setTitle("Creaci?n de un nuevo Tema"); */ |
|
60 |
WizardAndami wizard = new WizardAndami(LOGO); |
|
76 |
ChooseGeometryType panelChoose = new ChooseGeometryType(wizard |
|
77 |
.getWizardComponents()); |
|
78 |
JPanelFieldDefinition panelFields = new JPanelFieldDefinition( |
|
79 |
wizard.getWizardComponents()); |
|
61 | 80 |
|
62 |
DriverManager writerManager = LayerFactory.getDM(); |
|
63 |
ArrayList spatialDrivers = new ArrayList(); |
|
64 |
String[] writerNames = writerManager.getDriverNames(); |
|
65 |
for (int i=0; i<writerNames.length; i++) |
|
66 |
{ |
|
67 |
Driver drv = writerManager.getDriver(writerNames[i]); |
|
68 |
if (drv instanceof ISpatialWriter) |
|
69 |
spatialDrivers.add(drv.getName()); |
|
70 |
} |
|
81 |
if (actionCommand.equals("SHP")) { |
|
82 |
wizard.getWizardComponents().addWizardPanel(panelChoose); |
|
83 |
wizard.getWizardComponents().addWizardPanel(panelFields); |
|
71 | 84 |
|
72 |
ChooseGeometryType panelChoose = new ChooseGeometryType(wizard.getWizardComponents()); |
|
73 |
JPanelFieldDefinition panelFields = new JPanelFieldDefinition(wizard.getWizardComponents()); |
|
85 |
Driver driver = writerManager.getDriver("gvSIG shp driver"); |
|
86 |
panelFields.setWriter(((IWriteable) driver).getWriter()); |
|
87 |
panelChoose.setDriver(driver); |
|
88 |
FileBasedPanel filePanel = new FileBasedPanel(wizard |
|
89 |
.getWizardComponents()); |
|
90 |
filePanel.setFileExtension("shp"); |
|
91 |
wizard.getWizardComponents().addWizardPanel(filePanel); |
|
74 | 92 |
|
75 |
if (actionCommand.equals("SHP")) |
|
76 |
{ |
|
77 |
wizard.getWizardComponents().addWizardPanel(panelChoose); |
|
78 |
wizard.getWizardComponents().addWizardPanel(panelFields); |
|
93 |
wizard.getWizardComponents().setFinishAction( |
|
94 |
new MyFinishAction(wizard.getWizardComponents(), |
|
95 |
vista, actionCommand)); |
|
96 |
} |
|
97 |
if (actionCommand.equals("DXF")) { |
|
98 |
panelChoose.setDriver(writerManager |
|
99 |
.getDriver("gvSIG DXF Memory Driver")); |
|
100 |
FileBasedPanel filePanel = new FileBasedPanel(wizard |
|
101 |
.getWizardComponents()); |
|
102 |
filePanel.setFileExtension("dxf"); |
|
103 |
wizard.getWizardComponents().addWizardPanel(filePanel); |
|
104 |
wizard.getWizardComponents().getBackButton().setEnabled( |
|
105 |
false); |
|
106 |
wizard.getWizardComponents().getNextButton().setEnabled( |
|
107 |
false); |
|
79 | 108 |
|
80 |
Driver driver = writerManager.getDriver("gvSIG shp driver"); |
|
81 |
panelFields.setWriter(((IWriteable)driver).getWriter()); |
|
82 |
panelChoose.setDriver(driver); |
|
83 |
FileBasedPanel filePanel = new FileBasedPanel(wizard.getWizardComponents()); |
|
84 |
filePanel.setFileExtension("shp"); |
|
85 |
wizard.getWizardComponents().addWizardPanel(filePanel); |
|
109 |
wizard.getWizardComponents().setFinishAction( |
|
110 |
new MyFinishAction(wizard.getWizardComponents(), |
|
111 |
vista, actionCommand)); |
|
112 |
} |
|
113 |
if (actionCommand.equals("POSTGIS")) { |
|
114 |
wizard.getWizardComponents().addWizardPanel(panelChoose); |
|
115 |
wizard.getWizardComponents().addWizardPanel(panelFields); |
|
116 |
Driver driver = writerManager |
|
117 |
.getDriver("PostGIS JDBC Driver"); |
|
118 |
panelChoose.setDriver(driver); |
|
119 |
panelFields.setWriter(((IWriteable) driver).getWriter()); |
|
120 |
wizard.getWizardComponents().addWizardPanel( |
|
121 |
new PostGISpanel(wizard.getWizardComponents())); |
|
86 | 122 |
|
87 |
wizard.getWizardComponents().setFinishAction( |
|
88 |
new MyFinishAction(wizard.getWizardComponents(), |
|
89 |
vista, actionCommand)); |
|
90 |
} |
|
91 |
if (actionCommand.equals("DXF")) |
|
92 |
{ |
|
93 |
panelChoose.setDriver(writerManager.getDriver("gvSIG DXF Memory Driver")); |
|
94 |
FileBasedPanel filePanel = new FileBasedPanel(wizard.getWizardComponents()); |
|
95 |
filePanel.setFileExtension("dxf"); |
|
96 |
wizard.getWizardComponents().addWizardPanel(filePanel); |
|
97 |
wizard.getWizardComponents().getBackButton().setEnabled(false); |
|
98 |
wizard.getWizardComponents().getNextButton().setEnabled(false); |
|
123 |
wizard.getWizardComponents().setFinishAction( |
|
124 |
new MyFinishAction(wizard.getWizardComponents(), |
|
125 |
vista, actionCommand)); |
|
126 |
} |
|
99 | 127 |
|
100 |
wizard.getWizardComponents().setFinishAction( |
|
101 |
new MyFinishAction(wizard.getWizardComponents(), |
|
102 |
vista, actionCommand)); |
|
128 |
wizard.getWizardComponents().getFinishButton() |
|
129 |
.setEnabled(false); |
|
130 |
wizard.getWindowInfo().setWidth(640); |
|
131 |
wizard.getWindowInfo().setHeight(350); |
|
132 |
wizard.getWindowInfo().setTitle( |
|
133 |
PluginServices.getText(this, "new_layer")); |
|
134 |
// Utilities.centerComponentOnScreen(wizard); |
|
135 |
// wizardFrame.show(); |
|
136 |
PluginServices.getMDIManager().addWindow(wizard); |
|
137 |
// System.out.println("Salgo con " + panelChoose.getLayerName()); |
|
138 |
} catch (DriverLoadException e) { |
|
139 |
e.printStackTrace(); |
|
103 | 140 |
} |
104 |
if (actionCommand.equals("POSTGIS")) |
|
105 |
{ |
|
106 |
wizard.getWizardComponents().addWizardPanel(panelChoose); |
|
107 |
wizard.getWizardComponents().addWizardPanel(panelFields); |
|
108 |
Driver driver = writerManager.getDriver("PostGIS JDBC Driver"); |
|
109 |
panelChoose.setDriver(driver); |
|
110 |
panelFields.setWriter(((IWriteable)driver).getWriter()); |
|
111 |
wizard.getWizardComponents().addWizardPanel( |
|
112 |
new PostGISpanel(wizard.getWizardComponents())); |
|
113 |
|
|
114 |
wizard.getWizardComponents().setFinishAction( |
|
115 |
new MyFinishAction(wizard.getWizardComponents(), |
|
116 |
vista, actionCommand)); |
|
117 |
} |
|
118 |
wizard.getWizardComponents().getFinishButton().setEnabled(false); |
|
119 |
wizard.getWindowInfo().setWidth(640); |
|
120 |
wizard.getWindowInfo().setHeight(350); |
|
121 |
wizard.getWindowInfo().setTitle(PluginServices.getText(this,"new_layer")); |
|
122 |
// Utilities.centerComponentOnScreen(wizard); |
|
123 |
// wizardFrame.show(); |
|
124 |
PluginServices.getMDIManager().addWindow(wizard); |
|
125 |
// System.out.println("Salgo con " + panelChoose.getLayerName()); |
|
126 | 141 |
} |
127 | 142 |
} |
128 | 143 |
/** |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/ExportTo.java | ||
---|---|---|
518 | 518 |
} catch (InitializeWriterException e) { |
519 | 519 |
// TODO Auto-generated catch block |
520 | 520 |
e.printStackTrace(); |
521 |
} catch (DriverLoadException e) { |
|
522 |
// TODO Auto-generated catch block |
|
523 |
e.printStackTrace(); |
|
521 | 524 |
} |
522 | 525 |
|
523 | 526 |
} |
... | ... | |
643 | 646 |
} catch (ReadDriverException e) { |
644 | 647 |
// TODO Auto-generated catch block |
645 | 648 |
e.printStackTrace(); |
649 |
} catch (DriverLoadException e) { |
|
650 |
// TODO Auto-generated catch block |
|
651 |
e.printStackTrace(); |
|
646 | 652 |
} |
647 | 653 |
|
648 | 654 |
} |
... | ... | |
697 | 703 |
} catch (ExpansionFileReadException e) { |
698 | 704 |
// TODO Auto-generated catch block |
699 | 705 |
e.printStackTrace(); |
706 |
} catch (DriverLoadException e) { |
|
707 |
// TODO Auto-generated catch block |
|
708 |
e.printStackTrace(); |
|
700 | 709 |
} |
701 | 710 |
|
702 | 711 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/SelectionCADTool.java | ||
---|---|---|
176 | 176 |
} |
177 | 177 |
|
178 | 178 |
protected void pointDoubleClick(MapControl map) throws ReadDriverException { |
179 |
try { |
|
180 |
FLayer[] actives = map.getMapContext() |
|
181 |
.getLayers().getActives(); |
|
182 |
for (int i=0; i < actives.length; i++){ |
|
183 |
if (actives[i] instanceof FLyrAnnotation && actives[i].isEditing()) { |
|
184 |
FLyrAnnotation lyrAnnotation = (FLyrAnnotation) actives[i]; |
|
185 |
|
|
186 |
lyrAnnotation.setSelectedEditing(); |
|
187 |
lyrAnnotation.setInEdition(lyrAnnotation.getRecordset().getSelection().nextSetBit(0)); |
|
188 |
FLabel fl=lyrAnnotation.getLabel(lyrAnnotation.getInEdition()); |
|
189 |
if (fl!=null){ |
|
190 |
|
|
191 |
View vista=(View)PluginServices.getMDIManager().getActiveWindow(); |
|
192 |
TextFieldEdit tfe=new TextFieldEdit(lyrAnnotation); |
|
193 |
|
|
194 |
tfe.show(vista.getMapControl().getViewPort().fromMapPoint(fl.getOrig()),vista.getMapControl()); |
|
195 |
} |
|
196 |
} |
|
179 |
FLayer[] actives = map.getMapContext() |
|
180 |
.getLayers().getActives(); |
|
181 |
for (int i=0; i < actives.length; i++){ |
|
182 |
if (actives[i] instanceof FLyrAnnotation && actives[i].isEditing()) { |
|
183 |
FLyrAnnotation lyrAnnotation = (FLyrAnnotation) actives[i]; |
|
184 |
lyrAnnotation.setSelectedEditing(); |
|
185 |
lyrAnnotation.setInEdition(lyrAnnotation.getRecordset().getSelection().nextSetBit(0)); |
|
186 |
FLabel fl=lyrAnnotation.getLabel(lyrAnnotation.getInEdition()); |
|
187 |
if (fl!=null){ |
|
188 |
View vista=(View)PluginServices.getMDIManager().getActiveWindow(); |
|
189 |
TextFieldEdit tfe=new TextFieldEdit(lyrAnnotation); |
|
190 |
tfe.show(vista.getMapControl().getViewPort().fromMapPoint(fl.getOrig()),vista.getMapControl()); |
|
191 |
} |
|
197 | 192 |
} |
198 |
|
|
199 |
} catch (DriverLoadException e) { |
|
200 |
e.printStackTrace(); |
|
201 |
} |
|
202 |
|
|
193 |
} |
|
203 | 194 |
} |
204 | 195 |
/** |
205 | 196 |
* Equivale al transition del prototipo pero sin pasarle como par? metro el |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/DefaultCADTool.java | ||
---|---|---|
196 | 196 |
vea.setSelectionImage(selectionImage); |
197 | 197 |
|
198 | 198 |
|
199 |
} catch (DriverLoadException e) { |
|
200 |
e.printStackTrace(); |
|
201 |
return; |
|
202 | 199 |
} catch (ReadDriverException e) { |
203 | 200 |
e.printStackTrace(); |
204 | 201 |
return; |
... | ... | |
255 | 252 |
DefaultFeature df = new DefaultFeature(geometry, values, String |
256 | 253 |
.valueOf(num)); |
257 | 254 |
index = vea.addRow(df, getName(), EditionEvent.GRAPHIC); |
258 |
} catch (DriverLoadException e) { |
|
259 |
e.printStackTrace(); |
|
260 | 255 |
} catch (ValidateRowException e) { |
261 | 256 |
// TODO Auto-generated catch block |
262 | 257 |
e.printStackTrace(); |
trunk/extensions/extJDBC/src/com/iver/cit/gvsig/fmap/layers/FLayerJDBCVectorial.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.cresques.cts.IProjection; |
4 | 4 |
|
5 |
import com.hardcode.driverManager.DriverLoadException; |
|
5 | 6 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
6 | 7 |
import com.iver.cit.gvsig.exceptions.layers.DriverLayerException; |
7 | 8 |
import com.iver.cit.gvsig.exceptions.layers.LegendLayerException; |
... | ... | |
38 | 39 |
this.dbDriver = driver; |
39 | 40 |
} |
40 | 41 |
|
41 |
public void setDriverByName(String driverName) { |
|
42 |
this.setDriver( |
|
43 |
(VectorialDatabaseDriver)LayerFactory.getDM().getDriver(driverName) |
|
44 |
); |
|
42 |
public void setDriverByName(String driverName) throws ReadDriverException { |
|
43 |
try { |
|
44 |
this.setDriver( |
|
45 |
(VectorialDatabaseDriver)LayerFactory.getDM().getDriver(driverName) |
|
46 |
); |
|
47 |
} catch (DriverLoadException e) { |
|
48 |
throw new ReadDriverException(getName(),e); |
|
49 |
} |
|
45 | 50 |
} |
46 | 51 |
|
47 | 52 |
|
Also available in: Unified diff