< prev index next >

src/java.desktop/share/classes/sun/print/RasterPrinterJob.java

Print this page

        

*** 28,47 **** import java.io.FilePermission; import java.awt.Color; import java.awt.Dialog; import java.awt.Frame; - import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; import java.awt.KeyboardFocusManager; import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.AffineTransform; - import java.awt.geom.Area; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.awt.print.Book; import java.awt.print.Pageable; --- 28,45 ----
*** 53,63 **** import java.awt.print.PrinterJob; import java.awt.Window; import java.io.File; import java.io.IOException; import java.util.ArrayList; - import java.util.Enumeration; import java.util.Locale; import sun.awt.image.ByteInterleavedRaster; import javax.print.Doc; import javax.print.DocFlavor; --- 51,60 ----
*** 72,82 **** import javax.print.attribute.AttributeSet; import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.ResolutionSyntax; import javax.print.attribute.Size2DSyntax; - import javax.print.attribute.standard.Chromaticity; import javax.print.attribute.standard.Copies; import javax.print.attribute.standard.Destination; import javax.print.attribute.standard.DialogTypeSelection; import javax.print.attribute.standard.Fidelity; import javax.print.attribute.standard.JobName; --- 69,78 ----
*** 834,846 **** // we position the dialog a little beyond the upper-left corner of the window // which is consistent with the NATIVE page dialog Rectangle gcBounds = gc.getBounds(); int x = gcBounds.x+50; int y = gcBounds.y+50; ! ServiceDialog pageDialog = new ServiceDialog(gc, x, y, service, DocFlavor.SERVICE_FORMATTED.PAGEABLE, ! attributes, (Frame)null); Rectangle dlgBounds = pageDialog.getBounds(); // if portion of dialog is not within the gc boundary if (!gcBounds.contains(dlgBounds)) { // check if dialog exceed window bounds at left or bottom --- 830,849 ---- // we position the dialog a little beyond the upper-left corner of the window // which is consistent with the NATIVE page dialog Rectangle gcBounds = gc.getBounds(); int x = gcBounds.x+50; int y = gcBounds.y+50; ! ServiceDialog pageDialog; ! if (w instanceof Frame) { ! pageDialog = new ServiceDialog(gc, x, y, service, DocFlavor.SERVICE_FORMATTED.PAGEABLE, ! attributes, (Frame)w); ! } else { ! pageDialog = new ServiceDialog(gc, x, y, service, ! DocFlavor.SERVICE_FORMATTED.PAGEABLE, ! attributes, (Dialog)w); ! } Rectangle dlgBounds = pageDialog.getBounds(); // if portion of dialog is not within the gc boundary if (!gcBounds.contains(dlgBounds)) { // check if dialog exceed window bounds at left or bottom
*** 942,951 **** --- 945,965 ---- */ GraphicsConfiguration grCfg = null; Window w = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); if (w != null) { grCfg = w.getGraphicsConfiguration(); + /* Add DialogOwner attribute to set the owner of this print dialog + * only if it is not set already + * (it might be set in java.awt.PrintJob.printDialog) + */ + if (attributes.get(DialogOwner.class) == null) { + if (w instanceof Frame) { + attributes.add(new DialogOwner((Frame)w)); + } else if (w instanceof Dialog) { + attributes.add(new DialogOwner((Dialog)w)); + } + } } else { grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getDefaultConfiguration(); } final GraphicsConfiguration gc = grCfg;
< prev index next >