From: <doc...@us...> - 2007-07-02 18:21:45
|
Revision: 96 http://openpcl.svn.sourceforge.net/openpcl/?rev=96&view=rev Author: documentsystems Date: 2007-07-02 11:21:48 -0700 (Mon, 02 Jul 2007) Log Message: ----------- Changed to reference class instance varialbe mProcessPrintType in several places instead of the passed in variable. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-06-21 23:43:48 UTC (rev 95) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-07-02 18:21:48 UTC (rev 96) @@ -132,6 +132,7 @@ mProcessPrintType = pProcessPrintType; StringBuffer tStringBuffer = new StringBuffer(); + mPagesToPrintArrayList = null; // Depending on if print all, print selected, print changed, print remaining, get which pages to print switch (mProcessPrintType) { case sProcessPrintAll: @@ -157,24 +158,24 @@ mPosView.getOpenPCLViewer().setIsDrawingForPrinting(false); // Show error dialog depending on if print all, print selected, print changed, print remaining. - switch (pProcessPrintType) { + switch (mProcessPrintType) { case sProcessPrintAll: - JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[mProcessPrintType] + "\" because no pages found to print", "No pages to print", JOptionPane.INFORMATION_MESSAGE); break; case sProcessPrintSelected: - JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[mProcessPrintType] + "\" 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] + + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[mProcessPrintType] + "\" because no changed pages were found.", "No pages to print", JOptionPane.INFORMATION_MESSAGE); break; case sProcessPrintRemaining: - JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[pProcessPrintType] + + JOptionPane.showMessageDialog(mParentFrame, "Can't \"" + mTitleBarTextForPrintDialog[mProcessPrintType] + "\" because you need to Left Click on the tree to select one or more pages.", "No pages to print", JOptionPane.INFORMATION_MESSAGE); break; @@ -306,8 +307,10 @@ // return if there's no current pages to print if (pPagesToPrintArrayList == null || pPagesToPrintArrayList.size() < 1) { return false; } - // Make a new ByteArrayOutputStream with the Pcl bytes gotten from the BLK page or from the PCL file page - tByteArrayOutputStream = new ByteArrayOutputStream(20000); + // Make a new ByteArrayOutputStream with the Pcl bytes gotten from the BLK page or from the PCL file page, + // and make it 20k bytes. Note that ByteArrayOutputStream automatically grows the storage space if it runs out of room + // by allocating a new bigger byte array then doing a memcopy to the new one. + tByteArrayOutputStream = new ByteArrayOutputStream(20 * 1024); // Get the PCL bytes for each page that the user selected in the tree (could be one page or multi page) for (tPageNumber = 0; tPageNumber < pPagesToPrintArrayList.size(); tPageNumber++) { @@ -340,7 +343,7 @@ tByteArrayOutputStream.write(tLegalSizePaperBytes); } else { - // Pick the paper size by calling the below method with may be subclassed by a plugin. + // Pick the paper size by calling the below method which may be subclassed by a plugin. // The below uses polymorphism because the method isTreeNodePageLetterSize() is one of the subclassed // methods specified in the interface IPluginHooksOpenPCL if (mPosView.getOpenPCLViewer().isTreeNodePageLetterSize(tPrintThisTreeNode)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |