Revision 41020

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/legend/gui/VectorialInterval.java
65 65
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
66 66
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
67 67
import org.gvsig.gui.beans.swing.JButton;
68
import org.gvsig.symbology.SymbologyLocator;
68 69
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.FInterval;
69 70
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialIntervalLegend;
71
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.IMultiShapeSymbol;
72
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
73

  
70 74
import org.slf4j.Logger;
71 75
import org.slf4j.LoggerFactory;
72 76

  
......
425 429
            auxLegend.setStartColor(startColor);
426 430
            auxLegend.setEndColor(endColor);
427 431

  
428
            int symbolType = layer.getShapeType();
432
            int geomType = layer.getGeometryType().getType();
429 433
            int numSymbols = 0;
430 434

  
431 435
            for (int k = 0; k < arrayIntervalos.length; k++) {
432 436
                interval = arrayIntervalos[k];
433 437

  
434
				ISymbol theSymbol =
435
						mapContextManager.getSymbolManager().createSymbol(
436
                		symbolType,
437
                		new Color(r, g, b));
438
				ISymbol theSymbol = null;
439
				Color col = new Color(r, g, b);
440
				
441
                theSymbol = mapContextManager.getSymbolManager().createSymbol(
442
                    geomType, col);
443
                
444
                /*
445
                 * If multishape, we need to set line and fill color here.
446
                 * This is because the symbol manager is in mapcontext.api, which cannot
447
                 * depend on symbology.lib.api
448
                 */
449
                if (theSymbol instanceof IMultiShapeSymbol) {
450
                    IMultiShapeSymbol mss = (IMultiShapeSymbol) theSymbol; 
451
                    mss.getLineSymbol().setLineColor(col);
452
                    mss.getFillSymbol().setFillColor(col);
453
                }
454

  
455
				
438 456
                theSymbol.setDescription(NumberFormat.getInstance().format(interval.getMin()) +
439 457
                    " - " +
440 458
                    NumberFormat.getInstance().format(interval.getMax()));

Also available in: Unified diff