978 * returned when we try and pop a finished graphic.
979 */
980 if (graphicsDrawn.pop() != null) {
981 result = PAGE_EXISTS;
982 } else {
983 result = NO_SUCH_PAGE;
984 }
985
986 return result;
987 }
988
989 private void startPrinterJobThread() {
990 printerJobThread = new ManagedLocalsThread(this, "printerJobThread");
991 printerJobThread.start();
992 }
993
994
995 public void run() {
996
997 try {
998 printerJob.print(attributes);
999 } catch (PrinterException e) {
1000 //REMIND: need to store this away and not rethrow it.
1001 }
1002
1003 /* Close the message queues so that nobody is stuck
1004 * waiting for one.
1005 */
1006 graphicsToBeDrawn.closeWhenEmpty();
1007 graphicsDrawn.close();
1008 }
1009
1010 private class MessageQ {
1011
1012 private String qid="noname";
1013
1014 private ArrayList<Graphics2D> queue = new ArrayList<>();
1015
1016 MessageQ(String id) {
1017 qid = id;
|
978 * returned when we try and pop a finished graphic.
979 */
980 if (graphicsDrawn.pop() != null) {
981 result = PAGE_EXISTS;
982 } else {
983 result = NO_SUCH_PAGE;
984 }
985
986 return result;
987 }
988
989 private void startPrinterJobThread() {
990 printerJobThread = new ManagedLocalsThread(this, "printerJobThread");
991 printerJobThread.start();
992 }
993
994
995 public void run() {
996
997 try {
998 attributes.remove(PageRanges.class);
999 printerJob.print(attributes);
1000 } catch (PrinterException e) {
1001 //REMIND: need to store this away and not rethrow it.
1002 }
1003
1004 /* Close the message queues so that nobody is stuck
1005 * waiting for one.
1006 */
1007 graphicsToBeDrawn.closeWhenEmpty();
1008 graphicsDrawn.close();
1009 }
1010
1011 private class MessageQ {
1012
1013 private String qid="noname";
1014
1015 private ArrayList<Graphics2D> queue = new ArrayList<>();
1016
1017 MessageQ(String id) {
1018 qid = id;
|