Revision 28368 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/fframes/FFrameScaleBar.java
FFrameScaleBar.java | ||
---|---|---|
57 | 57 |
import java.text.NumberFormat; |
58 | 58 |
|
59 | 59 |
import javax.print.attribute.PrintRequestAttributeSet; |
60 |
import javax.print.attribute.standard.PrintQuality; |
|
60 | 61 |
|
61 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
62 | 62 |
import com.iver.andami.PluginServices; |
63 | 63 |
import com.iver.cit.gvsig.fmap.MapContext; |
64 | 64 |
import com.iver.cit.gvsig.fmap.core.FShape; |
... | ... | |
112 | 112 |
private boolean aboveDescription = false; |
113 | 113 |
private int dependenceIndex = -1; |
114 | 114 |
private int numDec = 0; |
115 |
private PrintRequestAttributeSet properties; |
|
115 | 116 |
public static NumberFormat numberFormat = NumberFormat.getInstance(); |
116 | 117 |
|
117 | 118 |
/** |
... | ... | |
367 | 368 |
* @param imgBase Image para acelerar el dibujado. |
368 | 369 |
*/ |
369 | 370 |
public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv, |
370 |
BufferedImage imgBase) throws ReadDriverException {
|
|
371 |
BufferedImage imgBase) { |
|
371 | 372 |
Rectangle2D.Double r = getBoundingBox(at); |
372 | 373 |
g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2), |
373 | 374 |
r.y + (r.height / 2)); |
... | ... | |
384 | 385 |
if (scalex > (r.getHeight() / (8))) { |
385 | 386 |
scalex = r.getHeight() / (2); |
386 | 387 |
} |
387 |
|
|
388 |
if (properties!=null){ |
|
389 |
PrintQuality pq = (PrintQuality) properties.get(PrintQuality.class); |
|
390 |
if (pq.equals(PrintQuality.NORMAL)){ |
|
391 |
scalex *= (double) 300/72; |
|
392 |
}else if (pq.equals(PrintQuality.HIGH)){ |
|
393 |
scalex *= (double) 600/72; |
|
394 |
}else if (pq.equals(PrintQuality.DRAFT)){ |
|
395 |
// unitFactor *= 72; (which is the same than doing nothing) |
|
396 |
} |
|
397 |
} |
|
388 | 398 |
g.setColor(textcolor); |
389 | 399 |
|
390 | 400 |
if (m_f != null) { |
... | ... | |
1272 | 1282 |
* @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#print(java.awt.Graphics2D, |
1273 | 1283 |
* java.awt.geom.AffineTransform) |
1274 | 1284 |
*/ |
1275 |
public void print(Graphics2D g, AffineTransform at, FShape shape, PrintRequestAttributeSet properties) |
|
1276 |
throws ReadDriverException {
|
|
1285 |
public void print(Graphics2D g, AffineTransform at, FShape shape, PrintRequestAttributeSet properties) {
|
|
1286 |
this.properties=properties;
|
|
1277 | 1287 |
draw(g, at, null, null); |
1288 |
this.properties=null; |
|
1289 |
|
|
1278 | 1290 |
} |
1279 | 1291 |
|
1280 | 1292 |
/** |
Also available in: Unified diff