本文整理汇总了Java中javax.print.PrintService.getDefaultAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:Java PrintService.getDefaultAttributeValue方法的具体用法?Java PrintService.getDefaultAttributeValue怎么用?Java PrintService.getDefaultAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.print.PrintService
的用法示例。
在下文中一共展示了PrintService.getDefaultAttributeValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pageableJob
import javax.print.PrintService; //导入方法依赖的package包/类
public void pageableJob(Pageable pageable) throws PrintException {
try {
synchronized(this) {
if (job != null) { // shouldn't happen
throw new PrintException("already printing");
} else {
job = new sun.awt.windows.WPrinterJob();
}
}
PrintService svc = getPrintService();
job.setPrintService(svc);
if (copies == 0) {
Copies c = (Copies)svc.getDefaultAttributeValue(Copies.class);
copies = c.getValue();
}
job.setCopies(copies);
job.setJobName(jobName);
job.setPageable(pageable);
job.print(reqAttrSet);
notifyEvent(PrintJobEvent.DATA_TRANSFER_COMPLETE);
return;
} catch (PrinterException pe) {
notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintException(pe);
} finally {
printReturned = true;
notifyEvent(PrintJobEvent.NO_MORE_EVENTS);
}
}
示例2: UnixPrintJob
import javax.print.PrintService; //导入方法依赖的package包/类
UnixPrintJob(PrintService service) {
this.service = service;
mDestination = service.getName();
if (PrintServiceLookupProvider.isMac()) {
mDestination = ((IPPPrintService)service).getDest();
}
mDestType = UnixPrintJob.DESTPRINTER;
JobSheets js = (JobSheets)(service.
getDefaultAttributeValue(JobSheets.class));
if (js != null && js.equals(JobSheets.NONE)) {
mNoJobSheet = true;
}
}