From: <doc...@us...> - 2007-06-02 00:25:04
|
Revision: 78 http://openpcl.svn.sourceforge.net/openpcl/?rev=78&view=rev Author: documentsystems Date: 2007-06-01 17:25:06 -0700 (Fri, 01 Jun 2007) Log Message: ----------- Howard Hoagland. 1. Improved error dialog messages for Print All, Selected, Changed, Remaining for when the user didn't left click on any tree nodes to select one or more pages, and for when no changed nodes were found. 2. Changed wording on Print Setup Dialog to say "Index numbers that will print" instead of "Page numbers that wll print" because some tree structures where the page numbers are not the same as the index numbers of the selected tree nodes to print. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-06-01 22:02:30 UTC (rev 77) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-06-02 00:25:06 UTC (rev 78) @@ -4,6 +4,7 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Font; +import java.awt.Frame; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; import java.io.ByteArrayInputStream; @@ -44,6 +45,7 @@ public class PosPrintPages { private PosView mPosView = null; + private Frame mParentFrame = null; private PosPrintBufferedImage mPosPrintBufferedImage = null; private PosPrintPageableInterface mPosPrintPageableInterface = null; private PrinterJob mPrinterJob = null; @@ -74,6 +76,7 @@ public PosPrintPages(PosView pPosView) { super(); mPosView = pPosView; + mParentFrame = mPosView.getOpenPCLViewer().getAppFrame(); mPosPrintBufferedImage = new PosPrintBufferedImage(mPosView); mPosPrintPageableInterface = new PosPrintPageableInterface(mPosView); mAttributes = new HashPrintRequestAttributeSet(); @@ -90,7 +93,7 @@ tJPanel.setLayout(new BorderLayout()); tJPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); tJPanel.add(mPrintingProgressBar, BorderLayout.CENTER); - mPrintingProgressJDialog = new JDialog(mPosView.getOpenPCLViewer().getAppFrame(), "Print Progress", true); + mPrintingProgressJDialog = new JDialog(mParentFrame, "Print Progress", true); mPrintingProgressJDialog.setLayout(new BorderLayout()); mPrintingProgressJDialog.add(tJPanel, BorderLayout.CENTER); mPrintingProgressJDialog.pack(); @@ -143,10 +146,33 @@ } if (mPagesToPrintArrayList == null || mPagesToPrintArrayList.size() < 1) { - JOptionPane.showMessageDialog(mPosView.getOpenPCLViewer().getAppFrame(), - "No pages matched for \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + "\".", - "No pages matched", JOptionPane.INFORMATION_MESSAGE); + // Set not in printing mode mPosView.getOpenPCLViewer().setIsDrawingForPrinting(false); + + // Show error dialog depending on if print all, print selected, print changed, print remaining. + switch (pProcessPrintType) { + case sProcessPrintAll: + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + "\" because no pages found to print", + "No pages to print", JOptionPane.INFORMATION_MESSAGE); + break; + case sProcessPrintSelected: + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + "\" because you need to Left Click on the tree to select one or more pages.", + "No pages to print", JOptionPane.INFORMATION_MESSAGE); + break; + case sProcessPrintChanged: + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + "\" because no changed pages were found.", + "No pages to print", JOptionPane.INFORMATION_MESSAGE); + break; + case sProcessPrintRemaining: + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + "\" because you need to Left Click on the tree to select one or more pages.", + "No pages to print", JOptionPane.INFORMATION_MESSAGE); + break; + } + return false; } @@ -155,9 +181,9 @@ // Append all the selected page numbers to the StringBuffer tStringBuffer.append(" " + tNumberOfPagesThatWillPrint + " page"); if (tNumberOfPagesThatWillPrint == 1) { - tStringBuffer.append(". Page number: "); + tStringBuffer.append(". Index number: "); } else { - tStringBuffer.append("s. Page numbers are: "); + tStringBuffer.append("s. Index numbers are: "); } for (int i = 0; i < tNumberOfPagesThatWillPrint; i++) { @@ -178,7 +204,7 @@ mPosPrintSetupDialog = new PosPrintSetupDialog(mPosView, tDialogTitleBarString, mPosPrintSetupDialogChoices, mAttributes, mPrinterJob, tStringBuffer.toString()); - mPosPrintSetupDialog.setLocationRelativeTo(mPosView.getOpenPCLViewer().getAppFrame()); + mPosPrintSetupDialog.setLocationRelativeTo(mParentFrame); mPosPrintSetupDialog.setVisible(true); if ( !(mPosPrintSetupDialogChoices.getDidUserHitOk()) ) { @@ -190,7 +216,7 @@ // If user didn't pick a printer then put up dialog and return mPrintService = mPosPrintSetupDialogChoices.getSelectedPrintService(); if ( mPrintService == null) { - JOptionPane.showMessageDialog(mPosView.getOpenPCLViewer().getAppFrame(), "A printer was not selected.\n" + + JOptionPane.showMessageDialog(mParentFrame, "A printer was not selected.\n" + "Try again and click on a printer.", "Printer not selected", JOptionPane.ERROR_MESSAGE); @@ -201,7 +227,7 @@ mPrintingProgressBar.setMaximum(tNumberOfPagesThatWillPrint); mPrintingProgressBar.setString("Initializing..."); mPrintingProgressBar.setValue(0); - mPrintingProgressJDialog.setLocationRelativeTo(mPosView.getOpenPCLViewer().getAppFrame()); + mPrintingProgressJDialog.setLocationRelativeTo(mParentFrame); final SwingWorker threadShowProgressBar = new SwingWorker() { public Object construct() { @@ -231,7 +257,7 @@ mPosView.getOpenPCLViewer().setIsDrawingForPrinting(false); mPosView.getOpenPCLViewer().renderImageCurrentPageAndZoom(); JOptionPane.showMessageDialog(mPrintingProgressJDialog, - mPosView.getOpenPCLViewer().getAppName() + "\nFinished printing " + + mParentFrame + "\nFinished printing " + mPagesToPrintArrayList.size() + " page" + (mPagesToPrintArrayList.size() > 1 ? "s." : "."), "Finished Printing", JOptionPane.INFORMATION_MESSAGE); mPrintingProgressJDialog.setVisible(false); @@ -406,7 +432,7 @@ mPosPrintSetupDialogChoices, mAttributes, mPrinterJob, "No pages will print at this time because this is Printer Setup options only. Make sure to hit OK to save your changes."); - mPosPrintSetupDialog.setLocationRelativeTo(mPosView.getOpenPCLViewer().getAppFrame()); + mPosPrintSetupDialog.setLocationRelativeTo(mParentFrame); mPosPrintSetupDialog.setVisible(true); boolean userHitOk = mPosPrintSetupDialogChoices.getDidUserHitOk(); Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-06-01 22:02:30 UTC (rev 77) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-06-02 00:25:06 UTC (rev 78) @@ -105,7 +105,7 @@ // JLabels private JLabel mAddlCopiesJLabel = new JLabel("Additional Copies: "); private JLabel mFontSizeJLabel = new JLabel("Font size: "); - private JLabel mPageNumbersThatWillPrintJLabel = new JLabel("Page numbers that will print:"); + private JLabel mPageNumbersThatWillPrintJLabel = new JLabel("Index numbers that will print:"); // JTextFields private JTextField mAddlCopiesJTextField = new JTextField(3); @@ -222,7 +222,7 @@ // Add the tab panels to the JTabbedPane mJTabbedPane.add(mTab1, "View Specific"); - mJTabbedPane.add(mTab2, "Page Numbers That Will Print"); + mJTabbedPane.add(mTab2, "Index Numbers That Will Print"); mJTabbedPane.add(mTab3, "Generic Properties"); // Add the Control Panel, JTabbedPane, and buttons panel to the contentPane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |