From: <doc...@us...> - 2007-06-14 22:46:26
|
Revision: 87 http://openpcl.svn.sourceforge.net/openpcl/?rev=87&view=rev Author: documentsystems Date: 2007-06-14 15:46:28 -0700 (Thu, 14 Jun 2007) Log Message: ----------- Howard Hoagland. Added class PriModifyPclBytes and changed class PosPrintPages for when printing PCL Direct, parse the PCL and remove form feeds (to not get blank pages), remove printer reset commands (ESC E), remove page size, remove paper source tray or manual feed, remove number of copies, remove duplex Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java Added Paths: ----------- openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java Added: openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java (rev 0) +++ openpcl/src/com/openpcl/pclrenderimage/util/PriModifyPclBytes.java 2007-06-14 22:46:28 UTC (rev 87) @@ -0,0 +1,113 @@ +package com.openpcl.pclrenderimage.util; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import com.openpcl.pclrenderimage.tools.PclCommandEvent; + +/** + * Modify the PCL bytes. + * 1. Remove form feed chars (FF = ^L = 12) but not FF chars in raster data. + * 2. Remove printer resets (ESC E) + * 3. Remove paper size commands (ESC & l # A) where Letter=2, Legal=3, there's more... + * 4. Remove paper source commands (ESC & l # H) where specific tray=1 and manual feed=2, lower tray=4, there's more... + * 5. Remove duplex commands (ESC & l # S) where Duplex=1,2 and Simplex=0 + * 6. Remove number of copies (ESC & l # X). + * + * @author DocMagic, Document Systems Inc, HowardH 6/13/07 + */ +public class PriModifyPclBytes implements PclCommandEvent { + private ByteArrayOutputStream mByteArrayOutputStream =null; + private static char sESC = 0x1B; // Escape char + private static char sFF = 0xC; // Form-feed + + public PriModifyPclBytes() { + // Make a new ByteArrayOutputStream that grows automatically as parsed Pcl bytes are added + mByteArrayOutputStream = new ByteArrayOutputStream(60 * 1024); // 60k bytes initially, but grows automatically + } + + public void initializeState() { + // Set the byte index to 0 to resuse it's byte array without allocating more memory + mByteArrayOutputStream.reset(); + } + + public byte[] getModifiedPclBytes() { + if (mByteArrayOutputStream != null) { + return mByteArrayOutputStream.toByteArray(); + } else { + return null; + } + } + + public void charFoundEvent(char pNextChar, int pBufferPos) { + if (pNextChar == sFF) { + // Don't add the form feed to the output PCL and return here + // PriDebug.releaseln("PriModifyPclBytes: Removed Form Feed char at input byte " + pBufferPos); + return; + + } else { + mByteArrayOutputStream.write(pNextChar); + } + } + + public void commandFoundEvent( + String pCmdLeadin, String pCmdValue, String pCmdTerminator, byte[] pCmdData, int pBufferPos) { + + String pclCmd = pCmdLeadin + "," + pCmdTerminator; + // Put into char array to not do a lot of String.substring() commands later + char[] tCmdCharArray = pclCmd.toCharArray(); + + if (tCmdCharArray[0] == 'E') { +// PriDebug.releaseln("PriModifyPclBytes: Removed Printer Reset PCL command ESC E"); + return; + } else if (tCmdCharArray[0] == '&') { + if (tCmdCharArray[1] == 'l') { + if (tCmdCharArray[2] == ',') { + if (tCmdCharArray[3] == 'A') { // &l,A is paper size +// PriDebug.releaseln("PriModifyPclBytes: Removed paper size PCL command ESC & l " + +// pCmdValue + " A at input byte " + pBufferPos); + return; + } else if (tCmdCharArray[3] == 'H') { // &l,H is paper source +// PriDebug.releaseln("PriModifyPclBytes: Removed paper source PCL command ESC & l " + +// pCmdValue + " H at input byte " + pBufferPos); + return; + } else if (tCmdCharArray[3] == 'S') { // &l,S is Simplex/Duplex +// PriDebug.releaseln("PriModifyPclBytes: Removed Simplex/Duplex PCL command ESC & l " + +// pCmdValue + " S at input byte " + pBufferPos); + return; + } else if (tCmdCharArray[3] == 'X') { // &l,X is number of copies +// PriDebug.releaseln("PriModifyPclBytes: Removed number of copies PCL command ESC & l " + +// pCmdValue + " X at input byte " + pBufferPos); + return; + } + } + } + } + + mByteArrayOutputStream.write(sESC); + try { + // Write the char after the ESC + if (pCmdLeadin != null && pCmdLeadin.length() > 0) { + mByteArrayOutputStream.write(pCmdLeadin.getBytes()); + } + + // Write the String of numbers + if (pCmdValue != null && pCmdValue.length() > 0) { + mByteArrayOutputStream.write(pCmdValue.getBytes()); + } + + // Write the terminating char + if (pCmdTerminator != null && pCmdTerminator.length() > 0) { + mByteArrayOutputStream.write(pCmdTerminator.getBytes()); + } + + // Write the raster data or soft font data bytes + if (pCmdData != null && pCmdData.length > 0) { + mByteArrayOutputStream.write(pCmdData); + } + + } catch (IOException e) { + e.printStackTrace(); + } + } +} Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-06-12 20:38:29 UTC (rev 86) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-06-14 22:46:28 UTC (rev 87) @@ -33,7 +33,9 @@ import javax.swing.JPanel; import javax.swing.JProgressBar; +import com.openpcl.pclrenderimage.tools.PclParser; import com.openpcl.pclrenderimage.util.PriDebug; +import com.openpcl.pclrenderimage.util.PriModifyPclBytes; import com.openpcl.viewer.panels.PosView; import com.openpcl.viewer.tree.PosTreeNode; import com.openpcl.viewer.util.SwingWorker; @@ -67,7 +69,9 @@ "Print All", "Print Selected", "Print Changed", "Print Remaining"}; public static byte sbESC = 0x1B; // Escape char public static byte sbFF = 0xC; // Form Feed ( char(12) ) - + private PriModifyPclBytes mPriModifyPclBytes = null; + private PclParser mPclParser = null; + /** * Constructor * @author howard 6/1/06 @@ -79,6 +83,7 @@ mParentFrame = mPosView.getOpenPCLViewer().getAppFrame(); mPosPrintBufferedImage = new PosPrintBufferedImage(mPosView); mPosPrintPageableInterface = new PosPrintPageableInterface(mPosView); + mPriModifyPclBytes = new PriModifyPclBytes(); mAttributes = new HashPrintRequestAttributeSet(); mPosPrintSetupDialogChoices = new PosPrintSetupDialogChoices(); mPrintingProgressBar = new JProgressBar(); @@ -126,7 +131,7 @@ StringBuffer tStringBuffer = new StringBuffer(); // Depending on if print all, print selected, print changed, print remaining, get which pages to print - switch (pProcessPrintType) { + switch (mProcessPrintType) { case sProcessPrintAll: mPagesToPrintArrayList = mPosView.getPosBuildListOfPagesToPrint().makeArrayListofAllPages(); tStringBuffer.append("\"Print all\""); @@ -315,6 +320,15 @@ // If no bytes on this page then continue to the next page if (tPclBytes == null || tPclBytes.length < 1) { continue; } + // Modify the PCL bytes + mPriModifyPclBytes.initializeState(); + mPclParser = new PclParser(tPclBytes, mPriModifyPclBytes); + mPclParser.ParsePCL(); + + byte[] tModifiedPclBytes = mPriModifyPclBytes.getModifiedPclBytes(); + + // PriDebug.releaseln("Pcl page before, after bytes: " + tPclBytes.length + ", " + tModifiedPclBytes.length); + try { if (pPosPrintSetupDialogChoices != null && pPosPrintSetupDialogChoices.shouldPrintAllOnLegalSize()) { // The user has a check in the Print Setup dialog box for "Print all Documents on Legal size" @@ -339,7 +353,7 @@ // Write the current page bytes try { - tByteArrayOutputStream.write(tPclBytes); + tByteArrayOutputStream.write(tModifiedPclBytes); if (mShouldOutputFormFeedBetweenPages) { tByteArrayOutputStream.write(sbFF); } } catch (IOException e) { return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-07-26 18:20:13
|
Revision: 126 http://openpcl.svn.sourceforge.net/openpcl/?rev=126&view=rev Author: documentsystems Date: 2007-07-26 11:20:14 -0700 (Thu, 26 Jul 2007) Log Message: ----------- In each of the 4 files IOpenPCL, IPclRenderImage, OpenPCLViewer, IPclRenderImage, in the method getImageForPage(), added the parameter byte[] pPrintTimePclBytes and code in the methods to implement the "Print Form Names" for Windows Print (PCL Direct print was already implemented previously). Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/api/IPclRenderImage.java openpcl/src/com/openpcl/viewer/api/IOpenPCL.java Modified: openpcl/src/com/openpcl/pclrenderimage/api/IPclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/api/IPclRenderImage.java 2007-07-26 01:27:15 UTC (rev 125) +++ openpcl/src/com/openpcl/pclrenderimage/api/IPclRenderImage.java 2007-07-26 18:20:14 UTC (rev 126) @@ -37,12 +37,14 @@ * In DocMaster, this is getImage(). * * @param pPageNumber. The Pcl page number to render to the image. + * @param pPrintTimePclBytes. Draw these additional PCL bytes on the print image. * @param pIsForPrinting. If true non printing items like signature blocks won't be rendered. * @param pPaperSize. If a paper size is not specified in the PCL, this paper size will be used. "LTR" or "LGL". * @param pZoomFactor. This is mandatory (see note for why). * @return BufferedImage. If null is returned, then call getLastErrorString() */ - public BufferedImage getImageForPage(int pPageNumber, boolean pIsForPrinting, String pPaperSize, double pZoomFactor); + public BufferedImage getImageForPage(int pPageNumber, byte[] pPrintTimePclBytes, + boolean pIsForPrinting, String pPaperSize, double pZoomFactor); /** * Get the last error string. Call this if getImageForPage() returned null instead of returning the BufferedImage. Modified: openpcl/src/com/openpcl/viewer/api/IOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-07-26 01:27:15 UTC (rev 125) +++ openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-07-26 18:20:14 UTC (rev 126) @@ -66,12 +66,14 @@ * In DocMaster, this is getImage(). * * @param pPageNumber. The Pcl page number to render to the image. + * @param pPrintTimePclBytes. Draw these additional PCL bytes on the print image. * @param pIsForPrinting. If true non printing items like signature blocks won't be rendered. * @param pPaperSize. If a paper size is not specified in the PCL, this paper size will be used. "LTR" or "LGL". * @param pZoomFactor. This is mandatory (see note for why). * @return BufferedImage. If null is returned, then call getLastErrorString() */ - public BufferedImage getImageForPage(int pPageNumber, boolean pIsForPrinting, String pPaperSize, double pZoomFactor); + public BufferedImage getImageForPage(int pPageNumber, byte[] pPrintTimePclBytes, + boolean pIsForPrinting, String pPaperSize, double pZoomFactor); /** * Convenience method that calls PclRenderImage.getLastRenderErrorString(). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-06 20:01:04
|
Revision: 144 http://openpcl.svn.sourceforge.net/openpcl/?rev=144&view=rev Author: documentsystems Date: 2007-08-06 13:01:07 -0700 (Mon, 06 Aug 2007) Log Message: ----------- Updated from "Version 0.06 March 28, 2007" to "Version 0.07 August 6, 2007" shown on the screen on the status bar and in the 2 dialogs Help About and License Info. In this version is implemented the print setup dialog options: Use Windows Print or print PCL Direct, Print as displayed, Legal first then Letter, Letter first then Legal, All on Legal, All on Letter (shrinks Legal), Print Form Names, Duplex. At program startup time, and at program exit time, using the new class PosPersistPrintOptionsValues, read and write all the print setup dialog options to the local persisted storage using the java.util.prefs.Preferences in a platform independent way. For Windows, it will write to the Registry at "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\openpcl\viewer". For Macintosh, the Preferences object in the local running JVM writes the settings in a Macintosh specific way. Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-08-06 17:51:17 UTC (rev 143) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-08-06 20:01:07 UTC (rev 144) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.06 March 28, 2007<br> +Version 0.07 August 6, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-08-06 17:51:17 UTC (rev 143) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-08-06 20:01:07 UTC (rev 144) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.06 March 28, 2007 +<br>Version 0.07 August 6, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-06 17:51:17 UTC (rev 143) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-06 20:01:07 UTC (rev 144) @@ -153,7 +153,7 @@ // Instance variables protected String mAppName = "OpenPCL Viewer"; protected String mAppDescription = " - Free Open Source PCL Viewer for the World"; - protected String mAppVersion = "Version 0.06 March 28, 2007"; + protected String mAppVersion = "Version 0.07 August 6, 2007"; private Frame mParentFrame = null; private JApplet mJApplet = null; Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-08-06 17:51:17 UTC (rev 143) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-08-06 20:01:07 UTC (rev 144) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.06 March 28, 2007<br> +Version 0.07 August 6, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-08-06 17:51:17 UTC (rev 143) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-08-06 20:01:07 UTC (rev 144) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.06 March 28, 2007 +<br>Version 0.07 August 6, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-17 23:12:42
|
Revision: 154 http://openpcl.svn.sourceforge.net/openpcl/?rev=154&view=rev Author: documentsystems Date: 2007-08-17 16:12:44 -0700 (Fri, 17 Aug 2007) Log Message: ----------- Howard Hoagland. 1. Changed the icon names in 7 classes to use Yuko's new icon names. 2. Upgraded the version number from 0.07 date of August 6, 2007 to 0.08 date of August 17, 2007 Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java openpcl/src/com/openpcl/viewer/tree/PosTree.java Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-08-17 23:12:44 UTC (rev 154) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.07 August 6, 2007<br> +Version 0.08 August 17, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-08-17 23:12:44 UTC (rev 154) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.07 August 6, 2007 +<br>Version 0.08 August 17, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-17 23:12:44 UTC (rev 154) @@ -153,7 +153,7 @@ // Instance variables protected String mAppName = "OpenPCL Viewer"; protected String mAppDescription = " - Free Open Source PCL Viewer for the World"; - protected String mAppVersion = "Version 0.07 August 6, 2007"; + protected String mAppVersion = "Version 0.08 August 17, 2007"; private Frame mParentFrame = null; private JApplet mJApplet = null; @@ -1542,7 +1542,7 @@ /** Allow subclases to set their own icon * Subclass plugins override this method so do not delete or rename this method. */ public Icon getJInternalFrameIcon() { - return (PosReadImageIcon.read("MultiDoc.gif")); + return (PosReadImageIcon.read("V221MultiDoc.png")); } /** Allow subclases to set their own title Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-08-17 23:12:44 UTC (rev 154) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.07 August 6, 2007<br> +Version 0.08 August 17, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-08-17 23:12:44 UTC (rev 154) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.07 August 6, 2007 +<br>Version 0.08 August 17, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java =================================================================== --- openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java 2007-08-17 23:12:44 UTC (rev 154) @@ -167,7 +167,7 @@ * @author howard 9/20/06 */ protected void buildSimpleUI() { - setIconImage(PosReadImageIcon.read("pclIcon_32x32.png").getImage()); + setIconImage(PosReadImageIcon.read("V221PclIcon32.png").getImage()); // This is the outer JPanel that will contain the OpenPCLViewer JPanel when added at BorderLayout.CENTER // It's needed to do it this way instead of adding the OpenPCLViewer JPanel directly in the JFrame's layout @@ -340,13 +340,13 @@ JMenu tJMenu = createMenu("File", 'F'); // File, Open - tJMenuItem = createMenuItem("Open Local File", PosReadImageIcon.read("Open.gif"), 'O', + tJMenuItem = createMenuItem("Open Local File", PosReadImageIcon.read("V221Open.png"), 'O', KeyStroke.getKeyStroke("ctrl O")); tJMenuItem.addActionListener(createOpenLocalFileActionListener()); tJMenu.add(tJMenuItem); // File, Close - tJMenuItem = createMenuItem("Close File", PosReadImageIcon.read("CloseFile.gif"), 'C', + tJMenuItem = createMenuItem("Close File", PosReadImageIcon.read("V221CloseFile.png"), 'C', KeyStroke.getKeyStroke("ctrl F4")); tJMenuItem.addActionListener(createCloseFileActionListener()); tJMenu.add(tJMenuItem); Modified: openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java 2007-08-17 23:12:44 UTC (rev 154) @@ -73,8 +73,8 @@ private String mUpdatesGroupBoxString = "Updates"; // Buttons - private JButton mCreateShortcutJButton = new JButton(PosReadImageIcon.read("pclIcon_32x32.png")); - private JButton mRegisterFileTypeJButton = new JButton(PosReadImageIcon.read("PageNewBig.gif")); + private JButton mCreateShortcutJButton = new JButton(PosReadImageIcon.read("V221PclIcon32.png")); + private JButton mRegisterFileTypeJButton = new JButton(PosReadImageIcon.read("V221PageNewBig.png")); private JButton mPrinterSetupDefaultsJButton = new JButton("Print Setup Defaults"); private JButton mEMailAdvancedSettingsJButton = new JButton("Advanced Settings for EMail"); private JButton mScanningSetupJButton = new JButton("Scanning Setup"); @@ -407,8 +407,6 @@ private void grayOutItemsNotImplemented() { // Buttons - mCreateShortcutJButton.setEnabled(false); - mRegisterFileTypeJButton.setEnabled(false); mEMailAdvancedSettingsJButton.setEnabled(false); mScanningSetupJButton.setEnabled(false); mCheckForUpdatesJButton.setEnabled(false); Modified: openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-08-17 23:12:44 UTC (rev 154) @@ -25,11 +25,11 @@ protected ListSelectionListener mListSelectionListener = null; protected Vector<JLabel> mBaseVector = new Vector<JLabel>(3); protected Vector<JLabel> mChoicesVector = null; - protected static final String sTileHorizontalName = "WindowTileHoriz.jpg"; - protected static final String sTileVerticalName = "WindowTileVert.jpg"; - protected static final String sCascadeName = "WindowCascade.jpg"; - protected static final String sWindowSelectedName = "WindowSelected.jpg"; - protected static final String sWindowUnselectedName = "WindowUnselected.jpg"; + protected static final String sTileHorizontalName = "V221WindowTileHoriz.png"; + protected static final String sTileVerticalName = "V221WindowTileVert.png"; + protected static final String sCascadeName = "V221WindowCascade.png"; + protected static final String sWindowSelectedName = "V221WindowSelected.png"; + protected static final String sWindowUnselectedName = "V221WindowUnselected.png"; protected Icon mTileHorizontalIcon = null; protected Icon mTileVerticalIcon = null; protected Icon mCascadeIcon = null; Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-08-17 23:12:44 UTC (rev 154) @@ -131,7 +131,7 @@ private JRadioButton mDuplexNoJRadioButton = new JRadioButton("No"); // JButtons - private JButton mPrintModeMoreInfoJButton = new JButton(null, PosReadImageIcon.read("QuestionMark.gif")); + private JButton mPrintModeMoreInfoJButton = new JButton(null, PosReadImageIcon.read("V221QuestionMark.gif")); private JButton mFontSizeDinkyJButton = new JButton("D"); private JButton mFontSizeSmallJButton = new JButton("*S*"); private JButton mFontSizeMediumJButton = new JButton("M"); Modified: openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-08-17 23:12:44 UTC (rev 154) @@ -139,7 +139,7 @@ /** Open Local File toolbar button */ protected JButton createOpenLocalFileButton() { - JButton tJButton = createToolBarButton("Open.gif", "Open File (Ctrl O)"); + JButton tJButton = createToolBarButton("V221Open.png", "Open File (Ctrl O)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionOpenLocalFileDialog();} }); @@ -148,7 +148,7 @@ /** Close File toolbar button */ protected JButton createCloseFileButton() { - JButton tJButton = createToolBarButton("CloseFile.gif", "Close File (Ctrl F4)"); + JButton tJButton = createToolBarButton("V221CloseFile.png", "Close File (Ctrl F4)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionCloseFile();} }); @@ -157,7 +157,7 @@ /** Close All Files toolbar button */ protected JButton createCloseAllFilesButton() { - JButton tJButton = createToolBarButton("CloseAll.jpg", "Close All Files"); + JButton tJButton = createToolBarButton("V221CloseAll.png", "Close All Files"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionCloseAllFiles();} }); @@ -166,7 +166,7 @@ /** Save as PCL file toolbar button */ protected JButton createSaveOnePageToPclFileButton() { - JButton tJButton = createToolBarButton("SaveEdit.gif", "Save one page to PCL file"); + JButton tJButton = createToolBarButton("V221Save.png", "Save one page to PCL file"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionSaveOnePageToPclFile();} }); @@ -175,7 +175,7 @@ /** Print toolbar button */ protected JButton createPrintButton() { - JButton tJButton = createToolBarButton("Print.gif", "Print"); + JButton tJButton = createToolBarButton("V221Print.png", "Print"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHidePrintChoicesPopup();} }); @@ -184,7 +184,7 @@ /** Previous Page toolbar button */ protected JButton createPreviousPageButton() { - JButton tJButton = createToolBarButton("ArrowLeft.gif", "Previous Page (Cursor up or Ctrl K)"); + JButton tJButton = createToolBarButton("V221ArrowLeft.png", "Previous Page (Cursor up or Ctrl K)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionPreviousPage();} }); @@ -193,7 +193,7 @@ /** Next Page toolbar button */ protected JButton createNextPageButton() { - JButton tJButton = createToolBarButton("ArrowRight.gif", "Next Page (Cursor down or Ctrl L)"); + JButton tJButton = createToolBarButton("V221ArrowRight.png", "Next Page (Cursor down or Ctrl L)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionNextPage();} }); @@ -202,7 +202,7 @@ /** Show/Hide Tree toolbar button */ protected JButton createShowHideTreeButton() { - JButton tJButton = createToolBarButton("TogglePane.gif", "Show/Hide Tree (Ctrl T)"); + JButton tJButton = createToolBarButton("V221ToggleTree.png", "Show/Hide Tree (Ctrl T)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if ((e.getModifiers() & ActionEvent.CTRL_MASK) > 1) { @@ -217,7 +217,7 @@ /** Zoom out toolbar button */ protected JButton createZoomOutButton() { - JButton tJButton = createToolBarButton("ZoomOut2.jpg", "Zoom Out 2% (Ctrl H)"); + JButton tJButton = createToolBarButton("V221ZoomOut.png", "Zoom Out 2% (Ctrl H)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionZoomOutOneNotch();} }); @@ -226,7 +226,7 @@ /** Zoom in toolbar button */ protected JButton createZoomInButton() { - JButton tJButton = createToolBarButton("ZoomIn2.jpg", "Zoom In 2% (Ctrl Z)"); + JButton tJButton = createToolBarButton("V221ZoomIn.png", "Zoom In 2% (Ctrl Z)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionZoomInOneNotch();} }); @@ -235,7 +235,7 @@ /** Show/Hide Zoom Slider toolbar button */ protected JToggleButton createShowHideZoomSliderButton() { - JToggleButton tJToggleButton = createToolBarToggleButton("ZoomSlider.jpg", "Show/Hide Zoom Slider",false); + JToggleButton tJToggleButton = createToolBarToggleButton("V221ZoomSlider.png", "Show/Hide Zoom Slider",false); tJToggleButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHideZoomSliderPopup();} }); @@ -244,7 +244,7 @@ /** Zoom width toolbar button */ protected JButton createZoomWidthPageButton() { - JButton tJButton = createToolBarButton("FitVisible.gif", "Zoom Width (Ctrl I)"); + JButton tJButton = createToolBarButton("V221FitVisible.png", "Zoom Width (Ctrl I)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionZoomWidth();} }); @@ -253,7 +253,7 @@ /** Change the Look toolbar button */ private JButton createChangeTheLookButton() { - JButton tJButton = createToolBarButton("ChangeTheLook.jpg", "Change the Look"); + JButton tJButton = createToolBarButton("V221ChangeLook.png", "Change the Look"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHideChangeTheLookPopup();} }); @@ -263,7 +263,7 @@ /** Cascade Windows toolbar button */ protected JButton createCascadeWindowsButton() { - JButton tJButton = createToolBarButton("WindowSelect.jpg", "Tile, Cascade, Select Open Window"); + JButton tJButton = createToolBarButton("V221WindowSelect.png", "Tile, Cascade, Select Open Window"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHideWindowControlPopup();} }); @@ -272,7 +272,7 @@ /** Options toolbar button */ protected JButton createOptionsButton() { - JButton tJButton = createToolBarButton("Options.png", "Options"); + JButton tJButton = createToolBarButton("V221Options.png", "Options"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowOptionsDialog();} }); @@ -281,7 +281,7 @@ /** Help About toolbar button */ protected JButton createHelpAboutButton() { - JButton tJButton = createToolBarButton("HelpAbout.jpg", "Help Choices (License Info and About)"); + JButton tJButton = createToolBarButton("V221HelpAbout.png", "Help Choices (License Info and About)"); tJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHideHelpChoicesPopup();} }); Modified: openpcl/src/com/openpcl/viewer/tree/PosTree.java =================================================================== --- openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-08-17 22:11:15 UTC (rev 153) +++ openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-08-17 23:12:44 UTC (rev 154) @@ -50,8 +50,8 @@ private JPopupMenu mTreeJPopupMenu = null; private boolean mShowHideExtraInfoOnTree = false; - protected static final String sPCL_ICON = "Eye.gif"; - protected static final String sPAGE_ICON = "Page.gif"; + protected static final String TREE_ROOT_ICON = "V221DocMain.png"; + protected static final String TREE_PAGE_ICON = "V221DocPage.png"; public PosTree(PosView pPosView, String pShortName) { super(); @@ -588,8 +588,8 @@ public PosTreeCellRenderer() { super(); - mPclIcon = PosReadImageIcon.read(sPCL_ICON); - mPageIcon = PosReadImageIcon.read(sPAGE_ICON); + mPclIcon = PosReadImageIcon.read(TREE_ROOT_ICON); + mPageIcon = PosReadImageIcon.read(TREE_PAGE_ICON); mtextSelectionColor = UIManager.getColor("Tree.selectionForeground"); mtextNonSelectionColor = UIManager.getColor("Tree.textForeground"); mbkSelectionColor = UIManager.getColor("Tree.selectionBackground"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-08 00:53:50
|
Revision: 167 http://openpcl.svn.sourceforge.net/openpcl/?rev=167&view=rev Author: documentsystems Date: 2007-09-07 17:53:51 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Howard Hoagland. Updated from "Version 0.07 August 6, 2007" to "Version 0.08 September 7, 2007" that is shown on the title bar, and in the Help About and the License Info. This 0.08 version changes are: 1. Added code to center the page image horizontally when the user clicked on "Print all on Letter (shrinks Legal)" for the Legal pages to look centered after they've been shrunk to fit on Letter paper. 2. Changed 38 icons to the ones that Yuko Miyahara made, and changed 7 source code files to have the names of the new icons. 3. Added new class PosHoverColorMouseMotionAdapter to set a value in the hovered over JLabel in the JList that causes the PosToolbarDropdownItemRenderer to set the background color as the user moves the mouse from one selection to another so the user has visual confirmation of which item in the drop down will be seleced if clicked there. 4. If System.getProperty("os.name") has "WIN" anywhere (could be any version of Windows), then at app startup time, set the LookAndFeel to com.sun.java.swing.plaf.windows.WindowsLookAndFeel" so that it doesn't default to the Metal Ocean Theme look and feel like it was doing before. Else, let the running JVM set it's default look and feel (for when this app is run on a non Windows platform like a Macintosh, Unix, Linux. 5. In the OpenPCLViewer class, changed the setPreferredSize on the status bar to be 1 line of text high instead of 2 lines of text for the status bar. Also, don't initially put the app name and version and description on the status bar at app startup time. 6. In the PosStatusBar class, added the method adjustCursorPixelLocationPanelSize() and called it from OpenPCLViewer to change the status bar height and the width of the right side subpanel in the status bar depending on the on the fly font height and width calculation when the user changes the LookAndFeel, changed the lowered bevel look of the status bar to a non 3D looking line border so it won't remind people of the old school Windows 3.1 days. 7. Fixed problem where printers that don't do 300 dpi but do 600 dpi were printing the page image 1/2 the size width and height, making the page image be on the upper left corner of the paper. Now the page image prints at the right size no matter if the printer's max resolution is 300 dpi or is a printer that doesn't have 300 dpi but has 600 or 1200 dpi, buy not setting any particular printer resolution by commenting out the line: mPrintRequestAttributeSet.add(new PrinterResolution(300, 300, ResolutionSyntax.DPI));, and specifying mPrintRequestAttributeSet.add(PrintQuality.HIGH) instead of mPrintRequestAttributeSet.add(PrintQuality.DRAFT). 7. Added 3 lines of code to fix bug 1790142 "Does not render", submitted By: David Hill of www.davesplanet.net, where if the horizontal cpi pitch is 0 in the PCL command "ESC ( s 0 h" in an input PCL file, that would cause the PCL parsing to stop. Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 August 17, 2007<br> +Version 0.08 September 7, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 August 17, 2007 +<br>Version 0.08 September 7, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-08 00:53:51 UTC (rev 167) @@ -151,7 +151,7 @@ // Instance variables protected String mAppName = "OpenPCL Viewer"; protected String mAppDescription = " - Free Open Source PCL Viewer for the World"; - protected String mAppVersion = "Version 0.08 August 17, 2007"; + protected String mAppVersion = "Version 0.08 September 7, 2007"; private Frame mParentFrame = null; private JApplet mJApplet = null; Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 August 17, 2007<br> +Version 0.08 September 7, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 August 17, 2007 +<br>Version 0.08 September 7, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-14 04:34:17
|
Revision: 171 http://openpcl.svn.sourceforge.net/openpcl/?rev=171&view=rev Author: documentsystems Date: 2007-09-13 21:34:18 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Howard Hoagland. Made changes to 4 classes (PclRenderImage, PriDrawText, OpenPCLViewer, IPluginHooksOpenPCL) to implement this new feature: If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-14 04:34:18 UTC (rev 171) @@ -96,6 +96,9 @@ protected boolean mIsStateBuildingPclPages = true; protected boolean mWantToCenterCharInCharCellBox = true; + // For showing/hiding hidden tags + protected String mShowHideTagBaseString = null; + /** Constructor. There are no callback methods, only call into methods that can return an object value */ public PclRenderImage() { mBufferedImageToDrawOn = createNewBufferedImageToDrawOn(); @@ -143,6 +146,7 @@ public boolean getIsDrawingForPrinting() { return mIsDrawingForPrinting; } public boolean getIsStateBuildingPclPages() { return mIsStateBuildingPclPages; } public boolean getWantToCenterCharInCharCellBox() { return mWantToCenterCharInCharCellBox; } + public String getShowHideTagBaseString() { return mShowHideTagBaseString; } public String getFileNameNoPath() { return mFileNameNoPath; } public String getFullFilePathAndName() { return mFullFilePathAndName; } @@ -153,6 +157,8 @@ mIsDrawingForPrinting = pIsDrawingForPrinting; } public void setWantToCenterCharInCharCellBox(boolean pWantToCenterCharInCharCellBox) { mWantToCenterCharInCharCellBox = pWantToCenterCharInCharCellBox; } + public void setShowHideTagBaseString(String pShowHideTagBaseString) { + mShowHideTagBaseString = pShowHideTagBaseString; } public void setCurrentZoomFactor(double pCurrentZoomFactor) { mCurrentZoomFactor = pCurrentZoomFactor; } protected void handleFormFeedFound(int pBufferPos) { Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2007-09-14 04:34:18 UTC (rev 171) @@ -1,6 +1,7 @@ package com.openpcl.pclrenderimage.render; import java.awt.Color; +import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.font.TextLayout; import java.awt.geom.Rectangle2D; @@ -34,7 +35,13 @@ protected PriFontBase mPriFontBase = null; protected PriBitmapFont mPriBitmapFont = null; protected PriBitmapCharacter mPriBitmapCharacter = null; - + private char[] mBufferUpChars = null; + private static final int mBufferedUpMax = 1000; + private int mBufferUpIndex = -1; + private int mBufferUpXpos = 0; + private int mBufferUpYpos = 0; + private Color mDarkGreenColor = new Color(0,120,0); + /**Constructor * @param pPclRenderImage * @param pGraphics2D @@ -43,7 +50,9 @@ super(); mPclRenderImage = pPclRenderImage; mGraphics2D = pGraphics2D; - + // Non auto expanding byte array for execution speed. 1000 chars is way enough for all the chars that can fit on one line. + mBufferUpChars = new char[mBufferedUpMax]; + // if (mPclRenderImage == null) { // PriDebug.error("Missing reference to PclRenderImage in PriDrawText constructor.", // new InvalidParameterException()); @@ -354,6 +363,25 @@ mPclRenderImage.getPriCursorPos().getYpos()); } + // Buffer up the chars to draw hidden tag text in black instead of white + if (mBufferUpIndex < 0) { + // Upon the first char of the buffered up string, save the current X,Y point + mBufferUpXpos = mPclRenderImage.getPriCursorPos().getXpos(); + mBufferUpYpos = mPclRenderImage.getPriCursorPos().getYpos(); + // First char of String of chars starts at index 0 + mBufferUpIndex = 0; + } else { + // This isn't the very first char in the string, so just bump the index into the byte array here + mBufferUpIndex++; + } + + // If already reached the max size of the non growing char array, then stop drawing any more chars. + // This shouldn't happen because there's no way to get more than "mBufferedUpMax" chars on a print line anyways. + if (mBufferUpIndex < mBufferedUpMax) { + // Buffer up the chars into a char array + mBufferUpChars[mBufferUpIndex] = afterSubstitutionsCharToDraw; + } + // Alternate way to draw the character through TextLayout reference, // but the Graphics2D.drawString() works Ok too. // The below is if a visual comparison is wanted to see if one or the other is visually better @@ -373,12 +401,41 @@ } /** Draw buffered up chars as one String. + * Overridden methods in a subclass of this class will have code to buffer up viewable text, and write out the text + * as one write operation to save space in it's output stream. For example, a subclass plugin that has this method + * can "save to a PDF file" by using the itext.jar classes. The output .PDF file will be much bigger if chars are written + * to the PDF file one at a time compared to one write operation for the string of chars.<br> + * <br> + * PclRenderImage uses the internal printer font character width tables, so for printing, chars drawn one at a time + * outside of this method. However, code in this method here is for viewing only, and not printing.<br> + * <br> + * If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings + * on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. + * <br> * Subclass plugins override this method so do not delete or rename this method. */ public void drawBufferedUpCharsAs1String() { - // Just return here with no code to execute because overridden methods in a subclass of this class will have code in the - // overridden method. Subclass plugins override this method so do not delete or rename this method. - // Since PclRenderImage uses the internal printer font character width tables, then no code is needed here. - return; + // If there are no characters buffered up to draw, then return here + if (mBufferUpIndex < 0) { return; } + + // Get the String of several chars to draw + String tDrawCharsAsString = String.valueOf(mBufferUpChars, 0, mBufferUpIndex + 1); + + // Re-draw string only if the string starts with the currently set hidden tag base string + if ( (mPclRenderImage.getShowHideTagBaseString() != null) && + (tDrawCharsAsString.toLowerCase().startsWith(mPclRenderImage.getShowHideTagBaseString().toLowerCase())) ) { + // Send the buffered up chars to be drawn as one String, not using the internal printer font character width tables + mGraphics2D.setPaint(mDarkGreenColor); + mGraphics2D.drawString(tDrawCharsAsString, mBufferUpXpos, mBufferUpYpos); + FontMetrics tFontMetrics = mGraphics2D.getFontMetrics(); + + mGraphics2D.drawRect(mBufferUpXpos, mBufferUpYpos - tFontMetrics.getAscent(), + tFontMetrics.stringWidth(tDrawCharsAsString), tFontMetrics.getHeight()); + + mGraphics2D.setPaint(Color.BLACK); + } + + // Reset the index into the char array to be no chars are in there now + mBufferUpIndex = -1; } } Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-14 04:34:18 UTC (rev 171) @@ -217,7 +217,10 @@ " Views is already open so can't open another one right now.\n" + "Close one or more views then try again."; - public static final String sNotSupportedAtThisTime = "Not supported at this time"; + public static final String sNotSupportedAtThisTime = "Not supported at this time"; + + // For showing/hiding hidden tags + private String[] mHiddenTagBaseArray = { "HIDDENTAG:"} ; // os.name property public static String sOsNameString = null; @@ -1077,7 +1080,7 @@ } } - /** Apply the selected LookAndFeel to the screen + /** Apply the selected LookAndFeel to the screen. * Subclass plugins override this method so do not delete or rename this method. */ public void applySelectedLookAndFeel() { SwingUtilities.updateComponentTreeUI(mParentFrame); @@ -1310,7 +1313,7 @@ return determineFileTypeByFileExtension(tExtensionOfFileName); } - /** Determine the file type by the file extension + /** Determine the file type by the file extension. * Subclass plugins override this method so do not delete or rename this method. */ public int determineFileTypeByFileExtension(String pExtensionOfFileName) { if (pExtensionOfFileName.equalsIgnoreCase(".PCL") || @@ -1435,7 +1438,7 @@ return false; } - /** Create a new view panel + /** Create a new view panel. * Subclass plugins override this method so do not delete or rename this method. */ public PosView createNewViewPanel(String pShortName) { return new PosView(this, pShortName); @@ -1549,13 +1552,13 @@ return tErrorString; } - /** Allow subclases to set their own icon + /** Allow subclases to set their own icon. * Subclass plugins override this method so do not delete or rename this method. */ public Icon getJInternalFrameIcon() { return (PosReadImageIcon.read("V221MultiDoc.png")); } - /** Allow subclases to set their own title + /** Allow subclases to set their own title. * Subclass plugins override this method so do not delete or rename this method. */ public String getJInternalFrameTitleBar(String defaultTitle) { return (defaultTitle); @@ -1993,7 +1996,7 @@ parseFileBytesIntoTreeNodes(tFileNameOnly, pFilePathAndFileName); } - /** Open the file on disk. Read and parse all bytes in the file into tree nodes + /** Open the file on disk. Read and parse all bytes in the file into tree nodes. * Subclass plugins override this method so do not delete or rename this method. */ public void parseFileBytesIntoTreeNodes(String pFileNameOnly, String pFilePathAndFileName) { if (mPosViewSelected.getFileType() == sFileTypePCL) { @@ -2448,8 +2451,18 @@ mPosUserOptionsDialog.setLocationRelativeTo(getAppFrame()); mPosUserOptionsDialog.setVisible(true); } else { - // Hidden feature. If the Control key is pressed when clicking this button, then toggle show/hide to see white text - // by redrawing the text in black, only if the text starts with the specified text. Also draw a box around the now visible txt. + // If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings + // on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. + if (mPosViewSelected == null) { return; } + + if (mPosViewSelected.getPclRenderImage().getShowHideTagBaseString() == null) { + // Toggle to show + mPosViewSelected.getPclRenderImage().setShowHideTagBaseString(getHiddenTagBaseString(1)); + } else { + mPosViewSelected.getPclRenderImage().setShowHideTagBaseString(null); + } + // Redraw the current page with the toggle show/hide tag base string + renderImageCurrentPageAndZoom(); } } @@ -2507,34 +2520,44 @@ return mParentFrame; } - /** Get the app name + /** Get the app name. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppName() { return mAppName; } - /** Get the app description + /** Get the app description. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppDescription() { return mAppDescription; } - /** Get the app version + /** Get the app version. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppVersion() { return mAppVersion; } - /** Get the package path to the license info .html file + /** Get the package path to the license info .html file. * Subclass plugins override this method so do not delete or rename this method. */ public String getPackagePathLicenseInfo() { return mPackagePathLicenseInfo; } - /** Get the package path to the help about .html file + /** Get the package path to the help about .html file. * Subclass plugins override this method so do not delete or rename this method. */ public String getPackageHelpAboutInfo() { return mPackagePathHelpAbout; } + + /** Get the hidden tag base String. + * Subclass plugins override this method so do not delete or rename this method. */ + public String getHiddenTagBaseString(int pTagIndex) { + if (mHiddenTagBaseArray == null || mHiddenTagBaseArray.length < pTagIndex) { + return null; + } else { + return mHiddenTagBaseArray[pTagIndex - 1]; + } + } } Modified: openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java 2007-09-14 04:34:18 UTC (rev 171) @@ -90,5 +90,7 @@ /** Allow subclases to set their own title */ public String getJInternalFrameTitleBar(String defaultTitle); - + + /** Get the hidden tag base String */ + public String getHiddenTagBaseString(int pTagIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-12-05 18:41:32
|
Revision: 202 http://openpcl.svn.sourceforge.net/openpcl/?rev=202&view=rev Author: documentsystems Date: 2007-12-05 10:41:29 -0800 (Wed, 05 Dec 2007) Log Message: ----------- 1. Removed the jdom.jar from IZPack copy files, and 2. Updated HelpAbout and License to app version 0.08 December 5, 2007 Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml openpcl/src/com/openpcl/install/localinstaller/openpclviewerembeddeddemo.sh openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-12-05 18:41:29 UTC (rev 202) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 September 7, 2007<br> +Version 0.08 December 5, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-12-05 18:41:29 UTC (rev 202) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 September 7, 2007 +<br>Version 0.08 December 5, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack-shortcut-win.xml 2007-12-05 18:41:29 UTC (rev 202) @@ -12,7 +12,7 @@ workingDirectory="$INSTALL_PATH\" commandLine="" iconFile="$INSTALL_PATH\openpclviewer.ico" - description="OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.06 March 28, 2007"> + description="OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.08 December 5, 2007"> <createForPack name="Core"/> </shortcut> <shortcut name="Uninstall OpenPCLViewer (local install)" Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewer-izpack.xml 2007-12-05 18:41:29 UTC (rev 202) @@ -2,7 +2,7 @@ <installation version="1.0"> <info> <appname>OpenPCLViewer</appname> - <appversion>OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.06 March 28, 2007</appversion> + <appversion>OpenPCL Viewer - Free Open Source PCL Viewer for the World. Version 0.08 December 5, 2007</appversion> <appsubpath>OpenPCLViewer</appsubpath> <url>http://www.openpcl.com</url> <authors> @@ -37,9 +37,7 @@ <file src="openpcl.zip" targetdir="$INSTALL_PATH"/> <!-- <file src="pclrenderimage.jar" targetdir="$INSTALL_PATH"/> - <file src="pclrenderimage.zip" targetdir="$INSTALL_PATH"/> --> - <file src="jdom.jar" targetdir="$INSTALL_PATH"/> <file src="TableLayout.jar" targetdir="$INSTALL_PATH"/> <!-- install dir --> <file src="../src/com/openpcl/install/localinstaller/installopenpclviewer.bat" targetdir="$INSTALL_PATH"/> Modified: openpcl/src/com/openpcl/install/localinstaller/openpclviewerembeddeddemo.sh =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/openpclviewerembeddeddemo.sh 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/install/localinstaller/openpclviewerembeddeddemo.sh 2007-12-05 18:41:29 UTC (rev 202) @@ -1 +1 @@ -javaw -Xms64m -Xmx512m -classpath ".:openpcl.jar:jdom.jar:TableLayout.jar" com.openpcl.viewer.OpenPCLViewer -EmbeddedDemo "%1" +javaw -Xms64m -Xmx512m -classpath ".:openpcl.jar:TableLayout.jar" com.openpcl.viewer.OpenPCLViewer -EmbeddedDemo "%1" Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-12-05 18:41:29 UTC (rev 202) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 September 7, 2007<br> +Version 0.08 December 5, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-12-05 05:32:17 UTC (rev 201) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-12-05 18:41:29 UTC (rev 202) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 September 7, 2007 +<br>Version 0.08 December 5, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |