本文整理汇总了Java中javax.print.event.PrintJobListener类的典型用法代码示例。如果您正苦于以下问题:Java PrintJobListener类的具体用法?Java PrintJobListener怎么用?Java PrintJobListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PrintJobListener类属于javax.print.event包,在下文中一共展示了PrintJobListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyPrintJobListeners
import javax.print.event.PrintJobListener; //导入依赖的package包/类
private void notifyPrintJobListeners(PrintJobEvent e)
{
Iterator it = printJobListener.iterator();
while (it.hasNext())
{
PrintJobListener l = (PrintJobListener) it.next();
if (e.getPrintEventType() == PrintJobEvent.DATA_TRANSFER_COMPLETE)
l.printDataTransferCompleted(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_CANCELED)
l.printJobCanceled(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_COMPLETE)
l.printJobCompleted(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_FAILED)
l.printJobFailed(e);
else if (e.getPrintEventType() == PrintJobEvent.NO_MORE_EVENTS)
l.printJobNoMoreEvents(e);
else
l.printJobRequiresAttention(e);
}
}
示例2: notifyPrintJobListeners
import javax.print.event.PrintJobListener; //导入依赖的package包/类
private void notifyPrintJobListeners(PrintJobEvent e)
{
Iterator it = printJobListener.iterator();
while (it.hasNext())
{
PrintJobListener l = (PrintJobListener) it.next();
if (e.getPrintEventType() == PrintJobEvent.DATA_TRANSFER_COMPLETE)
l.printDataTransferCompleted(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_CANCELED)
l.printJobCanceled(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_COMPLETE)
l.printJobCompleted(e);
else if (e.getPrintEventType() == PrintJobEvent.JOB_FAILED)
l.printJobFailed(e);
else if (e.getPrintEventType() == PrintJobEvent.NO_MORE_EVENTS)
l.printJobNoMoreEvents(e);
else
l.printJobRequiresAttention(e);
}
}
示例3: notifyJobListeners
import javax.print.event.PrintJobListener; //导入依赖的package包/类
void notifyJobListeners(final int reason) {
final PrintJobEvent event = new PrintJobEvent(this, reason);
for (PrintJobListener listener : jobListeners.keySet()) {
switch (reason) {
case PrintJobEvent.DATA_TRANSFER_COMPLETE:
listener.printDataTransferCompleted(event);
break;
case PrintJobEvent.JOB_CANCELED:
listener.printJobCanceled(event);
break;
case PrintJobEvent.JOB_COMPLETE:
listener.printJobCompleted(event);
break;
case PrintJobEvent.JOB_FAILED:
listener.printJobFailed(event);
break;
case PrintJobEvent.NO_MORE_EVENTS:
listener.printJobNoMoreEvents(event);
break;
case PrintJobEvent.REQUIRES_ATTENTION:
listener.printJobRequiresAttention(event);
break;
}
}
}
示例4: removePrintJobListener
import javax.print.event.PrintJobListener; //导入依赖的package包/类
public void removePrintJobListener(PrintJobListener listener) {
synchronized (this) {
if (listener == null || jobListeners == null ) {
return;
}
jobListeners.remove(listener);
if (jobListeners.isEmpty()) {
jobListeners = null;
}
}
}
示例5: addPrintJobListener
import javax.print.event.PrintJobListener; //导入依赖的package包/类
@Override
public void addPrintJobListener(PrintJobListener listener){
synchronized(this){
if(listener == null){
return;
}
if(jobListeners == null){
jobListeners = new ArrayList<PrintJobListener>();
}
jobListeners.add(listener);
}
}
示例6: removePrintJobListener
import javax.print.event.PrintJobListener; //导入依赖的package包/类
@Override
public void removePrintJobListener(PrintJobListener listener){
synchronized(this){
if(listener == null || jobListeners == null){
return;
}
jobListeners.remove(listener);
if(jobListeners.isEmpty()){
jobListeners = null;
}
}
}
示例7: addPrintJobListener
import javax.print.event.PrintJobListener; //导入依赖的package包/类
public void addPrintJobListener(PrintJobListener listener) {
synchronized (this) {
if (listener == null) {
return;
}
if (jobListeners == null) {
jobListeners = new Vector<>();
}
jobListeners.add(listener);
}
}
示例8: notifyEvent
import javax.print.event.PrintJobListener; //导入依赖的package包/类
private void notifyEvent(int reason) {
synchronized (this) {
if (jobListeners != null) {
PrintJobListener listener;
PrintJobEvent event = new PrintJobEvent(this, reason);
for (int i = 0; i < jobListeners.size(); i++) {
listener = jobListeners.elementAt(i);
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
listener.printJobCanceled(event);
break;
case PrintJobEvent.JOB_FAILED :
listener.printJobFailed(event);
break;
case PrintJobEvent.DATA_TRANSFER_COMPLETE :
listener.printDataTransferCompleted(event);
break;
case PrintJobEvent.NO_MORE_EVENTS :
listener.printJobNoMoreEvents(event);
break;
case PrintJobEvent.JOB_COMPLETE :
listener.printJobCompleted(event);
break;
default:
break;
}
}
}
}
}
示例9: addPrintJobListener
import javax.print.event.PrintJobListener; //导入依赖的package包/类
public void addPrintJobListener(PrintJobListener listener) {
synchronized (this) {
if (listener == null) {
return;
}
if (jobListeners == null) {
jobListeners = new Vector();
}
jobListeners.add(listener);
}
}