From: <doc...@us...> - 2007-06-21 18:43:39
|
Revision: 91 http://openpcl.svn.sourceforge.net/openpcl/?rev=91&view=rev Author: documentsystems Date: 2007-06-21 11:43:40 -0700 (Thu, 21 Jun 2007) Log Message: ----------- Howard Hoagland. On the Printer Setup dialog, commented out the lines of code that added items on the screen that were not implemented yet, but I'll add them back on the Printer Setup dialog after I implement them later: Print Bar Codes, Print Legal pages first then Letter pages, Print Letter pages first then Legal, force Duplex (front and back), Print Form Names, Print all on Legal paper even if Letter size. Moved the "Note that:" 3 items from the Printer Setup dialog to the hover help tooltip text. Changed the print mode check box from "Printer supports PCL (is an HP LaserJet XX)" changed to "Use Windows Print (recommended)". Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialogChoices.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-06-18 21:35:52 UTC (rev 90) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-06-21 18:43:40 UTC (rev 91) @@ -2,6 +2,7 @@ import info.clearthought.layout.TableLayout; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; @@ -65,6 +66,8 @@ private double mTloHgap = 5; private double mTloVgap = 5; private String mSelectedPageNumbers = null; + private JDialog mAdvancedOptionsJDialog = null; + private JButton mAdvancedOptionsOkJButton = null; // Adjust to fonts private final Font mAdjustToSmallFont = getFont(); @@ -137,9 +140,10 @@ private JButton mOKJButton = new JButton("OK"); private JButton mCancelJButton = new JButton("Cancel"); private JButton mOpenJDKPrintDialogJButton = new JButton("Open JDK Print Dialog"); + private JButton mAdvancedOptionsJButton = new JButton("Advanced Options"); // JCheckBoxes - private JCheckBox mIsPclPrinterJCheckBox = new JCheckBox("Printer supports PCL (is an HP LaserJet XX)"); + private JCheckBox mIsPclPrinterJCheckBox = new JCheckBox("Use Windows Print (recommended)"); private JCheckBox mPrintAllOnLegalSizeJCheckBox = new JCheckBox("Print All Documents on Legal Size"); // JLists @@ -153,27 +157,20 @@ private static final String sBarCodeHoverString = "Bar codes already in the PCL are printed, but bar codes are not generated on the fly."; - private static final String sPrinterSupportsPclString = - "<html>Examples are:" + - "<ul>" + - "<li>HP LaserJet 1022" + - "<li>HP LaserJet P2015" + - "<li>HP LaserJet 2200" + - "<li>HP LaserJet 2400" + - "<li>HP LaserJet P3005" + - "<li>HP LaserJet 4050" + - "<li>HP LaserJet 4250" + - "<li>HP LaserJet 5000" + - "<li>HP LaserJet 5200" + - "<li>HP LaserJet 9040" + - "<li>HP LaserJet etc etc" + - "</ul></html>"; - private static final String sPrinterSupportsNotesString = - "Note that:\n" + - "1. If checked then pages print 3X faster but if not an HP LaserJet XX printer then printouts will not be correct.\n" + - "2. If pages print wrong then uncheck the box and try printing again.\n" + - "3. If the printer name doesn't say \"LaserJet\" even though it starts with \"HP\", then don't check the box."; + "<html><ul>" + + "<li>Windows print means the pages print correctly for all printers (is printer independent)." + + "<li>Unchecking the box requires that your printer be an HP LaserJet XX that supports PCL<br>" + + "and pages print 3 times faster than if checked, but if not an HP LaserJet XX printer<br>" + + "then printouts will not be correct." + + "<li>If pages print wrong then check the box and try printing again." + + "<li>If the printer name starts with \"HP\" but doesn't say \"LaserJet\", then check the box." + + "<li>Some examples of HP LaserJet printers (and you can uncheck the box) are:" + + "<table>" + + "<tr><td>HP LaserJet 1022,<td>HP LaserJet P2015,<td>HP LaserJet 2200,<td>HP LaserJet 2400,</tr>" + + "<tr><td>HP LaserJet P3005,<td>HP LaserJet 4050,<td>HP LaserJet 4250,<td>HP LaserJet 5000,</tr>" + + "<tr><td>HP LaserJet 5200,<td>HP LaserJet 9040,<td>HP LaserJet etc etc<td></tr>" + + "<table></ul></html>"; public PosPrintSetupDialog(PosView pPosView, String pTitleBarText, PosPrintSetupDialogChoices pPrintChoices, PrintRequestAttributeSet pAttributes, PrinterJob pPrinterJob, String pSelectedPageNumbers) @@ -181,6 +178,8 @@ super(pPosView.getOpenPCLViewer().getAppFrame(), pTitleBarText, true); mPosView = pPosView; mPosStartupOptions = mPosView.getOpenPCLViewer().getPosStartupOptions(); + // Set to false the show DSML buttons even if the user said true on the command line + mPosStartupOptions.setShowDSMLPrintDialogButtons(false); if (pPrintChoices == null) { mPrintChoices = new PosPrintSetupDialogChoices(); @@ -230,12 +229,12 @@ mTab1.setLayout(tloTab1Layout); mTab1.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); mTab1.add(mListOfPrintersJPanel, "0, 0, 2, 0"); - mTab1.add(mAddlCopiesJPanel, "0, 2, 2, 2"); +// mTab1.add(mAddlCopiesJPanel, "0, 2, 2, 2"); mTab1.add(mPrintAsPclJPanel, "0, 4, 2, 4"); - mTab1.add(mPrintBarCodesJPanel, "0, 6"); - mTab1.add(mPrintOrderJPanel, "2, 6"); - mTab1.add(mPrintFormNamesJPanel, "0, 8"); - mTab1.add(mDuplexJPanel, "2, 8"); +// mTab1.add(mPrintBarCodesJPanel, "0, 6"); +// mTab1.add(mPrintOrderJPanel, "2, 6"); +// mTab1.add(mPrintFormNamesJPanel, "0, 8"); +// mTab1.add(mDuplexJPanel, "2, 8"); // Lay out tab 2 items double tloTab2GridSpec[][] = new double[][] { @@ -247,11 +246,30 @@ mTab2.add(mPageNumbersThatWillPrintJLabel, "0, 0"); mPageNumbersThatWillPrintJTextArea.setLineWrap(true); mPageNumbersThatWillPrintJTextArea.setWrapStyleWord(true); - mPageNumbersThatWillPrintJTextArea.setText(mSelectedPageNumbers); + mPageNumbersThatWillPrintJTextArea.setText("Page numbers that will print:\n" + mSelectedPageNumbers); mPageNumbersThatWillPrintJTextArea.setEditable(false); + mPageNumbersThatWillPrintJTextArea.setPreferredSize(new Dimension(400, 200)); mPageNumbersThatWillPrintJScrollPane = new JScrollPane(mPageNumbersThatWillPrintJTextArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - mTab2.add(mPageNumbersThatWillPrintJScrollPane, "0, 2, 1, 2"); +// mTab2.add(mPageNumbersThatWillPrintJScrollPane, "0, 2, 1, 2"); + mAdvancedOptionsJDialog = new JDialog(mPosView.getOpenPCLViewer().getAppFrame(), "Advanced Options", true); + double tloAdvancedOptionsJDialog[][] = new double[][] { + { 10, mTloFill, mTloPref, 10}, // columns + { 10, mTloFill, 10, mTloPref, 10} // rows + }; + TableLayout tloAdvancedOptionsLayout = new TableLayout(tloAdvancedOptionsJDialog); + JPanel tJPanel = new JPanel(tloAdvancedOptionsLayout); + tJPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); + tJPanel.add("1, 1, 2, 1", mPageNumbersThatWillPrintJScrollPane); + mAdvancedOptionsOkJButton = new JButton("OK"); + mAdvancedOptionsOkJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent pE) { + mAdvancedOptionsJDialog.setVisible(false); + } + }); + tJPanel.add("2, 3", mAdvancedOptionsOkJButton); + mAdvancedOptionsJDialog.setContentPane(tJPanel); + mAdvancedOptionsJDialog.setSize(400, 280); // Lay out tab 3 items double tloTab3GridSpec[][] = new double[][] { @@ -264,9 +282,9 @@ mTab3.add(mOpenJDKPrintDialogJButton, "0, 0"); // Add the tab panels to the JTabbedPane - mJTabbedPane.add(mTab1, "View Specific"); - mJTabbedPane.add(mTab2, "Index Numbers That Will Print"); - mJTabbedPane.add(mTab3, "Generic Properties"); +// mJTabbedPane.add(mTab1, "View Specific"); +// mJTabbedPane.add(mTab2, "Index Numbers That Will Print"); +// mJTabbedPane.add(mTab3, "Generic Properties"); // Add the Control Panel, JTabbedPane, and buttons panel to the contentPane double tloContentPaneGridSpec[][] = new double[][] { @@ -277,7 +295,8 @@ mControlJPanel = makeControlPanel(); mBottomButtonsJPanel = makeBottomButtonsPanel(); add(mControlJPanel, "1, 1"); - add(mJTabbedPane, "1, 2"); +// add(mJTabbedPane, "1, 2"); + add(mTab1, "1, 2"); add(mBottomButtonsJPanel, "1, 4"); // ActionListeners @@ -329,6 +348,13 @@ } }); + mAdvancedOptionsJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + mAdvancedOptionsJDialog.setLocationRelativeTo(mPosView.getOpenPCLViewer().getAppFrame()); + mAdvancedOptionsJDialog.setVisible(true); + } + }); + mOKJButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { getPrintChoicesFromScreen(); @@ -409,7 +435,7 @@ TableLayout tloLayout = new TableLayout(tloGridSpec); panel.setLayout(tloLayout); panel.add(mIsPclPrinterJCheckBox," 1, 0, 2, 0"); - panel.add(mPrinterSupportsPclJScrollPane," 2, 1"); +// panel.add(mPrinterSupportsPclJScrollPane," 2, 1"); return panel; } @@ -489,7 +515,8 @@ mTloPref, mTloFill, mTloPref, mTloHgap, mTloPref}, { mTloPref }}; TableLayout tloLayout = new TableLayout(tloGridSpec); panel.setLayout(tloLayout); - panel.add(mPrintAllOnLegalSizeJCheckBox, "0, 0"); +// panel.add(mPrintAllOnLegalSizeJCheckBox, "0, 0"); + panel.add(mAdvancedOptionsJButton, "0, 0"); panel.add(mOKJButton, "2, 0"); panel.add(mCancelJButton, "4, 0"); return panel; @@ -497,7 +524,7 @@ private void putPrintChoicesOnScreen() { mAddlCopiesJTextField.setText(Integer.toString(mPrintChoices.getNumAdditionalCopies())); - mIsPclPrinterJCheckBox.setSelected(mPrintChoices.isPrintFormatPclDirect()); + mIsPclPrinterJCheckBox.setSelected(!(mPrintChoices.isPrintFormatPclDirect())); mPrintBarCodesYesJRadioButton.setSelected(mPrintChoices.shouldPrintBarCodes()); mPrintBarCodesNoJRadioButton.setSelected( !(mPrintChoices.shouldPrintBarCodes()) ); mPrintOrderAsDisplayedOrSelectedJRadioButton.setSelected(mPrintChoices.isPrintOrderAsDisplayedOrSelected()); @@ -525,9 +552,9 @@ // Print format if (mIsPclPrinterJCheckBox.isSelected()) { + mPrintChoices.setPrintFormatIsGdiDriver(); + } else { mPrintChoices.setPrintFormatIsPclDirect(); - } else { - mPrintChoices.setPrintFormatIsGdiDriver(); } // Print bar codes @@ -586,6 +613,8 @@ mItemsOnDialogBox.add(mOKJButton); mItemsOnDialogBox.add(mCancelJButton); mItemsOnDialogBox.add(mJTabbedPane); + mItemsOnDialogBox.add(mAdvancedOptionsOkJButton); + mItemsOnDialogBox.add(mAdvancedOptionsJButton); } private void adjustFontOnDialogItems(Font pFont) { @@ -607,7 +636,8 @@ private void makePanelTitledBorders() { mListOfPrintersJPanel.setBorder(generateTitledBorder("Installed Printers")); - mPrintAsPclJPanel.setBorder(generateTitledBorder("Printer Supports PCL ?")); +// mPrintAsPclJPanel.setBorder(generateTitledBorder("Printer Supports PCL ?")); + mPrintAsPclJPanel.setBorder(BorderFactory.createEmptyBorder()); mPrintBarCodesJPanel.setBorder(generateTitledBorder("Print Bar Codes")); mPrintOrderJPanel.setBorder(generateTitledBorder("Print Order")); mPrintFormNamesJPanel.setBorder(generateTitledBorder("Print Form Names")); @@ -687,8 +717,7 @@ private void setHoverHelpOnItems() { mAddlCopiesJTextField.setToolTipText(sNotImplementedString + "Additional copies"); - mIsPclPrinterJCheckBox.setToolTipText(sPrinterSupportsPclString); - mPrinterSupportsPclJTextArea.setToolTipText(sPrinterSupportsPclString); + mIsPclPrinterJCheckBox.setToolTipText(sPrinterSupportsNotesString); mPrintBarCodesYesJRadioButton.setToolTipText(sBarCodeHoverString); mPrintBarCodesNoJRadioButton.setToolTipText(sBarCodeHoverString); mPrintOrderAsDisplayedOrSelectedJRadioButton.setToolTipText("Print pages in the order shown in the tree"); Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialogChoices.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialogChoices.java 2007-06-18 21:35:52 UTC (rev 90) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialogChoices.java 2007-06-21 18:43:40 UTC (rev 91) @@ -18,7 +18,7 @@ // TODO Add code to take the defaults from the user options in the Preferences, instead of the below initializations private PrintService mSelectedPrintService = null; private int mNumAdditionalCopies = 0; - private int mPrintFormat = mPrintFormatIsPclDirect; + private int mPrintFormat = mPrintFormatIsGdiDriver; private boolean mShouldPrintBarCodes = false; private int mPrintOrder = mPrintOrderAsDisplayedOrSelected; private boolean mShouldPrintFormNames = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |