void notifyAttrListeners(final PrintJobAttribute... attrs) { final PrintJobAttributeSet attrSet = new HashPrintJobAttributeSet(attrs); final PrintJobAttributeEvent event = new PrintJobAttributeEvent(this, attrSet); for (PrintJobAttribute attr : attrs) { final Class<? extends Attribute> cat = attr.getCategory(); for (Map.Entry<PrintJobAttributeListener, PrintJobAttributeSet> e : attrListeners .entrySet()) { if ((e.getValue() == null) || (e.getValue().containsKey(cat))) { e.getKey().attributeUpdate(event); } } } }
public PrintJobAttributeSet getAttributes() { synchronized (this) { if (jobAttrSet == null) { /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); } else { return jobAttrSet; } } }
@Override public PrintJobAttributeSet getAttributes(){ synchronized(this){ if(jobAttrSet == null){ /* just return an empty set until the job is submitted */ PrintJobAttributeSet jobSet = new HashPrintJobAttributeSet(); return AttributeSetUtilities.unmodifiableView(jobSet); }else{ return jobAttrSet; } } }
public PrintJobAttributeSet getAttributes() { final PrintJobAttributeSet attrs = service.getPrinterProps() .getAttributes(new HashPrintJobAttributeSet()); for (Attribute attr : attrs.toArray()) { if (!(attr instanceof PrintJobAttribute)) { attrs.remove(attr); } } return AttributeSetUtilities.unmodifiableView(attrs); }
protected All2PSDocPrintJob(StreamPrintService printService) { super(); begetPrintService = printService; printJobListeners = new ArrayList(); printJobAttributeListeners = new ArrayList(); printJobAttributeSet = new HashPrintJobAttributeSet(); jobName = "PS printing"; copies = 1; outstream = new PrintStream(printService.getOutputStream()); }
public DefaultPrintJob(DefaultPrintService printservice) { if (printservice == null) { throw new NullPointerException("Argument is null"); } this.printService = printservice; this.printClient = printService.getPrintClient(); printJobAS = new HashPrintJobAttributeSet(); busyFlag = false; }