? wnd : new Frame());
/* Combine this PrinterJob this.attrs attribute set and attrs set
and resolve MediaPrintableArea/MediaMargins conflict if it is
needed */
PrintRequestAttributeSet sum = updateMediaAndMarginsIfNeeded(arg_attrs);
Rectangle screen = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration().getBounds();
/* create and show the page dialog */
ServiceUIDialog dialog = new ServiceUIDialog(null,
screen.width/3,
screen.height/3,
getPrintService(),
sum,
owner);
dialog.show();
if (owner != wnd) {
owner.dispose();
}
/* update this.attrs attribute set and result page format to return */
if (dialog.getResult() == ServiceUIDialog.APPROVE_PRINT) {
PrintRequestAttributeSet newattrs = dialog.getAttributes();
if (!newattrs.containsKey(Media.class)) {
this.attrs.remove(Media.class);
}
if (!newattrs.containsKey(OrientationRequested.class)) {
this.attrs.remove(OrientationRequested.class);
}
if (!newattrs.containsKey(MediaPrintableArea.class)) {
this.attrs.remove(MediaPrintableArea.class);
}
if (!newattrs.containsKey(MediaMargins.class)) {
this.attrs.remove(MediaMargins.class);
}
this.attrs.addAll(newattrs);
return getPageFormatForAttrs(newattrs);
}