feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
54
jdkSrc/jdk8/javax/print/event/PrintEvent.java
Normal file
54
jdkSrc/jdk8/javax/print/event/PrintEvent.java
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class PrintEvent is the super class of all Print Service API events.
|
||||
*/
|
||||
|
||||
public class PrintEvent extends java.util.EventObject {
|
||||
|
||||
private static final long serialVersionUID = 2286914924430763847L;
|
||||
|
||||
/**
|
||||
* Constructs a PrintEvent object.
|
||||
* @param source is the source of the event
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public PrintEvent (Object source) {
|
||||
super(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a message describing the event
|
||||
*/
|
||||
public String toString() {
|
||||
return ("PrintEvent on " + getSource().toString());
|
||||
}
|
||||
|
||||
}
|
||||
105
jdkSrc/jdk8/javax/print/event/PrintJobAdapter.java
Normal file
105
jdkSrc/jdk8/javax/print/event/PrintJobAdapter.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
/**
|
||||
* An abstract adapter class for receiving print job events.
|
||||
* The methods in this class are empty.
|
||||
* This class exists as a convenience for creating listener objects.
|
||||
* Extend this class to create a {@link PrintJobEvent} listener and override
|
||||
* the methods for the events of interest. Unlike the
|
||||
* {@link java.awt.event.ComponentListener ComponentListener}
|
||||
* interface, this abstract interface provides null methods so that you
|
||||
* only need to define the methods you need, rather than all of the methods.
|
||||
*
|
||||
*/
|
||||
|
||||
public abstract class PrintJobAdapter implements PrintJobListener {
|
||||
|
||||
/**
|
||||
* Called to notify the client that data has been successfully
|
||||
* transferred to the print service, and the client may free
|
||||
* local resources allocated for that data. The client should
|
||||
* not assume that the data has been completely printed after
|
||||
* receiving this event.
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printDataTransferCompleted(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job completed successfully.
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printJobCompleted(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job failed to complete
|
||||
* successfully and will have to be resubmitted.
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printJobFailed(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job was canceled
|
||||
* by user or program.
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printJobCanceled(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that no more events will be delivered.
|
||||
* One cause of this event being generated is if the job
|
||||
* has successfully completed, but the printing system
|
||||
* is limited in capability and cannot verify this.
|
||||
* This event is required to be delivered if none of the other
|
||||
* terminal events (completed/failed/canceled) are delivered.
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printJobNoMoreEvents(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that some possibly user rectifiable
|
||||
* problem occurs (eg printer out of paper).
|
||||
*
|
||||
* @param pje the event being notified
|
||||
*/
|
||||
public void printJobRequiresAttention(PrintJobEvent pje) {
|
||||
}
|
||||
|
||||
}
|
||||
82
jdkSrc/jdk8/javax/print/event/PrintJobAttributeEvent.java
Normal file
82
jdkSrc/jdk8/javax/print/event/PrintJobAttributeEvent.java
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
import javax.print.DocPrintJob;
|
||||
import javax.print.attribute.AttributeSetUtilities;
|
||||
import javax.print.attribute.PrintJobAttributeSet;
|
||||
|
||||
/**
|
||||
* Class PrintJobAttributeEvent encapsulates an event a PrintService
|
||||
* reports to let the client know that one or more printing attributes for a
|
||||
* PrintJob have changed.
|
||||
*/
|
||||
|
||||
public class PrintJobAttributeEvent extends PrintEvent {
|
||||
|
||||
private static final long serialVersionUID = -6534469883874742101L;
|
||||
|
||||
private PrintJobAttributeSet attributes;
|
||||
|
||||
/**
|
||||
* Constructs a PrintJobAttributeEvent object.
|
||||
* @param source the print job generating this event
|
||||
* @param attributes the attribute changes being reported
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public PrintJobAttributeEvent (DocPrintJob source,
|
||||
PrintJobAttributeSet attributes) {
|
||||
super(source);
|
||||
|
||||
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the Print Job to which this print job event pertains.
|
||||
*
|
||||
* @return Print Job object.
|
||||
*/
|
||||
public DocPrintJob getPrintJob() {
|
||||
|
||||
return (DocPrintJob) getSource();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the printing attributes that changed and their new values.
|
||||
*
|
||||
* @return Attributes containing the new values for the print job
|
||||
* attributes that changed. The returned set may not be modifiable.
|
||||
*/
|
||||
public PrintJobAttributeSet getAttributes() {
|
||||
|
||||
return attributes;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
46
jdkSrc/jdk8/javax/print/event/PrintJobAttributeListener.java
Normal file
46
jdkSrc/jdk8/javax/print/event/PrintJobAttributeListener.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
/**
|
||||
* Implementations of this interface are attached to a
|
||||
* {@link javax.print.DocPrintJob DocPrintJob} to monitor
|
||||
* the status of attribute changes associated with the print job.
|
||||
*
|
||||
*/
|
||||
public interface PrintJobAttributeListener {
|
||||
|
||||
/**
|
||||
* Notifies the listener of a change in some print job attributes.
|
||||
* One example of an occurrence triggering this event is if the
|
||||
* {@link javax.print.attribute.standard.JobState JobState}
|
||||
* attribute changed from
|
||||
* <code>PROCESSING</code> to <code>PROCESSING_STOPPED</code>.
|
||||
* @param pjae the event.
|
||||
*/
|
||||
public void attributeUpdate(PrintJobAttributeEvent pjae) ;
|
||||
|
||||
}
|
||||
125
jdkSrc/jdk8/javax/print/event/PrintJobEvent.java
Normal file
125
jdkSrc/jdk8/javax/print/event/PrintJobEvent.java
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
import javax.print.DocPrintJob;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class <code>PrintJobEvent</code> encapsulates common events a print job
|
||||
* reports to let a listener know of progress in the processing of the
|
||||
* {@link DocPrintJob}.
|
||||
*
|
||||
*/
|
||||
|
||||
public class PrintJobEvent extends PrintEvent {
|
||||
|
||||
private static final long serialVersionUID = -1711656903622072997L;
|
||||
|
||||
private int reason;
|
||||
|
||||
/**
|
||||
* The job was canceled by the {@link javax.print.PrintService PrintService}.
|
||||
*/
|
||||
public static final int JOB_CANCELED = 101;
|
||||
|
||||
/**
|
||||
* The document cis completely printed.
|
||||
*/
|
||||
public static final int JOB_COMPLETE = 102;
|
||||
|
||||
/**
|
||||
* The print service reports that the job cannot be completed.
|
||||
* The application must resubmit the job.
|
||||
*/
|
||||
|
||||
public static final int JOB_FAILED = 103;
|
||||
|
||||
/**
|
||||
* The print service indicates that a - possibly transient - problem
|
||||
* may require external intervention before the print service can
|
||||
* continue. One example of an event that can
|
||||
* generate this message is when the printer runs out of paper.
|
||||
*/
|
||||
public static final int REQUIRES_ATTENTION = 104;
|
||||
|
||||
/**
|
||||
* Not all print services may be capable of delivering interesting
|
||||
* events, or even telling when a job is complete. This message indicates
|
||||
* the print job has no further information or communication
|
||||
* with the print service. This message should always be delivered
|
||||
* if a terminal event (completed/failed/canceled) is not delivered.
|
||||
* For example, if messages such as JOB_COMPLETE have NOT been received
|
||||
* before receiving this message, the only inference that should be drawn
|
||||
* is that the print service does not support delivering such an event.
|
||||
*/
|
||||
public static final int NO_MORE_EVENTS = 105;
|
||||
|
||||
/**
|
||||
* The job is not necessarily printed yet, but the data has been transferred
|
||||
* successfully from the client to the print service. The client may
|
||||
* free data resources.
|
||||
*/
|
||||
public static final int DATA_TRANSFER_COMPLETE = 106;
|
||||
|
||||
/**
|
||||
* Constructs a <code>PrintJobEvent</code> object.
|
||||
*
|
||||
* @param source a <code>DocPrintJob</code> object
|
||||
* @param reason an int specifying the reason.
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
|
||||
public PrintJobEvent( DocPrintJob source, int reason) {
|
||||
|
||||
super(source);
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reason for this event.
|
||||
* @return reason int.
|
||||
*/
|
||||
public int getPrintEventType() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the <code>DocPrintJob</code> to which this print job
|
||||
* event pertains.
|
||||
*
|
||||
* @return the <code>DocPrintJob</code> object that represents the
|
||||
* print job that reports the events encapsulated by this
|
||||
* <code>PrintJobEvent</code>.
|
||||
*
|
||||
*/
|
||||
public DocPrintJob getPrintJob() {
|
||||
return (DocPrintJob) getSource();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
95
jdkSrc/jdk8/javax/print/event/PrintJobListener.java
Normal file
95
jdkSrc/jdk8/javax/print/event/PrintJobListener.java
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
/**
|
||||
* Implementations of this listener interface should be attached to a
|
||||
* {@link javax.print.DocPrintJob DocPrintJob} to monitor the status of
|
||||
* the printer job.
|
||||
* These callback methods may be invoked on the thread processing the
|
||||
* print job, or a service created notification thread. In either case
|
||||
* the client should not perform lengthy processing in these callbacks.
|
||||
*/
|
||||
|
||||
public interface PrintJobListener {
|
||||
|
||||
/**
|
||||
* Called to notify the client that data has been successfully
|
||||
* transferred to the print service, and the client may free
|
||||
* local resources allocated for that data. The client should
|
||||
* not assume that the data has been completely printed after
|
||||
* receiving this event.
|
||||
* If this event is not received the client should wait for a terminal
|
||||
* event (completed/canceled/failed) before freeing the resources.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printDataTransferCompleted(PrintJobEvent pje) ;
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job completed successfully.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printJobCompleted(PrintJobEvent pje) ;
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job failed to complete
|
||||
* successfully and will have to be resubmitted.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printJobFailed(PrintJobEvent pje) ;
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that the job was canceled
|
||||
* by a user or a program.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printJobCanceled(PrintJobEvent pje) ;
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that no more events will be delivered.
|
||||
* One cause of this event being generated is if the job
|
||||
* has successfully completed, but the printing system
|
||||
* is limited in capability and cannot verify this.
|
||||
* This event is required to be delivered if none of the other
|
||||
* terminal events (completed/failed/canceled) are delivered.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printJobNoMoreEvents(PrintJobEvent pje) ;
|
||||
|
||||
|
||||
/**
|
||||
* Called to notify the client that an error has occurred that the
|
||||
* user might be able to fix. One example of an error that can
|
||||
* generate this event is when the printer runs out of paper.
|
||||
* @param pje the job generating this event
|
||||
*/
|
||||
public void printJobRequiresAttention(PrintJobEvent pje) ;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
import javax.print.PrintService;
|
||||
import javax.print.attribute.AttributeSetUtilities;
|
||||
import javax.print.attribute.PrintServiceAttributeSet;
|
||||
|
||||
/**
|
||||
*
|
||||
* Class PrintServiceAttributeEvent encapsulates an event a
|
||||
* Print Service instance reports to let the client know of
|
||||
* changes in the print service state.
|
||||
*/
|
||||
|
||||
public class PrintServiceAttributeEvent extends PrintEvent {
|
||||
|
||||
private static final long serialVersionUID = -7565987018140326600L;
|
||||
|
||||
private PrintServiceAttributeSet attributes;
|
||||
|
||||
/**
|
||||
* Constructs a PrintServiceAttributeEvent object.
|
||||
*
|
||||
* @param source the print job generating this event
|
||||
* @param attributes the attribute changes being reported
|
||||
* @throws IllegalArgumentException if <code>source</code> is
|
||||
* <code>null</code>.
|
||||
*/
|
||||
public PrintServiceAttributeEvent(PrintService source,
|
||||
PrintServiceAttributeSet attributes) {
|
||||
|
||||
super(source);
|
||||
this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the print service.
|
||||
|
||||
* @return Print Service object.
|
||||
*/
|
||||
public PrintService getPrintService() {
|
||||
|
||||
return (PrintService) getSource();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine the printing service attributes that changed and their new
|
||||
* values.
|
||||
*
|
||||
* @return Attributes containing the new values for the service
|
||||
* attributes that changed. The returned set may be unmodifiable.
|
||||
*/
|
||||
public PrintServiceAttributeSet getAttributes() {
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.print.event;
|
||||
|
||||
/**
|
||||
* Implementations of this listener interface are attached to a
|
||||
* {@link javax.print.PrintService PrintService} to monitor
|
||||
* the status of the print service.
|
||||
* <p>
|
||||
* To monitor a particular job see {@link PrintJobListener} and
|
||||
* {@link PrintJobAttributeListener}.
|
||||
*/
|
||||
|
||||
public interface PrintServiceAttributeListener {
|
||||
|
||||
/**
|
||||
* Called to notify a listener of an event in the print service.
|
||||
* The service will call this method on an event notification thread.
|
||||
* The client should not perform lengthy processing in this callback
|
||||
* or subsequent event notifications may be blocked.
|
||||
* @param psae the event being notified
|
||||
*/
|
||||
public void attributeUpdate(PrintServiceAttributeEvent psae) ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user