Revision 9194

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FSymbol.java
64 64
import java.util.StringTokenizer;
65 65

  
66 66
import javax.print.attribute.PrintRequestAttributeSet;
67
import javax.print.attribute.standard.PrinterResolution;
67
import javax.print.attribute.standard.PrintQuality;
68 68
import javax.swing.ImageIcon;
69 69

  
70 70
import com.iver.cit.gvsig.fmap.core.FShape;
......
132 132
	public Color m_BackColor;
133 133
	public Paint m_BackFill;
134 134
	private PrintRequestAttributeSet properties;
135
	private int resolutionPrinting=300;
135 136

  
136 137
    /**
137 138
     * Converts the comma-delimited string into a List of trimmed strings.
......
1237 1238
		if (properties==null)
1238 1239
			FGraphicUtilities.DrawShape(g, affineTransform, shp, this);
1239 1240
		else {
1240
			PrinterResolution resolution=(PrinterResolution)properties.get(PrinterResolution.class);
1241
			int DPI=resolution.getFeedResolution(PrinterResolution.DPI);
1242 1241
			int strokeValue=0;
1243 1242
				BasicStroke stroke=(BasicStroke)this.getStroke();
1244
				if (stroke != null) {
1243
				if (stroke != null || stroke.getLineWidth()!=0) {
1245 1244
					strokeValue=(int)stroke.getLineWidth();
1246
					double d=strokeValue*DPI/72;
1245
					double d=strokeValue*resolutionPrinting/72;
1247 1246
					this.setStroke(new BasicStroke((int)d,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
1248 1247
				}
1249 1248
			FGraphicUtilities.DrawShape(g, affineTransform, shp, this);
1250 1249
			this.setStroke(new BasicStroke(strokeValue));
1250

  
1251 1251
		}
1252 1252
	}
1253 1253

  
......
1280 1280

  
1281 1281
	public void setPrintingProperties(PrintRequestAttributeSet properties) {
1282 1282
		this.properties=properties;
1283

  
1283
		if (properties!=null){
1284
		PrintQuality resolution=(PrintQuality)properties.get(PrintQuality.class);
1285
			if (resolution.equals(PrintQuality.NORMAL)){
1286
				resolutionPrinting=300;
1287
			}else if (resolution.equals(PrintQuality.HIGH)){
1288
				resolutionPrinting=600;
1289
			}else if (resolution.equals(PrintQuality.DRAFT)){
1290
				resolutionPrinting=72;
1291
			}
1292
		}
1284 1293
	}
1285 1294

  
1286 1295
}

Also available in: Unified diff