1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.print.event;
  27 
  28 /**
  29  * An abstract adapter class for receiving print job events. The methods in this
  30  * class are empty. This class exists as a convenience for creating listener
  31  * objects. Extend this class to create a {@link PrintJobEvent} listener and
  32  * override the methods for the events of interest. Unlike the
  33  * {@link java.awt.event.ComponentListener ComponentListener} interface, this
  34  * abstract interface provides empty methods so that you only need to define the
  35  * methods you need, rather than all of the methods.
  36  */
  37 public abstract class PrintJobAdapter implements PrintJobListener {
  38 
  39     /**
  40      * Called to notify the client that data has been successfully transferred
  41      * to the print service, and the client may free local resources allocated
  42      * for that data. The client should not assume that the data has been
  43      * completely printed after receiving this event.
  44      *
  45      * @param  pje the event being notified
  46      */
  47     public void printDataTransferCompleted(PrintJobEvent pje)  {
  48     }
  49 
  50     /**
  51      * Called to notify the client that the job completed successfully.
  52      *
  53      * @param  pje the event being notified
  54      */
  55     public void printJobCompleted(PrintJobEvent pje)  {
  56     }
  57 
  58     /**
  59      * Called to notify the client that the job failed to complete successfully
  60      * and will have to be resubmitted.
  61      *
  62      * @param  pje the event being notified
  63      */
  64     public void printJobFailed(PrintJobEvent pje)  {
  65     }
  66 
  67     /**
  68      * Called to notify the client that the job was canceled by user or program.
  69      *
  70      * @param  pje the event being notified
  71      */
  72     public void printJobCanceled(PrintJobEvent pje) {
  73     }
  74 
  75     /**
  76      * Called to notify the client that no more events will be delivered. One
  77      * cause of this event being generated is if the job has successfully
  78      * completed, but the printing system is limited in capability and cannot
  79      * verify this. This event is required to be delivered if none of the other
  80      * terminal events (completed/failed/canceled) are delivered.
  81      *
  82      * @param  pje the event being notified
  83      */
  84     public void printJobNoMoreEvents(PrintJobEvent pje)  {
  85     }
  86 
  87     /**
  88      * Called to notify the client that some possibly user rectifiable problem
  89      * occurs (eg printer out of paper).
  90      *
  91      * @param  pje the event being notified
  92      */
  93     public void printJobRequiresAttention(PrintJobEvent pje)  {
  94     }
  95 }