Revision 16237 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/SymbologyFactory.java

View differences:

SymbologyFactory.java
149 149
 * @author jaume dominguez faus - jaume.dominguez@iver.es
150 150
 */
151 151
public class SymbologyFactory {
152
	public static int DefaultSymbolUnit = -1; // pixel
153
	public static int DefaultSymbolReferenceSystem = CartographicSupport.WORLD;
152 154
	public static Color DefaultSymbolColor = Color.DARK_GRAY;
153 155
	public static Color DefaultFillSymbolColor = new Color(60, 235, 235);
154 156
	public static Font DefaultTextFont = new Font("SansSerif", Font.PLAIN, 9);
......
266 268
	 * @return IMultiLayerSymbol
267 269
	 */
268 270
	public static IMultiLayerSymbol createEmptyMultiLayerSymbol(int shapeType) {
271
		IMultiLayerSymbol sym = null;
269 272
		switch (shapeType) {
270 273
		case FShape.POINT:
271
			return new MultiLayerMarkerSymbol();
274
			sym = new MultiLayerMarkerSymbol();
275
			break;
272 276
		case FShape.LINE:
273
			return new MultiLayerLineSymbol();
277
			sym = new MultiLayerLineSymbol();
278
			break;
274 279
		case FShape.POLYGON:
275
			return new MultiLayerFillSymbol();
280
			sym = new MultiLayerFillSymbol();
281
			break;
276 282
		default:
277 283
			throw new Error("Shape type not yet supported for multilayer symbols");
278 284
		}
285
		
286
		if (sym instanceof CartographicSupport) {
287
			CartographicSupport csSym = (CartographicSupport) sym;
288
			csSym.setUnit(DefaultSymbolUnit);
289
			csSym.setReferenceSystem(DefaultSymbolReferenceSystem);
290
		}
291
		
292
		return sym;
279 293
	}
280 294

  
281 295
	/**
......
286 300
		SimpleMarkerSymbol sms = new SimpleMarkerSymbol();
287 301
		sms.setColor(DefaultSymbolColor);
288 302
		sms.setSize(4);
289
		sms.setUnit(-1); // pixels
303
		sms.setUnit(DefaultSymbolUnit);
304
		sms.setReferenceSystem(DefaultSymbolReferenceSystem);
290 305
		return sms;
291 306
	}
292 307

  
293 308
	/**
294
	 * Returns a new instance of an <b>ILineSymbol</b>. A black line.
309
	 * Returns a new instance of an <b>ILineSymbol</b>.
295 310
	 * @return ILineSymbol, the default symbol for lines.
296 311
	 */
297 312
	public static ILineSymbol createDefaultLineSymbol() {
298 313
		SimpleLineSymbol sls = new SimpleLineSymbol();
299 314
		sls.setLineColor(DefaultSymbolColor);
300 315
		sls.setLineWidth(1);
301
		sls.setUnit(-1); // Pixels
316
		sls.setUnit(DefaultSymbolUnit);
317
		sls.setReferenceSystem(DefaultSymbolReferenceSystem);
302 318
		return sls;
303 319
	}
304 320

  

Also available in: Unified diff