Revision 23303 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java

View differences:

AttrInTableLabelingStrategy.java
12 12
import javax.print.attribute.PrintRequestAttributeSet;
13 13
import javax.print.attribute.standard.PrintQuality;
14 14

  
15
import org.gvsig.tools.exception.BaseException;
16 15
import org.gvsig.fmap.data.ReadException;
17 16
import org.gvsig.fmap.data.feature.Feature;
18 17
import org.gvsig.fmap.data.feature.FeatureCollection;
......
34 33
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport;
35 34
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupportToolkit;
36 35
import org.gvsig.fmap.mapcontext.rendering.symbols.SimpleTextSymbol;
36
import org.gvsig.tools.exception.BaseException;
37 37

  
38
import com.iver.utiles.StringUtilities;
38 39
import com.iver.utiles.XMLEntity;
39 40
import com.iver.utiles.swing.threads.Cancellable;
40 41

  
......
258 259
		} catch (ReadException e) {
259 260
			Logger.getAnonymousLogger().log(Level.SEVERE, "Acessing RotationField field.\n"+e.getMessage());
260 261
		}
261
		xml.putProperty("Font", getFont());
262
		if (getFont() != null) {
263
			xml.putProperty("fontName", getFont().getFontName());
264
			xml.putProperty("fontStyle", getFont().getStyle());
265
			xml.putProperty("fontSize", getFont().getFontName());
266
		}
262 267

  
263
		xml.putProperty("Color", getColorFont());
268
		if (getColorFont() != null) {
269
			xml.putProperty("color", StringUtilities
270
					.color2String(getColorFont()));
271
		}
264 272
		xml.putProperty("Unit", unit);
273

  
265 274
		return xml;
266 275

  
267 276
	}
......
331 340
		if (xml.contains("UnitFactor")) {
332 341
			setUnit(xml.getIntProperty("Unit"));
333 342
		}
334
		if (xml.contains("Font"))
335
			setUnit(xml.getIntProperty("Font"));
343
		if (xml.contains("fontName")) {
344
			Font newFont = new Font(xml.getStringProperty("fontName"), xml
345
					.getIntProperty("fontStyle"), xml
346
					.getIntProperty("fontSize"));
347
			setFont(newFont);
348
		}
336 349

  
337
		if (xml.contains("Color"))
338
			setUnit(xml.getIntProperty("Color"));
350
		if (xml.contains("color")) {
351
			Color newColor = StringUtilities.string2Color(xml
352
					.getStringProperty("color"));
353
			setColorFont(newColor);
354
		}
339 355
	}
340 356

  
341 357
	public void setTextField(String textFieldName) {

Also available in: Unified diff