Пример #1
0
 private javax.print.attribute.standard.PrinterStateReasons extractResions(int status)
 {
     javax.print.attribute.standard.PrinterStateReasons reasons = new javax.print.attribute.standard.PrinterStateReasons();
     if ((status & PRINTER_STATUS_PAUSED) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.PAUSED, javax.print.attribute.standard.Severity.REPORT);
     }
     if ((status & PRINTER_STATUS_ERROR) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_PENDING_DELETION) > 0)
     {
     }
     if ((status & PRINTER_STATUS_PAPER_JAM) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.MEDIA_JAM, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_PAPER_OUT) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.MEDIA_EMPTY, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_MANUAL_FEED) > 0)
     {
     }
     if ((status & PRINTER_STATUS_PAPER_PROBLEM) > 0)
     {
     }
     if ((status & PRINTER_STATUS_OFFLINE) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TIMED_OUT, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_IO_ACTIVE) > 0)
     {
     }
     if ((status & PRINTER_STATUS_BUSY) > 0)
     {
     }
     if ((status & PRINTER_STATUS_PRINTING) > 0)
     {
     }
     if ((status & PRINTER_STATUS_OUTPUT_BIN_FULL) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OUTPUT_AREA_FULL, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_NOT_AVAILABLE) > 0)
     {
     }
     if ((status & PRINTER_STATUS_WAITING) > 0)
     {
     }
     if ((status & PRINTER_STATUS_PROCESSING) > 0)
     {
     }
     if ((status & PRINTER_STATUS_INITIALIZING) > 0)
     {
     }
     if ((status & PRINTER_STATUS_WARMING_UP) > 0)
     {
     }
     if ((status & PRINTER_STATUS_TONER_LOW) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TONER_LOW, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_NO_TONER) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TONER_EMPTY, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_PAGE_PUNT) > 0)
     {
     }
     if ((status & PRINTER_STATUS_USER_INTERVENTION) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_OUT_OF_MEMORY) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_DOOR_OPEN) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.DOOR_OPEN, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_SERVER_UNKNOWN) > 0)
     {
     }
     if ((status & PRINTER_STATUS_POWER_SAVE) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.PAUSED, javax.print.attribute.standard.Severity.REPORT);
     }
     return(reasons.isEmpty() ? null : reasons);
 }
Пример #2
0
 private javax.print.attribute.standard.PrinterStateReasons extractResions(int status)
 {
     javax.print.attribute.standard.PrinterStateReasons reasons = new javax.print.attribute.standard.PrinterStateReasons();
     if ((status & PRINTER_STATUS_PAUSED) > 0) 
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.PAUSED, javax.print.attribute.standard.Severity.REPORT);
     }
     if ((status & PRINTER_STATUS_ERROR) > 0) 
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_PENDING_DELETION) > 0) { }
     if ((status & PRINTER_STATUS_PAPER_JAM) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.MEDIA_JAM, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_PAPER_OUT) > 0)
     {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.MEDIA_EMPTY, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_MANUAL_FEED) > 0) { }
     if ((status & PRINTER_STATUS_PAPER_PROBLEM) > 0) {}
     if ((status & PRINTER_STATUS_OFFLINE) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TIMED_OUT, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_IO_ACTIVE) > 0) { }
     if ((status & PRINTER_STATUS_BUSY) > 0) { }
     if ((status & PRINTER_STATUS_PRINTING) > 0) { }
     if ((status & PRINTER_STATUS_OUTPUT_BIN_FULL) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OUTPUT_AREA_FULL, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_NOT_AVAILABLE) > 0) { }
     if ((status & PRINTER_STATUS_WAITING) > 0) { }
     if ((status & PRINTER_STATUS_PROCESSING) > 0) { }
     if ((status & PRINTER_STATUS_INITIALIZING) > 0) { }
     if ((status & PRINTER_STATUS_WARMING_UP) > 0) { }
     if ((status & PRINTER_STATUS_TONER_LOW) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TONER_LOW, javax.print.attribute.standard.Severity.WARNING);
     }
     if ((status & PRINTER_STATUS_NO_TONER) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.TONER_EMPTY, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_PAGE_PUNT) > 0) { }
     if ((status & PRINTER_STATUS_USER_INTERVENTION) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_OUT_OF_MEMORY) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.OTHER, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_DOOR_OPEN) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.DOOR_OPEN, javax.print.attribute.standard.Severity.ERROR);
     }
     if ((status & PRINTER_STATUS_SERVER_UNKNOWN) > 0) { }
     if ((status & PRINTER_STATUS_POWER_SAVE) > 0) {
         reasons.put(javax.print.attribute.standard.PrinterStateReason.PAUSED, javax.print.attribute.standard.Severity.REPORT);
     }
     return reasons.isEmpty() ? null : reasons;
 }