Revision 29272 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/FLayers.java
FLayers.java | ||
---|---|---|
51 | 51 |
import java.util.TreeSet; |
52 | 52 |
import java.util.Vector; |
53 | 53 |
|
54 |
import javax.print.attribute.PrintRequestAttributeSet; |
|
55 |
import javax.print.attribute.standard.PrintQuality; |
|
56 | 54 |
import javax.swing.ImageIcon; |
57 | 55 |
|
58 | 56 |
import org.cresques.cts.ICoordTrans; |
59 | 57 |
import org.cresques.cts.IProjection; |
58 |
import org.gvsig.compat.print.PrintAttributes; |
|
60 | 59 |
import org.gvsig.fmap.dal.exception.DataException; |
61 | 60 |
import org.gvsig.fmap.dal.exception.ReadException; |
62 | 61 |
import org.gvsig.fmap.geom.primitive.Envelope; |
... | ... | |
448 | 447 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, |
449 | 448 |
* com.iver.cit.gvsig.fmap.ViewPort, |
450 | 449 |
* com.iver.utiles.swing.threads.Cancellable, double, |
451 |
* javax.print.attribute.PrintRequestAttributeSet)
|
|
450 |
* javax.print.attribute.PrintAttributes)
|
|
452 | 451 |
*/ |
453 | 452 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
454 |
double scale, PrintRequestAttributeSet properties)
|
|
453 |
double scale, PrintAttributes properties)
|
|
455 | 454 |
throws ReadException { |
456 | 455 |
throw new RuntimeException("No deberia pasar por aqui"); |
457 | 456 |
} |
458 | 457 |
|
459 | 458 |
public void print_old(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
460 |
double scale, PrintRequestAttributeSet properties)
|
|
459 |
double scale, PrintAttributes properties)
|
|
461 | 460 |
throws ReadException { |
462 | 461 |
this.print_old(g, viewPort, cancel, scale, properties, null); |
463 | 462 |
} |
... | ... | |
489 | 488 |
* |
490 | 489 |
* @return <code>null</code> if the layers in <code>group</code> had been drawn or were <code>null</code>; otherwise, the <code>group</code> |
491 | 490 |
* |
492 |
* @see FLayer#print(Graphics2D, ViewPort, Cancellable, double, PrintRequestAttributeSet)
|
|
491 |
* @see FLayer#print(Graphics2D, ViewPort, Cancellable, double, PrintAttributes)
|
|
493 | 492 |
* |
494 | 493 |
* @throws ReadDriverException if fails the driver reading the data. |
495 | 494 |
*/ |
496 |
public ComposedLayer print_old(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties, ComposedLayer group)
|
|
495 |
public ComposedLayer print_old(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintAttributes properties, ComposedLayer group)
|
|
497 | 496 |
throws ReadException { |
498 | 497 |
double dpi = 72; |
499 | 498 |
|
500 |
PrintQuality resolution=(PrintQuality)properties.get(PrintQuality.class);
|
|
501 |
if (resolution.equals(PrintQuality.NORMAL)){
|
|
499 |
int resolution = properties.getPrintQuality();
|
|
500 |
if (resolution == PrintAttributes.PRINT_QUALITY_NORMAL) {
|
|
502 | 501 |
dpi = 300; |
503 |
} else if (resolution.equals(PrintQuality.HIGH)){
|
|
502 |
} else if (resolution == PrintAttributes.PRINT_QUALITY_HIGH){
|
|
504 | 503 |
dpi = 600; |
505 |
} else if (resolution.equals(PrintQuality.DRAFT)){
|
|
504 |
} else if (resolution == PrintAttributes.PRINT_QUALITY_DRAFT){
|
|
506 | 505 |
dpi = 72; |
507 | 506 |
} |
508 | 507 |
|
Also available in: Unified diff