< prev index next >
src/java.desktop/share/classes/sun/print/RasterPrinterJob.java
Print this page
*** 72,81 ****
--- 72,82 ----
import javax.print.attribute.ResolutionSyntax;
import javax.print.attribute.Size2DSyntax;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.Destination;
import javax.print.attribute.standard.DialogTypeSelection;
+ import javax.print.attribute.standard.DialogOwner;
import javax.print.attribute.standard.Fidelity;
import javax.print.attribute.standard.JobName;
import javax.print.attribute.standard.JobSheets;
import javax.print.attribute.standard.Media;
import javax.print.attribute.standard.MediaPrintableArea;
*** 828,849 ****
--- 829,863 ----
// which is consistent with the NATIVE page dialog
Rectangle gcBounds = gc.getBounds();
int x = gcBounds.x+50;
int y = gcBounds.y+50;
ServiceDialog pageDialog;
+ boolean setOnTop = false;
if (onTop != null) {
attributes.add(onTop);
+ Window owner = onTop.getOwner();
+ if (owner != null) {
+ w = owner; // use the one specifed by the app
+ } else if (DialogOwnerAccessor.getID(onTop) == 0) {
+ setOnTop = true;
+ }
}
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);
}
+ if (setOnTop) {
+ try {
+ pageDialog.setAlwaysOnTop(true);
+ } catch (SecurityException e) {
+ }
+ }
Rectangle dlgBounds = pageDialog.getBounds();
// if portion of dialog is not within the gc boundary
if (!gcBounds.contains(dlgBounds)) {
*** 986,997 ****
/* 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) {
! attributes.add(w instanceof Frame ? new DialogOwner((Frame)w) :
! new DialogOwner((Dialog)w));
}
} else {
grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration();
}
--- 1000,1010 ----
/* 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) {
! attributes.add(new DialogOwner(w));
}
} else {
grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration();
}
*** 2579,2589 ****
} else {
return new String(out_chars, 0, pos);
}
}
! private DialogOnTop onTop = null;
private long parentWindowID = 0L;
/* Called from native code */
private long getParentWindowID() {
--- 2592,2602 ----
} else {
return new String(out_chars, 0, pos);
}
}
! private DialogOwner onTop = null;
private long parentWindowID = 0L;
/* Called from native code */
private long getParentWindowID() {
*** 2595,2605 ****
onTop = null;
}
private void setParentWindowID(PrintRequestAttributeSet attrs) {
parentWindowID = 0L;
! onTop = (DialogOnTop)attrs.get(DialogOnTop.class);
if (onTop != null) {
! parentWindowID = onTop.getID();
}
}
}
--- 2608,2618 ----
onTop = null;
}
private void setParentWindowID(PrintRequestAttributeSet attrs) {
parentWindowID = 0L;
! onTop = (DialogOwner)attrs.get(DialogOwner.class);
if (onTop != null) {
! parentWindowID = DialogOwnerAccessor.getID(onTop);
}
}
}
< prev index next >