mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8204496: backout fix for 8203796 which was pushed under another ID
Reviewed-by: serb
This commit is contained in:
parent
24dd5debd4
commit
f6245c499f
12 changed files with 211 additions and 599 deletions
|
@ -74,7 +74,6 @@ 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;
|
||||
|
@ -831,24 +830,17 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
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, w);
|
||||
if (setOnTop) {
|
||||
try {
|
||||
pageDialog.setAlwaysOnTop(true);
|
||||
} catch (SecurityException e) {
|
||||
}
|
||||
attributes,(Frame)w);
|
||||
} else {
|
||||
pageDialog = new ServiceDialog(gc, x, y, service,
|
||||
DocFlavor.SERVICE_FORMATTED.PAGEABLE,
|
||||
attributes, (Dialog)w);
|
||||
}
|
||||
|
||||
Rectangle dlgBounds = pageDialog.getBounds();
|
||||
|
@ -996,7 +988,8 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
* (it might be set in java.awt.PrintJob.printDialog)
|
||||
*/
|
||||
if (attributes.get(DialogOwner.class) == null) {
|
||||
attributes.add(new DialogOwner(w));
|
||||
attributes.add(w instanceof Frame ? new DialogOwner((Frame)w) :
|
||||
new DialogOwner((Dialog)w));
|
||||
}
|
||||
} else {
|
||||
grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment().
|
||||
|
@ -2588,7 +2581,7 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
}
|
||||
}
|
||||
|
||||
private DialogOwner onTop = null;
|
||||
private DialogOnTop onTop = null;
|
||||
|
||||
private long parentWindowID = 0L;
|
||||
|
||||
|
@ -2604,9 +2597,9 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
|
||||
private void setParentWindowID(PrintRequestAttributeSet attrs) {
|
||||
parentWindowID = 0L;
|
||||
onTop = (DialogOwner)attrs.get(DialogOwner.class);
|
||||
onTop = (DialogOnTop)attrs.get(DialogOnTop.class);
|
||||
if (onTop != null) {
|
||||
parentWindowID = DialogOwnerAccessor.getID(onTop);
|
||||
parentWindowID = onTop.getID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue