Revision 23125

View differences:

trunk/extensions/extSymbology/src/org/gvsig/symbology/fmap/styles/SimpleLabelStyle.java
111 111

  
112 112
import org.apache.log4j.Logger;
113 113

  
114
import com.iver.andami.PluginServices;
114 115
import com.iver.cit.gvsig.fmap.Messages;
115 116
import com.iver.cit.gvsig.fmap.core.FPolygon2D;
116 117
import com.iver.cit.gvsig.fmap.core.FShape;
......
136 137
	// en el pintat
137 138
	private ArrayList<Rectangle2D> textFieldAreas = new ArrayList<Rectangle2D>();
138 139
	private BackgroundFileStyle background;
140
	private Dimension defaultSize = new Dimension(32,32);
139 141
	private Dimension sz;
140 142

  
141 143

  
......
186 188
		xml.putProperty("minYArray", miny);
187 189
		xml.putProperty("widthArray", widths);
188 190
		xml.putProperty("heightArray", heights);
189
		if(background != null){
190
			XMLEntity bgXML = background.getXMLEntity();
191
		if(getBackground() != null){
192
			XMLEntity bgXML = getBackground().getXMLEntity();
191 193
			bgXML.putProperty("id", "LabelStyle");
192 194
			xml.addChild(bgXML);
193 195
		}
......
223 225
	}
224 226

  
225 227
	public void drawInsideRectangle(Graphics2D g, Rectangle r) throws SymbolDrawingException {
226
		if(background != null)
227
			background.drawInsideRectangle(g, r);
228
		if(getBackground() != null)
229
			getBackground().drawInsideRectangle(g, r);
228 230
	}
229 231

  
230 232

  
231 233
	public Dimension getSize() {
232
		if (sz == null) {
233
			Rectangle bgBounds = background.getBounds();
234
		if (sz == null && getBackground() != null) {
235
			Rectangle bgBounds = getBackground().getBounds();
234 236
			setSize(bgBounds.getWidth(), bgBounds.getHeight());
235 237
		}
238
		else sz = defaultSize;
236 239
		return sz;
237 240
	}
238 241

  
......
251 254

  
252 255

  
253 256
	public void drawOutline(Graphics2D g, Rectangle r) throws SymbolDrawingException {
254
		if(background != null)
255
			background.drawOutline(g, r);
257
		if(getBackground() != null)
258
			getBackground().drawOutline(g, r);
256 259

  
257 260

  
258 261
		final double[] xy = new double[2];

Also available in: Unified diff