Revision 30011 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/legend/gui/VectorialUniqueValue.java

View differences:

VectorialUniqueValue.java
59 59
import javax.swing.JOptionPane;
60 60
import javax.swing.JPanel;
61 61

  
62
import org.slf4j.Logger;
63
import org.slf4j.LoggerFactory;
64

  
65 62
import org.gvsig.andami.PluginServices;
66 63
import org.gvsig.andami.messages.NotificationManager;
67 64
import org.gvsig.app.gui.styling.JComboBoxColorScheme;
68 65
import org.gvsig.app.gui.styling.SymbolLevelsWindow;
69
import org.gvsig.app.project.documents.view.toc.actions.ChangeSymbolTocMenuEntry;
70 66
import org.gvsig.fmap.dal.exception.DataException;
71 67
import org.gvsig.fmap.dal.exception.ReadException;
72 68
import org.gvsig.fmap.dal.feature.DisposableIterator;
......
74 70
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
75 71
import org.gvsig.fmap.dal.feature.FeatureSet;
76 72
import org.gvsig.fmap.dal.feature.FeatureStore;
73
import org.gvsig.fmap.mapcontext.MapContextLocator;
74
import org.gvsig.fmap.mapcontext.MapContextManager;
77 75
import org.gvsig.fmap.mapcontext.layers.FLayer;
78 76
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial;
79 77
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
80
import org.gvsig.fmap.mapcontext.rendering.legend.AbstractClassifiedVectorLegend;
81 78
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
82
import org.gvsig.fmap.mapcontext.rendering.legend.LegendFactory;
83
import org.gvsig.fmap.mapcontext.rendering.legend.NullUniqueValue;
84
import org.gvsig.fmap.mapcontext.rendering.legend.NullValue;
85
import org.gvsig.fmap.mapcontext.rendering.legend.VectorialUniqueValueLegend;
86
import org.gvsig.fmap.mapcontext.rendering.legend.ZSort;
87 79
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
88
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbologyFactory;
89 80
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
90 81
import org.gvsig.gui.beans.swing.JBlank;
91 82
import org.gvsig.gui.beans.swing.JButton;
92 83
import org.gvsig.raster.datastruct.ColorItem;
84
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.IVectorialUniqueValueLegend;
85
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.ZSort;
86
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractClassifiedVectorLegend;
87
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialUniqueValueLegend;
93 88
import org.gvsig.utils.XMLException;
89
import org.slf4j.Logger;
90
import org.slf4j.LoggerFactory;
94 91

  
95 92

  
96 93

  
......
119 116

  
120 117
	private JComboBoxColorScheme cmbColorScheme;
121 118
	private GridBagLayoutPanel defaultSymbolPanel = new GridBagLayoutPanel();
119
		
120
	private MapContextManager mapContextManager = MapContextLocator
121
			.getMapContextManager();
122

  
122 123
    /**
123 124
     *
124 125
     */
......
238 239
            ISymbol theSymbol = null;
239 240

  
240 241
            //auxLegend=(VectorialUniqueValueLegend)m_lyr.getLegend();
241
            auxLegend = LegendFactory.createVectorialUniqueValueLegend(layer.getShapeType());
242 242

  
243
            //            auxLegend = LegendFactory.createVectorialUniqueValueLegend(layer.getShapeType());
244
            auxLegend = (VectorialUniqueValueLegend) MapContextLocator
245
					.getMapContextManager().createLegend(
246
							IVectorialUniqueValueLegend.LEGEND_NAME);
247
            auxLegend.setShapeType(layer.getShapeType());
248

  
243 249
            Object clave=null;
244 250

  
245 251
            //Object resul;
......
275 281
					// for (int j = 0; j < elRs.getRowCount(); j++) {
276 282
					// clave = elRs.getFieldValue(j, idField);
277 283

  
278
					if (clave instanceof NullValue) {
284
//					if (clave instanceof NullValue) {
285
//						continue;
286
//					}
287
					if (clave == null) {
279 288
						continue;
280 289
					}
281 290

  
......
302 311
						// si no esta creado el simbolo se crea
303 312
						// jaume (moved to ISymbol); theSymbol = new
304 313
						// FSymbol(layer.getShapeType());
305
						theSymbol = SymbologyFactory
306
								.createDefaultSymbolByShapeType(layer
314
						theSymbol = mapContextManager.createSymbol(layer
307 315
										.getShapeType(), colorScheme[rand
308 316
										.nextInt(colorScheme.length)]
309 317
										.getColor());
......
689 697
    	// add only one value
690 698
    	if (e.getActionCommand() == "ADD_VALUE") {
691 699
    		try {
692
				ISymbol symbol = SymbologyFactory.createDefaultSymbolByShapeType(layer.getShapeType());
700
				ISymbol symbol = mapContextManager.createSymbol(layer.getShapeType());
693 701
				Double clave = new Double(0.0);
694 702
				symbolTable.addTableRecord(symbol,
695 703
						clave,"0 - 0");

Also available in: Unified diff