Revision 22932
branches/v2_0_0_prep/extensions/extCAD/src/com/iver/cit/gvsig/TableCommandStackExtension.java | ||
---|---|---|
47 | 47 |
} |
48 | 48 |
cr.addObserver(table); |
49 | 49 |
}else{ |
50 |
cr=model.getModelo().getCommandsRecord();
|
|
50 |
cr=model.getModel().getCommandsRecord(); |
|
51 | 51 |
cr.addObserver(table); |
52 | 52 |
} |
53 | 53 |
CommandStackDialog csd = new CommandStackDialog(); |
... | ... | |
72 | 72 |
if (f instanceof Table){ |
73 | 73 |
Table table = (Table) f; |
74 | 74 |
ProjectTable model = table.getModel(); |
75 |
if (model.getModelo().isEditing())
|
|
75 |
if (model.getModel().isEditing()) |
|
76 | 76 |
return true; |
77 | 77 |
} |
78 | 78 |
return false; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditChangeColumnsExtension.java | ||
---|---|---|
76 | 76 |
|
77 | 77 |
} |
78 | 78 |
if ("ADDCOLUMN".equals(actionCommand)) { |
79 |
AttributeDescriptor fad=(AttributeDescriptor)t.getModel().getModelo().getDefaultFeatureType().createNewAttributeDescriptor();
|
|
79 |
AttributeDescriptor fad=(AttributeDescriptor)t.getModel().getModel().getDefaultFeatureType().createNewAttributeDescriptor(); |
|
80 | 80 |
try { |
81 | 81 |
fad.loading(); |
82 | 82 |
fad.setDefaultValue("default"); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableUnion.java | ||
---|---|---|
1 | 1 |
package com.iver.cit.gvsig; |
2 | 2 |
|
3 |
import org.gvsig.fmap.data.ReadException; |
|
3 |
import org.gvsig.fmap.data.CloseException; |
|
4 |
import org.gvsig.fmap.data.DataManager; |
|
5 |
import org.gvsig.fmap.data.DataStoreParameters; |
|
6 |
import org.gvsig.fmap.data.InitializeException; |
|
4 | 7 |
import org.gvsig.fmap.data.feature.FeatureStore; |
5 | 8 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStore; |
9 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStoreParameters; |
|
6 | 10 |
|
7 | 11 |
import com.iver.andami.PluginServices; |
8 | 12 |
import com.iver.andami.messages.NotificationManager; |
... | ... | |
30 | 34 |
public void execute(String actionCommand) { |
31 | 35 |
Table t = (Table) PluginServices.getMDIManager().getActiveWindow(); |
32 | 36 |
ProjectTable pt = t.getModel(); |
33 |
// try { |
|
34 |
FeatureStore fs=pt.getModelo(); |
|
35 |
if (fs instanceof JoinFeatureStore){ |
|
36 |
pt.setModel(((JoinFeatureStore)fs).getPrimaryStore()); |
|
37 |
FeatureStore fs = pt.getModel(); |
|
38 |
if (fs instanceof JoinFeatureStore) { |
|
39 |
DataManager dm = DataManager.getManager(); |
|
40 |
DataStoreParameters originalParams = ((JoinFeatureStoreParameters) fs |
|
41 |
.getParameters()).getStorePrimary(); |
|
42 |
FeatureStore original = null; |
|
43 |
try { |
|
44 |
original = (FeatureStore) dm.createDataStore(originalParams); |
|
45 |
} catch (InitializeException e) { |
|
46 |
NotificationManager.addError(e.getMessage(), e); |
|
47 |
return; |
|
37 | 48 |
} |
38 | 49 |
|
39 |
// pt.restoreDataSource(); |
|
40 |
// Por si acaso ten?amos seleccionado un campo |
|
41 |
// de los de la uni?n, no seleccionamos |
|
42 |
// ning?n campo. |
|
43 |
t.clearSelectedFields(); |
|
50 |
pt.setModel(original); |
|
51 |
try { |
|
52 |
fs.dispose(); |
|
53 |
} catch (CloseException e) { |
|
54 |
NotificationManager.addError(e); |
|
55 |
} |
|
56 |
t.setModel(pt); |
|
44 | 57 |
|
45 |
// } catch (ReadException e) {
|
|
46 |
// NotificationManager.addError(e.getMessage(), e); |
|
47 |
// }
|
|
48 |
t.getModel().setModified(true);
|
|
58 |
}
|
|
59 |
|
|
60 |
t.clearSelectedFields();
|
|
61 |
t.getModel().setModified(true);
|
|
49 | 62 |
} |
50 | 63 |
|
51 | 64 |
/** |
... | ... | |
60 | 73 |
|
61 | 74 |
if (v.getClass() == Table.class) { |
62 | 75 |
Table t = (Table) v; |
63 |
if (t.getModel().getOriginal() != null){ |
|
76 |
// FIXME !!!! Asi se hacia antes |
|
77 |
// if (t.getModel().getOriginal() != null){ |
|
78 |
// return true; |
|
79 |
// } |
|
80 |
|
|
81 |
ProjectTable pt = t.getModel(); |
|
82 |
FeatureStore fs = pt.getModel(); |
|
83 |
if (fs instanceof JoinFeatureStore) { |
|
64 | 84 |
return true; |
65 | 85 |
} |
86 |
|
|
66 | 87 |
} |
67 | 88 |
return false; |
68 | 89 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableNumericFieldOperations.java | ||
---|---|---|
66 | 66 |
int numRows=0; |
67 | 67 |
FeatureStore fs=null; |
68 | 68 |
// try { |
69 |
fs = table.getModel().getModelo();
|
|
69 |
fs = table.getModel().getModel(); |
|
70 | 70 |
// } catch (ReadException e) { |
71 | 71 |
// e.printStackTrace(); |
72 | 72 |
// } |
... | ... | |
224 | 224 |
if (indices.cardinality() == 1){ |
225 | 225 |
// try { |
226 | 226 |
int index=indices.nextSetBit(0); |
227 |
if (table.getModel().getModelo().getDefaultFeatureType().size()<index+1)
|
|
227 |
if (table.getModel().getModel().getDefaultFeatureType().size()<index+1) |
|
228 | 228 |
return false; |
229 |
String type = ((FeatureAttributeDescriptor)table.getModel().getModelo().getDefaultFeatureType().get(index)).getDataType();
|
|
229 |
String type = ((FeatureAttributeDescriptor)table.getModel().getModel().getDefaultFeatureType().get(index)).getDataType(); |
|
230 | 230 |
if ((type.equals(FeatureAttributeDescriptor.TYPE_LONG)) || |
231 | 231 |
(type.equals(FeatureAttributeDescriptor.TYPE_DOUBLE)) || |
232 | 232 |
(type.equals(FeatureAttributeDescriptor.TYPE_FLOAT)) || |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomToSelectExtension.java | ||
---|---|---|
153 | 153 |
for (int i=0;i<windows.length;i++) { |
154 | 154 |
if (windows[i] instanceof View) { |
155 | 155 |
if (((View)windows[i]).getMapControl().getMapContext().equals((t.getModel().getAssociatedTable()).getMapContext())){ |
156 |
if (!t.getModel().getModelo().getSelection().isEmpty()) {
|
|
156 |
if (!t.getModel().getModel().getSelection().isEmpty()) { |
|
157 | 157 |
return true; |
158 | 158 |
} |
159 | 159 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java | ||
---|---|---|
120 | 120 |
PluginServices.getMDIManager().closeWindow(wiz); |
121 | 121 |
|
122 | 122 |
ProjectTable sourceProjectTable = (ProjectTable) sourceTable.getSelected(); |
123 |
FeatureStore fs1 = sourceProjectTable.getModelo();
|
|
123 |
FeatureStore fs1 = sourceProjectTable.getModel(); |
|
124 | 124 |
String tableName1 = fs1.getName(); |
125 | 125 |
|
126 | 126 |
ProjectTable targetProjectTable = (ProjectTable) targetTable.getSelected(); |
127 |
FeatureStore fs2 = targetProjectTable.getModelo();
|
|
127 |
FeatureStore fs2 = targetProjectTable.getModel(); |
|
128 | 128 |
|
129 | 129 |
String tableName2 = fs2.getName(); |
130 | 130 |
|
... | ... | |
150 | 150 |
JoinFeatureStore jfs=(JoinFeatureStore)dm.createDataStore(jfsp); |
151 | 151 |
featureStore=jfs; |
152 | 152 |
ProjectTable projectTable = (ProjectTable) sourceTable.getSelected(); |
153 |
FeatureStore original = projectTable.getModel(); |
|
153 | 154 |
projectTable.setModel(jfs); |
155 |
|
|
156 |
original.dispose(); |
|
157 |
|
|
154 | 158 |
IWindow[] windows=PluginServices.getMDIManager().getAllWindows(); |
155 | 159 |
Table tableWindow; |
156 | 160 |
for (int i = 0; i < windows.length; i++) { |
... | ... | |
178 | 182 |
|
179 | 183 |
try { |
180 | 184 |
firstTableField.setModel(new FieldSelectionModel( |
181 |
pt.getModelo(),
|
|
185 |
pt.getModel(), |
|
182 | 186 |
PluginServices.getText(this, "seleccione_campo_enlace"), |
183 | 187 |
null)); |
184 | 188 |
} catch (SelectionException e) { |
... | ... | |
191 | 195 |
ProjectTable pt = (ProjectTable) sourceTable.getSelected(); |
192 | 196 |
|
193 | 197 |
//?ndice del campo |
194 |
FeatureStore fs = pt.getModelo();
|
|
198 |
FeatureStore fs = pt.getModel(); |
|
195 | 199 |
String fieldName = (String) firstTableField.getSelected(); |
196 | 200 |
String type = fs.getDefaultFeatureType().get(fieldName).getDataType(); |
197 | 201 |
|
198 | 202 |
|
199 | 203 |
secondTableField.setModel(new FieldSelectionModel( |
200 |
((ProjectTable) targetTable.getSelected()).getModelo(), |
|
204 |
((ProjectTable) targetTable |
|
205 |
.getSelected()) |
|
206 |
.getModel(), |
|
201 | 207 |
PluginServices.getText(this, "seleccione_campo_enlace"), |
202 | 208 |
type)); |
203 | 209 |
} catch (SelectionException e) { |
... | ... | |
246 | 252 |
PluginServices.getMDIManager().closeWindow(wiz); |
247 | 253 |
|
248 | 254 |
ProjectTable sourceProjectTable = (ProjectTable) sourceTable.getSelected(); |
249 |
FeatureStore sds1 = sourceProjectTable.getModelo();
|
|
255 |
FeatureStore sds1 = sourceProjectTable.getModel(); |
|
250 | 256 |
|
251 | 257 |
ProjectTable targetProjectTable = (ProjectTable) targetTable.getSelected(); |
252 |
FeatureStore sds2 = targetProjectTable.getModelo();
|
|
258 |
FeatureStore sds2 = targetProjectTable.getModel(); |
|
253 | 259 |
|
254 | 260 |
String field1 = (String) firstTableField.getSelected(); |
255 | 261 |
String field2 = (String) secondTableField.getSelected(); |
... | ... | |
268 | 274 |
|
269 | 275 |
try { |
270 | 276 |
firstTableField.setModel(new FieldSelectionModel( |
271 |
pt.getModelo(),
|
|
277 |
pt.getModel(), |
|
272 | 278 |
PluginServices.getText(this, "seleccione_campo_enlace"), |
273 | 279 |
null)); |
274 | 280 |
} catch (SelectionException e) { |
... | ... | |
281 | 287 |
ProjectTable pt = (ProjectTable) sourceTable.getSelected(); |
282 | 288 |
|
283 | 289 |
//?ndice del campo |
284 |
FeatureStore fs = pt.getModelo();
|
|
290 |
FeatureStore fs = pt.getModel(); |
|
285 | 291 |
String fieldName = (String) firstTableField.getSelected(); |
286 | 292 |
String type = fs.getDefaultFeatureType().get(fieldName).getDataType(); |
287 | 293 |
|
288 | 294 |
secondTableField.setModel(new FieldSelectionModel( |
289 |
((ProjectTable) targetTable.getSelected()).getModelo(), |
|
295 |
((ProjectTable) targetTable |
|
296 |
.getSelected()) |
|
297 |
.getModel(), |
|
290 | 298 |
PluginServices.getText(this, "seleccione_campo_enlace"), |
291 | 299 |
type)); |
292 | 300 |
} catch (SelectionException e) { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/FiltroExtension.java | ||
---|---|---|
103 | 103 |
if (v instanceof Table) { |
104 | 104 |
table = (Table) v; |
105 | 105 |
|
106 |
featureStore = table.getModel().getModelo();
|
|
106 |
featureStore = table.getModel().getModel(); |
|
107 | 107 |
filterTitle = table.getModel().getName(); |
108 | 108 |
table.getModel().setModified(true); |
109 | 109 |
} else if (v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableFieldOperations.java | ||
---|---|---|
62 | 62 |
*/ |
63 | 63 |
protected void doExecute(String actionCommand,Table table){ |
64 | 64 |
int fieldIndex = table.getSelectedFieldIndices().nextSetBit(0); |
65 |
FeatureStore fs=table.getModel().getModelo();
|
|
65 |
FeatureStore fs=table.getModel().getModel(); |
|
66 | 66 |
// DataSource sds=null; |
67 | 67 |
// try { |
68 | 68 |
// sds = table.getModel().getModelo().getRecordset(); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStopExtension.java | ||
---|---|---|
108 | 108 |
ProjectExtension pe=(ProjectExtension)PluginServices.getExtension(ProjectExtension.class); |
109 | 109 |
ProjectTable[] tables=(ProjectTable[])pe.getProject().getDocumentsByType(ProjectTableFactory.registerName).toArray(new ProjectTable[0]); |
110 | 110 |
for (int i=0;i<tables.length;i++) { |
111 |
if (tables[i].getModelo() == null){
|
|
111 |
if (tables[i].getModel() == null){ |
|
112 | 112 |
continue; |
113 | 113 |
} |
114 |
if (tables[i].getModelo().isEditing())
|
|
114 |
if (tables[i].getModel().isEditing()) |
|
115 | 115 |
return true; |
116 | 116 |
} |
117 | 117 |
return false; |
... | ... | |
148 | 148 |
ProjectTable[] tables =(ProjectTable[])pe.getProject().getDocumentsByType(ProjectTableFactory.registerName).toArray(new ProjectTable[0]); |
149 | 149 |
ArrayList unsavedTables = new ArrayList(); |
150 | 150 |
for (int i=0;i<tables.length;i++) { |
151 |
if (tables[i].getModelo() == null){
|
|
151 |
if (tables[i].getModel() == null){ |
|
152 | 152 |
continue; |
153 | 153 |
} |
154 |
if (tables[i].getModelo().isEditing()) {
|
|
154 |
if (tables[i].getModel().isEditing()) { |
|
155 | 155 |
UnsavedTable ul=new UnsavedTable(TableEditStopExtension.this); |
156 | 156 |
ul.setTable(tables[i]); |
157 | 157 |
unsavedTables.add(ul); |
... | ... | |
194 | 194 |
|
195 | 195 |
//TODO Este c?digo est? duplicado, tambi?n est? en la clase Table en el m?todo "public void stopEditing()" |
196 | 196 |
private boolean executeSaveTable(ProjectTable table2) { |
197 |
FeatureStore fs = table2.getModelo();
|
|
197 |
FeatureStore fs = table2.getModel(); |
|
198 | 198 |
try { |
199 | 199 |
fs.finishEditing(); |
200 | 200 |
} catch (WriteException e) { |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/UndoTableExtension.java | ||
---|---|---|
78 | 78 |
|
79 | 79 |
if (s.compareTo("UNDO") == 0) { |
80 | 80 |
if (tabla.isEditing()){ |
81 |
FeatureStore fs=tabla.getModel().getModelo();
|
|
81 |
FeatureStore fs=tabla.getModel().getModel(); |
|
82 | 82 |
fs.undo(); |
83 | 83 |
fs.getSelection().clear(); |
84 | 84 |
} |
... | ... | |
94 | 94 |
//MapControl mapControl = (MapControl) vista.getMapControl(); |
95 | 95 |
//FLayers layers=mapControl.getMapContext().getLayers(); |
96 | 96 |
//for (int i=0;i<layers.getLayersCount();i++){ |
97 |
if (tabla.getModel().getModelo() instanceof FeatureStore && tabla.isEditing()){
|
|
98 |
FeatureStore fs = tabla.getModel().getModelo();
|
|
97 |
if (tabla.getModel().getModel() instanceof FeatureStore && tabla.isEditing()){ |
|
98 |
FeatureStore fs = tabla.getModel().getModel(); |
|
99 | 99 |
if (fs==null)return false; |
100 | 100 |
return fs.getCommandsRecord().moreUndoCommands(); |
101 | 101 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableManageFields.java | ||
---|---|---|
71 | 71 |
|
72 | 72 |
Table t = (Table) v; |
73 | 73 |
ProjectTable pt = t.getModel(); |
74 |
FeatureStore fs = pt.getModelo();
|
|
74 |
FeatureStore fs = pt.getModel(); |
|
75 | 75 |
if (fs.canAlterFeatureType()) |
76 | 76 |
{ |
77 | 77 |
// IFieldManager fieldManager = (IFieldManager) writer; |
... | ... | |
109 | 109 |
|
110 | 110 |
if (v instanceof Table) { |
111 | 111 |
Table t = (Table) v; |
112 |
FeatureStore fs = t.getModel().getModelo();
|
|
112 |
FeatureStore fs = t.getModel().getModel(); |
|
113 | 113 |
// ProjectTable pt = t.getModel(); |
114 | 114 |
return fs.isEditing(); |
115 | 115 |
|
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/RedoTableExtension.java | ||
---|---|---|
78 | 78 |
|
79 | 79 |
if (s.compareTo("REDO") == 0) { |
80 | 80 |
if (tabla.isEditing()){ |
81 |
FeatureStore fs=tabla.getModel().getModelo();
|
|
81 |
FeatureStore fs=tabla.getModel().getModel(); |
|
82 | 82 |
fs.redo(); |
83 | 83 |
fs.getSelection().clear(); |
84 | 84 |
//tabla.refresh(); |
... | ... | |
95 | 95 |
//MapControl mapControl = (MapControl) vista.getMapControl(); |
96 | 96 |
//FLayers layers=mapControl.getMapContext().getLayers(); |
97 | 97 |
//for (int i=0;i<layers.getLayersCount();i++){ |
98 |
if (tabla.getModel().getModelo() instanceof FeatureStore && tabla.isEditing()){
|
|
99 |
FeatureStore fs=tabla.getModel().getModelo();
|
|
98 |
if (tabla.getModel().getModel() instanceof FeatureStore && tabla.isEditing()){ |
|
99 |
FeatureStore fs=tabla.getModel().getModel(); |
|
100 | 100 |
if (fs==null)return false; |
101 | 101 |
return fs.getCommandsRecord().moreRedoCommands(); |
102 | 102 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableRowsOperations.java | ||
---|---|---|
70 | 70 |
*/ |
71 | 71 |
private void invertSelection(Table table) { |
72 | 72 |
try { |
73 |
FeatureStore fs = table.getModel().getModelo();
|
|
73 |
FeatureStore fs = table.getModel().getModel(); |
|
74 | 74 |
FeatureCollection selection=(FeatureCollection)fs.getSelection(); |
75 | 75 |
FeatureCollection fCollection=(FeatureCollection)fs.getDataCollection(); |
76 | 76 |
fCollection.removeAll(selection); |
... | ... | |
87 | 87 |
private void showsSelectedRows(Table table) { |
88 | 88 |
long[] mapping=null; |
89 | 89 |
try { |
90 |
FeatureStore fs=table.getModel().getModelo();
|
|
90 |
FeatureStore fs=table.getModel().getModel(); |
|
91 | 91 |
mapping = new long[fs.getDataCollection().size()]; |
92 | 92 |
|
93 | 93 |
FeatureCollection selectedRows=(FeatureCollection)fs.getSelection(); |
... | ... | |
127 | 127 |
Table table = (Table) v; |
128 | 128 |
|
129 | 129 |
// try { |
130 |
return !table.getModel().getModelo().getSelection().isEmpty();
|
|
130 |
return !table.getModel().getModel().getSelection().isEmpty(); |
|
131 | 131 |
// } catch (ReadException e) { |
132 | 132 |
// e.printStackTrace(); |
133 | 133 |
// } |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStartExtension.java | ||
---|---|---|
120 | 120 |
if (v instanceof Table) |
121 | 121 |
{ |
122 | 122 |
Table t = (Table) v; |
123 |
FeatureStore fs = t.getModel().getModelo();
|
|
123 |
FeatureStore fs = t.getModel().getModel(); |
|
124 | 124 |
// FJP: |
125 | 125 |
// Si est? linkada, por ahora no dejamos editar |
126 | 126 |
// TODO: Esto evita la edici?n en un sentido, pero no en el otro |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/ClearSelectionExtension.java | ||
---|---|---|
97 | 97 |
ProjectTable model = table.getModel(); |
98 | 98 |
FeatureStore featureStore=null; |
99 | 99 |
// try { |
100 |
featureStore = model.getModelo();
|
|
100 |
featureStore = model.getModel(); |
|
101 | 101 |
// } catch (ReadException e) { |
102 | 102 |
// e.printStackTrace(); |
103 | 103 |
// } |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/TableModelProperties.java | ||
---|---|---|
73 | 73 |
public TableModelProperties(ProjectTable t) { |
74 | 74 |
FeatureStore ds = t.getOriginal(); |
75 | 75 |
if (ds == null) { |
76 |
ds = t.getModelo();
|
|
76 |
ds = t.getModel(); |
|
77 | 77 |
} |
78 | 78 |
alias = t.getAliases(); |
79 | 79 |
int[] mapping = t.getMapping(); |
... | ... | |
97 | 97 |
*/ |
98 | 98 |
public int getRowCount() { |
99 | 99 |
// try { |
100 |
return table.getModelo().getDefaultFeatureType().size();
|
|
100 |
return table.getModel().getDefaultFeatureType().size(); |
|
101 | 101 |
// } catch (ReadException e) { |
102 | 102 |
// NotificationManager.addError("No se pudo leer la informaci?n de la tabla", e); |
103 | 103 |
// return 0; |
... | ... | |
112 | 112 |
return new Boolean(visibles.get(rowIndex)); |
113 | 113 |
} else if (columnIndex == 1) { |
114 | 114 |
// try { |
115 |
return ((FeatureAttributeDescriptor)table.getModelo().getDefaultFeatureType().get(rowIndex));
|
|
115 |
return ((FeatureAttributeDescriptor)table.getModel().getDefaultFeatureType().get(rowIndex)); |
|
116 | 116 |
// } catch (ReadException e) { |
117 | 117 |
// NotificationManager.addError("Error accediendo al nombre del campo", e); |
118 | 118 |
// return "error!"; |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/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(); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/tablemodel/DataSourceDataModel.java | ||
---|---|---|
41 | 41 |
hasAssociatedLayer=true; |
42 | 42 |
} |
43 | 43 |
try { |
44 |
featureCollection=(FeatureCollection)pt.getModelo().getDataCollection(pt.getModelo().getDefaultFeatureType(),null,order);
|
|
44 |
featureCollection=(FeatureCollection)pt.getModel().getDataCollection(pt.getModel().getDefaultFeatureType(),null,order);
|
|
45 | 45 |
} catch (ReadException e) { |
46 | 46 |
// TODO Auto-generated catch block |
47 | 47 |
e.printStackTrace(); |
... | ... | |
88 | 88 |
*/ |
89 | 89 |
public int getRowCount() { |
90 | 90 |
try { |
91 |
FeatureStore fs = pt.getModelo();
|
|
91 |
FeatureStore fs = pt.getModel(); |
|
92 | 92 |
return ((FeatureCollection)fs.getDataCollection()).size(); |
93 | 93 |
} catch (ReadException e) { |
94 | 94 |
return 0; |
... | ... | |
187 | 187 |
// } catch (ReadDriverException e) { |
188 | 188 |
// e.printStackTrace(); |
189 | 189 |
// } |
190 |
return pt.getModelo().isEditing();
|
|
190 |
return pt.getModel().isEditing(); |
|
191 | 191 |
} |
192 | 192 |
|
193 | 193 |
/** |
... | ... | |
213 | 213 |
if (getValueAt(rowIndex,columnIndex)==null || getValueAt(rowIndex,columnIndex).toString().equals(aValue)) |
214 | 214 |
return; |
215 | 215 |
try { |
216 |
FeatureStore fs = pt.getModelo();
|
|
216 |
FeatureStore fs = pt.getModel(); |
|
217 | 217 |
// try{ |
218 | 218 |
// v = ValueFactory.createValueByType(aValue.toString(), |
219 | 219 |
// des.getRecordset().getFieldType(columnIndex)); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTable.java | ||
---|---|---|
140 | 140 |
* |
141 | 141 |
* @return |
142 | 142 |
*/ |
143 |
public FeatureStore getModelo() {
|
|
143 |
public FeatureStore getModel() { |
|
144 | 144 |
return esModel; |
145 | 145 |
} |
146 | 146 |
|
... | ... | |
640 | 640 |
public void removeLinkTable() { |
641 | 641 |
linkTable = null; |
642 | 642 |
// try { |
643 |
getModelo().deleteObserver(linkSelectionObserver);//removeLinksSelectionListener();
|
|
643 |
getModel().deleteObserver(linkSelectionObserver);//removeLinksSelectionListener(); |
|
644 | 644 |
// } catch (ReadException e) { |
645 | 645 |
// e.printStackTrace(); |
646 | 646 |
// } |
... | ... | |
701 | 701 |
} |
702 | 702 |
|
703 | 703 |
public IWindow createWindow() { |
704 |
if (this.getModelo() == null)
|
|
704 |
if (this.getModel() == null) |
|
705 | 705 |
return null; |
706 | 706 |
com.iver.cit.gvsig.project.documents.table.gui.Table table = new com.iver.cit.gvsig.project.documents.table.gui.Table(); |
707 | 707 |
table.setModel(this); |
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/Project.java | ||
---|---|---|
1185 | 1185 |
&& ((ProjectTable) tables.get(i)).getLinkTable() |
1186 | 1186 |
.equals( |
1187 | 1187 |
((ProjectTable) tables.get(j)) |
1188 |
.getModelo()
|
|
1188 |
.getModel() |
|
1189 | 1189 |
.getName())) { |
1190 | 1190 |
LinkSelectionObserver lso; |
1191 | 1191 |
|
1192 | 1192 |
lso = new LinkSelectionObserver(((ProjectTable) tables |
1193 |
.get(i)).getModelo(),
|
|
1194 |
((ProjectTable) tables.get(j)).getModelo(),
|
|
1193 |
.get(i)).getModel(), |
|
1194 |
((ProjectTable) tables.get(j)).getModel(), |
|
1195 | 1195 |
((ProjectTable) tables |
1196 | 1196 |
.get(i)).getField1(), |
1197 | 1197 |
((ProjectTable) tables.get(i)).getField2()); |
1198 | 1198 |
|
1199 |
(((ProjectTable) tables.get(i)).getModelo()).addObserver(lso);
|
|
1199 |
(((ProjectTable) tables.get(i)).getModel()).addObserver(lso); |
|
1200 | 1200 |
((ProjectTable) tables.get(i)).addLinkSelectionObserver(lso); |
1201 | 1201 |
|
1202 | 1202 |
} |
branches/v2_0_0_prep/applications/appgvSIG/src-test/com/iver/cit/gvsig/test/Persistence.java | ||
---|---|---|
106 | 106 |
/* |
107 | 107 |
* Comprobamos que las dos tablas son id?nticas |
108 | 108 |
*/ |
109 |
assertTrue(((ProjectTable)p2.getDocumentsByType(ProjectTableFactory.registerName).get(0)).getModelo().getRecordset().getAsString().equals(((ProjectTable)p.getTables().get(0)).getModelo().getRecordset().getAsString()));
|
|
110 |
assertTrue(((ProjectTable)p2.getDocumentsByType(ProjectTableFactory.registerName).get(1)).getModelo().getRecordset().getAsString().equals(((ProjectTable)p.getTables().get(1)).getModelo().getRecordset().getAsString()));
|
|
109 |
assertTrue(((ProjectTable)p2.getDocumentsByType(ProjectTableFactory.registerName).get(0)).getModel().getRecordset().getAsString().equals(((ProjectTable)p.getTables().get(0)).getModel().getRecordset().getAsString()));
|
|
110 |
assertTrue(((ProjectTable)p2.getDocumentsByType(ProjectTableFactory.registerName).get(1)).getModel().getRecordset().getAsString().equals(((ProjectTable)p.getTables().get(1)).getModel().getRecordset().getAsString()));
|
|
111 | 111 |
} |
112 | 112 |
} |
Also available in: Unified diff