From: <doc...@us...> - 2007-05-18 01:55:14
|
Revision: 72 http://openpcl.svn.sourceforge.net/openpcl/?rev=72&view=rev Author: documentsystems Date: 2007-05-17 18:55:15 -0700 (Thu, 17 May 2007) Log Message: ----------- Howard-H. 3 changes: 1. Added Hover Help to screen items that shows the text string of the item, and optionally starts with "Not implemented:" if that item isn't implemented yet. 2. Fixed bug where clicking the D, S, M, L buttons to change the font and overall dialog size, changed the height OK but failed to change the overall dialog width. 3. Changed the group panel border color from blue to etched border. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-05-16 02:21:13 UTC (rev 71) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-05-18 01:55:15 UTC (rev 72) @@ -144,6 +144,11 @@ private ListOfPrintersSelectionListener mListOfPrintersSelectionListener = new ListOfPrintersSelectionListener(); private JScrollPane mListOfPrintersJScrollPane = null; + // Strings + private static final String sNotImplementedString = "Not implemented: "; + private static final String sBarCodeHoverString = + "Bar codes already in the PCL are printed, but bar codes are not generated on the fly."; + public PosPrintSetupDialog(PosView pPosView, String pTitleBarText, PosPrintSetupDialogChoices pPrintChoices, PrintRequestAttributeSet pAttributes, PrinterJob pPrinterJob, String pSelectedPageNumbers) throws HeadlessException { @@ -320,6 +325,7 @@ mTitledBorderFont = mTitledBorderSmallFont; adjustFontOnDialogItems(mAdjustToSmallFont); putPrintChoicesOnScreen(); + setHoverHelpOnItems(); // Make dialog box outer frame width and height exactly to be all item's preferred sizes pack(); @@ -544,15 +550,21 @@ makePanelTitledBorders(); for (JComponent jc : mItemsOnDialogBox) { if (jc != null) { + // Set the passed in Font on each of the items on the screen jc.setFont(pFont); - } + // Set the preferred size as the minimum size because Window.pack() makes the window smaller height wise + // but not width wise, so here correct for that problem + jc.setPreferredSize(jc.getMinimumSize()); + if (jc == mListOfPrintersJList) { + // Adjust the width and height of the list of printers using the current set font + mListOfPrintersJPanel.setMinimumSize(new Dimension(pFont.getSize() * 35, pFont.getSize() * 12)); + } + } } } private void makePanelTitledBorders() { mListOfPrintersJPanel.setBorder(generateTitledBorder("Installed Printers")); - mListOfPrintersJPanel.setPreferredSize(new Dimension( - mTitledBorderFont.getSize() * 30, mTitledBorderFont.getSize() * 12)); mPrintFormatJPanel.setBorder(generateTitledBorder("Print Format")); mPrintBarCodesJPanel.setBorder(generateTitledBorder("Print Bar Codes")); mPrintOrderJPanel.setBorder(generateTitledBorder("Print Order")); @@ -563,8 +575,8 @@ private TitledBorder generateTitledBorder(String title) { // Conditional execution based on startup option if (mPosStartupOptions.getShowDSMLPrintDialogButtons()) { - return BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLUE), title, TitledBorder.LEFT, - TitledBorder.TOP, mTitledBorderFont, Color.BLACK); + return(new TitledBorder(BorderFactory.createEtchedBorder(), title, + TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, mTitledBorderFont, Color.BLACK)); } else { // RobD 1/4/07. Updated Border To be consistent with DMO/LM Titles Borders return(new TitledBorder(BorderFactory.createEtchedBorder(), title, @@ -631,6 +643,22 @@ } } + private void setHoverHelpOnItems() { + mAddlCopiesJTextField.setToolTipText(sNotImplementedString + "Additional copies"); + mPrintFormatIsPclDirectJRadioButton.setToolTipText("Print PCL direct"); + mPrintFormatIsGdiDriverJRadioButton.setToolTipText("Print GDI driver"); + mPrintBarCodesYesJRadioButton.setToolTipText(sBarCodeHoverString); + mPrintBarCodesNoJRadioButton.setToolTipText(sBarCodeHoverString); + mPrintOrderAsDisplayedOrSelectedJRadioButton.setToolTipText("Print pages in the order shown in the tree"); + mPrintOrderLegalFirstThenLetterJRadioButton.setToolTipText(sNotImplementedString + "Print Legal first then Letter"); + mPrintOrderLetterFirstThenLegalJRadioButton.setToolTipText(sNotImplementedString + "Print Letter first then Legal"); + mPrintFormNamesYesJRadioButton.setToolTipText(sNotImplementedString + "Print form names"); + mPrintFormNamesNoJRadioButton.setToolTipText("Don't print form names"); + mDuplexYesJRadioButton.setToolTipText(sNotImplementedString + "Duplex pages"); + mDuplexNoJRadioButton.setToolTipText("Don't duplex pages"); + mPrintAllOnLegalSizeJCheckBox.setToolTipText(sNotImplementedString + "Print all on Legal size"); + } + public class DialogWindowListener implements WindowListener { public void windowOpened(WindowEvent e) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |