/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*/
private boolean fidelity;
private boolean printing = false;
private boolean printReturned = false;
/* these variables used globally to store reference to the print
* data retrieved as a stream. On completion these are always closed
* if non-null.
*/
/* default values overridden by those extracted from the attributes */
/* print job handle used by native code */
private long hPrintJob;
/* buffer length for printing raw data */
}
return service;
}
synchronized (this) {
if (jobAttrSet == null) {
/* just return an empty set until the job is submitted */
} else {
return jobAttrSet;
}
}
}
synchronized (this) {
return;
}
if (jobListeners == null) {
jobListeners = new Vector();
}
}
}
synchronized (this) {
return;
}
if (jobListeners.isEmpty()) {
jobListeners = null;
}
}
}
/* Closes any stream already retrieved for the data.
* We want to avoid unnecessarily asking the Doc to create a stream only
* to get a reference in order to close it because the job failed.
* If the representation class is itself a "stream", this
* closes that stream too.
*/
private void closeDataStreams() {
return;
}
try {
} catch (IOException e) {
return;
}
try {
} catch (IOException e) {
} finally {
}
}
try {
} catch (IOException e) {
} finally {
}
}
else if (data instanceof InputStream) {
try {
} catch (IOException e) {
}
}
try {
} catch (IOException e) {
}
}
}
/* since this method should always get called, here's where
* we will perform the clean up of any data stream supplied.
*/
switch (reason) {
case PrintJobEvent.JOB_CANCELED :
case PrintJobEvent.JOB_FAILED :
case PrintJobEvent.NO_MORE_EVENTS :
case PrintJobEvent.JOB_COMPLETE :
}
synchronized (this) {
if (jobListeners != null) {
switch (reason) {
case PrintJobEvent.JOB_COMPLETE :
break;
case PrintJobEvent.JOB_CANCELED :
break;
case PrintJobEvent.JOB_FAILED :
break;
break;
case PrintJobEvent.NO_MORE_EVENTS :
break;
default:
break;
}
}
}
}
}
public void addPrintJobAttributeListener(
synchronized (this) {
return;
}
if (attrListeners == null) {
attrListeners = new Vector();
listenedAttributeSets = new Vector();
}
if (attributes == null) {
attributes = new HashPrintJobAttributeSet();
}
}
}
public void removePrintJobAttributeListener(
synchronized (this) {
return;
}
if (index == -1) {
return;
} else {
if (attrListeners.isEmpty()) {
}
}
}
}
throws PrintException {
synchronized (this) {
if (printing) {
throw new PrintException("already printing");
} else {
printing = true;
}
}
PrinterState.class);
PrinterStateReasons.class);
if ((prnStateReasons != null) &&
{
throw new PrintException("PrintService is no longer available.");
}
}
PrinterIsAcceptingJobs.class)) ==
throw new PrintException("Printer is not accepting job.");
}
/* check if the parameters are valid before doing much processing */
try {
} catch (IOException e) {
}
}
try {
throw new PrintException("No stream for data");
}
return;
} catch (ClassCastException cce) {
throw new PrintException(cce);
} catch (IOException ioe) {
throw new PrintException(ioe);
}
try {
return;
} catch (ClassCastException cce) {
throw new PrintException(cce);
}
try {
return;
} catch (ClassCastException cce) {
throw new PrintException(cce);
} catch (IOException ioe) {
throw new PrintException(ioe);
}
try {
return;
} catch (ClassCastException cce) {
throw new PrintException(cce);
} catch (IOException ioe) {
throw new PrintException(ioe);
}
try {
} catch (IOException e) {
throw new PrintException(e.toString());
}
} else {
try {
} catch (IOException ioe) {
}
}
throw new PrintException("No stream for data");
}
try {
byte []buffer = new byte[1024];
int cread;
}
} catch (FileNotFoundException fnfe) {
} catch (IOException ioe) {
}
return;
}
throw new PrintException("Print job failed to start.");
}
int bread = 0;
try {
byte[] buffer = new byte[PRINTBUFFERLEN];
throw new PrintException ("Problem while spooling data");
}
}
if (!endPrintRawData()) {
throw new PrintException("Print job failed to close properly.");
}
} catch (IOException e) {
throw new PrintException (e.toString());
} finally {
}
} else {
}
}
try {
synchronized(this) {
throw new PrintException("already printing");
} else {
}
}
if (copies == 0) {
}
if (media instanceof MediaSizeName) {
}
}
orient =
}
p.getHeight()-144.0);
}
}
return;
} catch (PrinterException pe) {
throw new PrintException(pe);
} finally {
printReturned = true;
}
}
try {
synchronized(this) {
throw new PrintException("already printing");
} else {
}
}
if (copies == 0) {
}
return;
} catch (PrinterException pe) {
throw new PrintException(pe);
} finally {
printReturned = true;
}
}
/* There's some inefficiency here as the job set is created even though
* it may never be requested.
*/
private synchronized void
reqAttrSet = new HashPrintRequestAttributeSet();
jobAttrSet = new HashPrintJobAttributeSet();
if (attrs[i] instanceof PrintJobAttribute) {
}
}
}
if (attrs[i] instanceof PrintRequestAttribute) {
}
if (attrs[i] instanceof PrintJobAttribute) {
}
}
}
/* add the user name to the job */
try {
} catch (SecurityException se) {
}
} else {
}
} else {
}
/* if no job name supplied use doc name (if supplied), if none and
* its a URL use that, else finally anything .. */
} else {
try {
}
} catch (IOException e) {
}
}
}
}
fidelity = true;
} else {
fidelity = false;
}
if (fidelity == true) {
throw new PrintJobAttributeException(
} else if
throw new PrintJobAttributeException(
}
}
if (category == Destination.class) {
throw new PrintException("Not a file: URI");
} else {
try {
} catch (Exception e) {
throw new PrintException(e);
}
// check write access
try {
} catch (SecurityException se) {
throw new PrintException(se);
}
}
}
if (attr instanceof MediaSizeName) {
// If requested MediaSizeName is not supported,
// get the corresponding media size - this will
// be used to create a new PageFormat.
}
}
} else if (category == OrientationRequested.class) {
}
}
}
private native boolean endPrintRawData();
/* Cancel PrinterJob jobs that haven't yet completed. */
synchronized (this) {
if (!printing) {
throw new PrintException("Job is not yet submitted.");
return;
} else {
throw new PrintException("Job could not be cancelled.");
}
}
}
}