Revision 22665
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/gui/VectorialUniqueValue.java | ||
---|---|---|
203 | 203 |
} |
204 | 204 |
|
205 | 205 |
idField = elRs.getFieldIndexByName(fieldName); |
206 |
theLegend.setClassifyingFieldNames(new String[] {fieldName});
|
|
206 |
auxLegend.setClassifyingFieldNames(new String[] {fieldName});
|
|
207 | 207 |
|
208 | 208 |
//long numReg = elRs.getRowCount(); |
209 | 209 |
if (idField == -1) { |
... | ... | |
294 | 294 |
boolean bRestoValores = false; // PONERLO EN UN CHECKBOX |
295 | 295 |
int hasta; |
296 | 296 |
String fieldName = (String) cmbFields.getSelectedItem(); |
297 |
theLegend.setClassifyingFieldNames(new String[] {fieldName} );
|
|
298 |
/////////////////////////////////////////PEPE |
|
297 |
auxLegend.setClassifyingFieldNames(new String[] {fieldName} );
|
|
298 |
|
|
299 | 299 |
FLyrVect m = (FLyrVect) layer; |
300 | 300 |
try { |
301 | 301 |
int fieldType = m.getSource().getRecordset().getFieldType((int)cmbFields.getSelectedIndex()); |
302 |
theLegend.setClassifyingFieldTypes(new int[] {fieldType});
|
|
302 |
auxLegend.setClassifyingFieldTypes(new int[] {fieldType});
|
|
303 | 303 |
} catch (ReadDriverException e) { |
304 | 304 |
NotificationManager.addError(PluginServices.getText(this, "could_not_setup_legend"), e); |
305 | 305 |
} |
306 |
/////////////////////////////////////////PEPE |
|
306 |
|
|
307 | 307 |
if (bRestoValores) { |
308 | 308 |
hasta = symbolTable.getRowCount() - 1; |
309 | 309 |
} else { |
310 | 310 |
hasta = symbolTable.getRowCount(); |
311 | 311 |
} |
312 | 312 |
|
313 |
auxLegend.clear(); |
|
314 |
|
|
313 | 315 |
for (int row = 0; row < symbolTable.getRowCount(); row++) { |
314 | 316 |
clave = (Value) symbolTable.getFieldValue(row, 1); |
315 | 317 |
theSymbol = (ISymbol) symbolTable.getFieldValue(row, 0); |
316 | 318 |
theSymbol.setDescription((String) symbolTable.getFieldValue(row, 2)); |
317 |
theLegend.addSymbol(clave, theSymbol);
|
|
319 |
auxLegend.addSymbol(clave, theSymbol);
|
|
318 | 320 |
} |
319 | 321 |
|
320 | 322 |
if (bRestoValores) { |
321 | 323 |
theSymbol = (ISymbol) symbolTable.getFieldValue(hasta, 0); |
322 |
theLegend.setDefaultSymbol(theSymbol);
|
|
324 |
auxLegend.setDefaultSymbol(theSymbol);
|
|
323 | 325 |
} |
324 | 326 |
} |
325 | 327 |
|
... | ... | |
370 | 372 |
symbolTable.removeAllItems(); |
371 | 373 |
|
372 | 374 |
if (VectorialUniqueValueLegend.class.equals(legend.getClass())) { |
373 |
theLegend = (VectorialUniqueValueLegend) legend;
|
|
374 |
getChbUseDefault().setSelected(theLegend.isUseDefaultSymbol());
|
|
375 |
cmbFields.getModel().setSelectedItem(theLegend.getClassifyingFieldNames()[0]);
|
|
376 |
symbolTable.fillTableFromSymbolList(theLegend.getSymbols(),
|
|
377 |
theLegend.getValues(),
|
|
378 |
theLegend.getDescriptions());
|
|
379 |
zSort = theLegend.getZSort();
|
|
375 |
auxLegend = (VectorialUniqueValueLegend) legend;
|
|
376 |
getChbUseDefault().setSelected(auxLegend.isUseDefaultSymbol());
|
|
377 |
cmbFields.getModel().setSelectedItem(auxLegend.getClassifyingFieldNames()[0]);
|
|
378 |
symbolTable.fillTableFromSymbolList(auxLegend.getSymbols(),
|
|
379 |
auxLegend.getValues(),
|
|
380 |
auxLegend.getDescriptions());
|
|
381 |
zSort = auxLegend.getZSort();
|
|
380 | 382 |
} else { |
381 |
theLegend = new VectorialUniqueValueLegend(shapeType);
|
|
383 |
auxLegend = new VectorialUniqueValueLegend(shapeType);
|
|
382 | 384 |
} |
383 | 385 |
} |
384 | 386 |
|
... | ... | |
403 | 405 |
private JCheckBox getChbUseDefault() { |
404 | 406 |
if (chbUseDefault == null) { |
405 | 407 |
chbUseDefault = new JCheckBox(); |
406 |
chbUseDefault.setSelected(true);
|
|
408 |
chbUseDefault.setSelected(false);
|
|
407 | 409 |
chbUseDefault.addActionListener(new java.awt.event.ActionListener() { |
408 | 410 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
409 |
if (auxLegend==null)auxLegend=theLegend; |
|
411 |
// if (auxLegend==null)auxLegend=theLegend;
|
|
410 | 412 |
if (chbUseDefault.isSelected()) { |
411 | 413 |
addDefault(); |
412 | 414 |
} else { |
... | ... | |
449 | 451 |
String fieldName = (String) cb.getSelectedItem(); |
450 | 452 |
symbolTable.removeAllItems(); |
451 | 453 |
|
452 |
// if (theLegend.getClassifyingFieldNames()!=null && fieldName != theLegend.getClassifyingFieldNames()[0]) { |
|
453 |
// //m_bCacheDirty = true; |
|
454 |
// theLegend.setClassifyingFieldNames(new String[] {fieldName}); |
|
455 |
// } |
|
456 |
// |
|
457 |
// //////////////////////////////////////////PEPE |
|
458 |
// FLyrVect m = (FLyrVect) layer; |
|
459 |
// try { |
|
460 |
// int fieldType = m.getSource().getRecordset().getFieldType((int)cb.getSelectedIndex()); |
|
461 |
// if (theLegend.getClassifyingFieldTypes()!=null && fieldType != theLegend.getClassifyingFieldTypes()[0]) { |
|
462 |
// //m_bCacheDirty = true; |
|
463 |
// theLegend.setClassifyingFieldTypes(new int[] {fieldType}); |
|
464 |
// } |
|
465 |
// } catch (ReadDriverException e1) { |
|
466 |
// NotificationManager.addError(PluginServices.getText(this, "could_not_setup_legend"), e1); |
|
467 |
// } |
|
468 |
// /////////////////////////////////////////PEPE |
|
469 | 454 |
} |
470 | 455 |
|
471 | 456 |
// add all elements by value |
... | ... | |
487 | 472 |
//Vacia la tabla |
488 | 473 |
if (e.getActionCommand() == "REMOVE_ALL") { |
489 | 474 |
symbolTable.removeAllItems(); |
490 |
theLegend.setZSort(null);
|
|
475 |
auxLegend.setZSort(null);
|
|
491 | 476 |
zSort = null; |
492 | 477 |
} |
493 | 478 |
|
... | ... | |
498 | 483 |
|
499 | 484 |
if (e.getActionCommand() == "OPEN_SYMBOL_LEVEL_EDITOR") { |
500 | 485 |
|
501 |
if (theLegend != null) {
|
|
486 |
if (auxLegend != null) {
|
|
502 | 487 |
ZSort myZSort = ((AbstractClassifiedVectorLegend) getLegend()).getZSort(); |
503 |
if (myZSort == null) { |
|
488 |
if (myZSort == null && theLegend != null) {
|
|
504 | 489 |
myZSort = new ZSort(theLegend); |
505 | 490 |
} |
506 | 491 |
SymbolLevelsWindow sl = new SymbolLevelsWindow(myZSort); |
507 | 492 |
PluginServices.getMDIManager().addWindow(sl); |
508 | 493 |
zSort = sl.getZSort(); |
509 |
if (auxLegend != null) |
|
510 |
auxLegend.setZSort(zSort); |
|
494 |
auxLegend.setZSort(zSort); |
|
511 | 495 |
} |
512 | 496 |
|
513 | 497 |
} |
Also available in: Unified diff