Revision 22932 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/Table.java
Table.java | ||
---|---|---|
236 | 236 |
*/ |
237 | 237 |
public void setModel(ProjectTable table) { |
238 | 238 |
model = table; |
239 |
memoryCollection = new MemoryFeatureCollection(model.getModelo());
|
|
239 |
memoryCollection = new MemoryFeatureCollection(model.getModel()); |
|
240 | 240 |
//Gesti?n del nombre de la ventana |
241 | 241 |
model.addPropertyChangeListener(new PropertyChangeListener() { |
242 | 242 |
public void propertyChange(PropertyChangeEvent evt) { |
... | ... | |
250 | 250 |
} |
251 | 251 |
}); |
252 | 252 |
|
253 |
FeatureStore fs=getModel().getModelo();
|
|
253 |
FeatureStore fs=getModel().getModel(); |
|
254 | 254 |
fs.addObserver(this); |
255 | 255 |
// ies.addEditionListener(this); |
256 | 256 |
|
... | ... | |
267 | 267 |
DefaultListSelectionModel sm = (DefaultListSelectionModel) getTable() |
268 | 268 |
.getSelectionModel(); |
269 | 269 |
sm.clearSelection(); |
270 |
FeatureCollection selection = (FeatureCollection)model.getModelo().getSelection();
|
|
271 |
FeatureCollection collection= (FeatureCollection)model.getModelo().getDataCollection();
|
|
270 |
FeatureCollection selection = (FeatureCollection)model.getModel().getSelection(); |
|
271 |
FeatureCollection collection= (FeatureCollection)model.getModel().getDataCollection(); |
|
272 | 272 |
sm.setValueIsAdjusting(true); |
273 | 273 |
|
274 | 274 |
// if (model.getOrderIndexes() != null) { |
... | ... | |
312 | 312 |
//// } |
313 | 313 |
|
314 | 314 |
sm.setValueIsAdjusting(false); |
315 |
numReg = model.getModelo().getDataCollection().size();
|
|
315 |
numReg = model.getModel().getDataCollection().size(); |
|
316 | 316 |
|
317 | 317 |
jLabelStatus.setText(" " + |
318 |
model.getModelo().getSelection().size() + " / " + numReg + " " +
|
|
318 |
model.getModel().getSelection().size() + " / " + numReg + " " + |
|
319 | 319 |
PluginServices.getText(this, "registros_seleccionados_total") + |
320 | 320 |
"."); |
321 | 321 |
if (PluginServices.getMainFrame() != null) { |
... | ... | |
367 | 367 |
if (updating) { |
368 | 368 |
return; |
369 | 369 |
} |
370 |
FeatureCollection selection=(FeatureCollection)getModel().getModelo().createSelection();
|
|
370 |
FeatureCollection selection=(FeatureCollection)getModel().getModel().createSelection(); |
|
371 | 371 |
|
372 | 372 |
int firstIndex=e.getFirstIndex(); |
373 | 373 |
if (firstIndex >= 0) { |
374 | 374 |
FeatureCollection collection=null; |
375 | 375 |
try { |
376 |
collection = (FeatureCollection)getModel().getModelo().getDataCollection();
|
|
376 |
collection = (FeatureCollection)getModel().getModel().getDataCollection(); |
|
377 | 377 |
} catch (ReadException e1) { |
378 | 378 |
// TODO Auto-generated catch block |
379 | 379 |
e1.printStackTrace(); |
... | ... | |
390 | 390 |
} |
391 | 391 |
} |
392 | 392 |
try { |
393 |
getModel().getModelo().setSelection(selection);
|
|
393 |
getModel().getModel().setSelection(selection); |
|
394 | 394 |
} catch (DataException e1) { |
395 | 395 |
// TODO Auto-generated catch block |
396 | 396 |
e1.printStackTrace(); |
... | ... | |
675 | 675 |
*/ |
676 | 676 |
public void startEditing() throws StartEditingTableException { |
677 | 677 |
try { |
678 |
getModel().getModelo().startEditing();
|
|
678 |
getModel().getModel().startEditing(); |
|
679 | 679 |
} catch (ReadException e) { |
680 | 680 |
throw new StartEditingTableException(getName(), e); |
681 | 681 |
} |
... | ... | |
796 | 796 |
*/ |
797 | 797 |
public void cancelEditing() throws CancelEditingTableException { |
798 | 798 |
this.cancelEditingCell(); |
799 |
getModel().getModelo().cancelEditing();
|
|
799 |
getModel().getModel().cancelEditing(); |
|
800 | 800 |
// try { |
801 | 801 |
// getModel().getModelo().cancelEdition(EditionEvent.ALPHANUMERIC); |
802 | 802 |
// } catch (CancelEditingLayerException e) { |
... | ... | |
822 | 822 |
* @return DOCUMENT ME! |
823 | 823 |
*/ |
824 | 824 |
public boolean isEditing() { |
825 |
return getModel().getModelo().isEditing();
|
|
825 |
return getModel().getModel().isEditing(); |
|
826 | 826 |
} |
827 | 827 |
|
828 | 828 |
/** |
... | ... | |
973 | 973 |
* DOCUMENT ME! |
974 | 974 |
*/ |
975 | 975 |
public void addColumn(FeatureAttributeDescriptor newField) { |
976 |
FeatureStore featureStore = getModel().getModelo();
|
|
976 |
FeatureStore featureStore = getModel().getModel(); |
|
977 | 977 |
try { |
978 | 978 |
featureStore.startEditing(); |
979 | 979 |
featureStore.getDefaultFeatureType().add(newField); |
... | ... | |
994 | 994 |
* DOCUMENT ME! |
995 | 995 |
*/ |
996 | 996 |
public void removeColumn() { |
997 |
FeatureStore featureStore = getModel().getModelo();
|
|
997 |
FeatureStore featureStore = getModel().getModel(); |
|
998 | 998 |
try { |
999 | 999 |
BitSet selectedFields = getSelectedFieldIndices(); |
1000 | 1000 |
// SelectableDataSource sds = edAdapter.getRecordset(); |
... | ... | |
1271 | 1271 |
} |
1272 | 1272 |
|
1273 | 1273 |
public void addFeatures(FeatureCollection memoryCollection) throws ReadException { |
1274 |
FeatureStore featureStore=getModel().getModelo();
|
|
1274 |
FeatureStore featureStore=getModel().getModel(); |
|
1275 | 1275 |
if (memoryCollection == null) { |
1276 | 1276 |
if (getModel().getAssociatedTable()!=null){ |
1277 | 1277 |
JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),"No se puede a?adir una fila a una tabla asociada a una capa."); |
... | ... | |
1309 | 1309 |
} |
1310 | 1310 |
|
1311 | 1311 |
public void copyFeature() throws ReadException { |
1312 |
FeatureCollection collection=(FeatureCollection)getModel().getModelo().getDataCollection();
|
|
1312 |
FeatureCollection collection=(FeatureCollection)getModel().getModel().getDataCollection(); |
|
1313 | 1313 |
int[] index = getSelectedRowIndices(); |
1314 | 1314 |
for (int i = 0; i < index.length; i++) { |
1315 | 1315 |
Feature feature=collection.getFeature(i); |
... | ... | |
1319 | 1319 |
|
1320 | 1320 |
public void cutFeature() throws ReadException { |
1321 | 1321 |
memoryCollection.clear(); |
1322 |
FeatureCollection collection=(FeatureCollection)getModel().getModelo().getDataCollection();
|
|
1322 |
FeatureCollection collection=(FeatureCollection)getModel().getModel().getDataCollection(); |
|
1323 | 1323 |
int[] index = getSelectedRowIndices(); |
1324 | 1324 |
for (int i = 0; i < index.length; i++) { |
1325 | 1325 |
Feature feature=collection.getFeature(i); |
... | ... | |
1329 | 1329 |
} |
1330 | 1330 |
|
1331 | 1331 |
public void removeFeature() throws ReadException { |
1332 |
FeatureStore store=getModel().getModelo();
|
|
1332 |
FeatureStore store=getModel().getModel(); |
|
1333 | 1333 |
FeatureCollection collection=(FeatureCollection)store.getDataCollection(); |
1334 | 1334 |
int[] index = getSelectedRowIndices(); |
1335 | 1335 |
store.getCommandsRecord().startComplex(); |
Also available in: Unified diff