From: <doc...@us...> - 2007-05-26 00:33:12
|
Revision: 74 http://openpcl.svn.sourceforge.net/openpcl/?rev=74&view=rev Author: documentsystems Date: 2007-05-25 17:33:13 -0700 (Fri, 25 May 2007) Log Message: ----------- Howard Hoagland. Added the options dialog, and a button on the toolbar to bring it up, and made the Printer Setup button on the options dialog bring up the Printer Setup dialog. Changed 6 source files and created the PosUserOptionsDialog and added the new icon Options.png. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/api/IOpenPCL.java openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java openpcl/src/com/openpcl/viewer/toolbar/PosManageToolBar.java openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java Added Paths: ----------- openpcl/src/com/openpcl/viewer/images/Options.png openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-05-26 00:33:13 UTC (rev 74) @@ -55,6 +55,7 @@ import com.openpcl.viewer.dialogs.PosZoomPopupDialog; import com.openpcl.viewer.jframe.PosSimpleJFrame; import com.openpcl.viewer.options.PosStartupOptions; +import com.openpcl.viewer.options.PosUserOptionsDialog; import com.openpcl.viewer.panels.PosChangeTheLookList; import com.openpcl.viewer.panels.PosHelpChoicesList; import com.openpcl.viewer.panels.PosPrintChoicesList; @@ -62,6 +63,7 @@ import com.openpcl.viewer.panels.PosWindowControlList; import com.openpcl.viewer.panels.PosZoomSlider; import com.openpcl.viewer.printing.PosPrintPages; +import com.openpcl.viewer.printing.PosPrintSetupDialogChoices; import com.openpcl.viewer.statusbar.PosStatusBar; import com.openpcl.viewer.toolbar.PosManageToolBar; import com.openpcl.viewer.toolbar.PosToolBar; @@ -166,6 +168,8 @@ private PosWindowControlList mPosWindowControlList = null; private PosHtmlViewerButtonChoicesDialog mHelpAboutDialog = null; private PosHtmlViewerButtonChoicesDialog mLicenseInfoDialog = null; + private PosUserOptionsDialog mPosUserOptionsDialog = null; + private PosPrintSetupDialogChoices mPosUserOptionsPosPrintSetupDialogChoices = null; private ComponentListener mFrameComponentListener = null; private String mFilePathAndFileName = "C:\\"; private Preferences mPackagePreferences = null; @@ -2240,6 +2244,19 @@ } } + /** Show the Options dialog */ + public void actionShowOptionsDialog() { + if (mPosUserOptionsDialog == null) { + mPosUserOptionsPosPrintSetupDialogChoices = new PosPrintSetupDialogChoices(); + } + mPosUserOptionsDialog = new PosUserOptionsDialog( + mPosUserOptionsPosPrintSetupDialogChoices, this, "Options Dialog", true); + mPosUserOptionsDialog.setLocationRelativeTo(getAppFrame()); + mPosUserOptionsDialog.setVisible(true); + + // TODO read the values that were set in the user options dialog and handle the different settings + } + /** Toggle show/hide the help choices popup */ public void actionShowHideHelpChoicesPopup() { if (mIsHelpChoicesListShowing) { Modified: openpcl/src/com/openpcl/viewer/api/IOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-05-26 00:33:13 UTC (rev 74) @@ -247,6 +247,9 @@ /** Cascade Windows */ public void actionCascadeWindows(); + /** Show the Options dialog */ + public void actionShowOptionsDialog(); + /** Toggle show/hide the print choices popup */ public void actionShowHideHelpChoicesPopup(); Added: openpcl/src/com/openpcl/viewer/images/Options.png =================================================================== (Binary files differ) Property changes on: openpcl/src/com/openpcl/viewer/images/Options.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java =================================================================== --- openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java 2007-05-26 00:33:13 UTC (rev 74) @@ -97,6 +97,7 @@ private boolean mShowSaveToPclToolbarButton = true; private boolean mShowChangeLookToolbarButton = true; private boolean mShowWindowControlToolbarButton = true; + private boolean mShowOptionsToolbarButton = true; private boolean mShowHelpChoicesToolbarButton = true; // Booleans other than toolbar related @@ -158,6 +159,7 @@ {s1 + "-ShowSaveToPclToolbarButton" + s2, "Show or hide the \"Save one page to Pcl file\" toolbar button.", "yes"}, {s1 + "-ShowChangeLookToolbarButton" + s2, "Show or hide the Change Look toolbar button.", "yes"}, {s1 + "-ShowWindowControlToolbarButton" + s2, "Show or hide the Window Control toolbar button.", "yes"}, + {s1 + "-ShowOptionsToolbarButton" + s2, "Show or hide the Options toolbar button.", "yes"}, {s1 + "-ShowHelpChoicesToolbarButton" + s2, "Show or hide the Help Choices toolbar button.", "yes"}, {"Debug and demo mode:", "", ""}, {s1 + "-ShowEmbeddedDemo" + s2, "Show the viewer embedded in an external demo app.", "no"}, @@ -224,6 +226,7 @@ mShowSaveToPclToolbarButton = false; mShowChangeLookToolbarButton = false; mShowWindowControlToolbarButton = false; + mShowOptionsToolbarButton = false; mShowHelpChoicesToolbarButton = false; } @@ -257,6 +260,8 @@ mShowChangeLookToolbarButton = argTrueFalse; } else if (commandLineArg.startsWith("-showwindowcontroltoolbarbutton")) { mShowWindowControlToolbarButton = argTrueFalse; + } else if (commandLineArg.startsWith("-showoptionstoolbarbutton")) { + mShowOptionsToolbarButton = argTrueFalse; } else if (commandLineArg.startsWith("-showhelpchoicestoolbarbutton")) { mShowHelpChoicesToolbarButton = argTrueFalse; @@ -315,6 +320,7 @@ public boolean getShowSaveToPclToolbarButton() { return mShowSaveToPclToolbarButton; } public boolean getShowChangeLookToolbarButton() { return mShowChangeLookToolbarButton; } public boolean getShowWindowControlToolbarButton() { return mShowWindowControlToolbarButton; } + public boolean getShowOptionsToolbarButton() { return mShowOptionsToolbarButton; } public boolean getShowHelpChoicesToolbarButton() { return mShowHelpChoicesToolbarButton; } // Getters for Booleans other than toolbar related @@ -370,6 +376,8 @@ mShowChangeLookToolbarButton = pShowChangeLookToolbarButton; } public void setShowWindowControlToolbarButton(boolean pShowWindowControlToolbarButton) { mShowWindowControlToolbarButton = pShowWindowControlToolbarButton; } + public void setShowOptionsToolbarButton(boolean pShowOptionsToolbarButton) { + mShowOptionsToolbarButton = pShowOptionsToolbarButton; } public void setShowHelpChoicesToolbarButton(boolean pShowHelpChoicesToolbarButton) { mShowHelpChoicesToolbarButton = pShowHelpChoicesToolbarButton; } Added: openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java (rev 0) +++ openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java 2007-05-26 00:33:13 UTC (rev 74) @@ -0,0 +1,421 @@ +package com.openpcl.viewer.options; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; + +import info.clearthought.layout.TableLayout; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JTextField; +import javax.swing.border.TitledBorder; + +import com.openpcl.viewer.OpenPCLViewer; +import com.openpcl.viewer.panels.PosView; +import com.openpcl.viewer.printing.PosPrintSetupDialogChoices; +import com.openpcl.viewer.printing.PosPrintSetupDialog.DialogWindowListener; +import com.openpcl.viewer.util.PosReadImageIcon; + +public class PosUserOptionsDialog extends JDialog { + private static final long serialVersionUID = 1L; + + // Hold constructor passed in parameters + private PosPrintSetupDialogChoices mPosPrintSetupDialogChoices = null; + private OpenPCLViewer mOpenPCLViewer = null; + private Frame mParentFrame = null; + + // Values for laying out panels, buttons, labels, textfields + private double mTloPref = TableLayout.PREFERRED; + private double mTloFill = TableLayout.FILL; + private double mTloHgap = 5; + private double mTloVgap = 5; + + // Fonts + private final Font mUseFont = getFont(); + private final float mFontPointSize = mUseFont.getSize2D(); + private final Font mTitledBorderFont = mUseFont.deriveFont(Font.BOLD, mFontPointSize + 2.0f); + + // Panels + private JPanel mOuterJPanel = null; + private JPanel mTopButtonsJPanel = null; + private JPanel mPrintingOptionsJPanel = null; + private JPanel mPrintingOptionsInsideTopJPanel = null; + private JPanel mPrintingOptionsInsideMiddleJPanel = null; + private JPanel mPrintingOptionsInsideBottomJPanel = null; + private JPanel mEMailJPanel = null; + private JPanel mScanningJPanel = null; + private JPanel mUpdatesJPanel = null; + private JPanel mBottomButtonsJPanel = null; + + // Names of Group Boxes + private String mPrintingGroupBoxString = "Printing"; + private String mEMailGroupBoxString = "EMail"; + private String mScanningGroupBoxString = "Scanning"; + 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 mPrinterSetupDefaultsJButton = new JButton("Printer Setup dialog"); + private JButton mEMailAdvancedSettingsJButton = new JButton("Advanced Settings for EMail"); + private JButton mScanningSetupJButton = new JButton("Scanning Setup"); + private JButton mCheckForUpdatesJButton = new JButton("Check for Updates Now"); + private JButton mOKJButton = new JButton("OK"); + private JButton mCancelJButton = new JButton("Cancel"); + + // Labels + private JLabel mCreateShortcutJLabel = new JLabel("Create shortcut on desktop"); + private JLabel mResgisterFileTypeJLabel = new JLabel("Register DSI file types with ViewMagic"); + private JLabel mWhenToShowPrinterSetupJLabel = new JLabel("When to show Printer Setup dialog"); + private JLabel mFormFillColorJLabel = new JLabel("Form's fill color (Courier text)"); + private JLabel mFooterForOriginalJLabel = new JLabel("Footer text for orginal: "); + private JLabel mFooterForFirstCopyJLabel = new JLabel("Footer text for first copy: "); + private JLabel mFooterForSecondCopyJLabel = new JLabel("Footer text for second copy: "); + private JLabel mFooterForThirdCopyJLabel = new JLabel("Footer text for third copy: "); + private JLabel mPclEscCodesJLabel = new JLabel("PCL Esc codes (used for manual tray switching)"); + private JLabel mLetterTrayJLabel = new JLabel("Letter tray: "); + private JLabel mLegalTrayJLabel = new JLabel("Legal tray: "); + private JLabel mEMailClientJLabel = new JLabel("EMail client: "); + private JLabel mScanningDescJLabel = new JLabel("For scanning the bar codes on a printed page."); + private JLabel mCheckForUpdatesEveryJLabel = new JLabel("Check for updates every "); + private JLabel mCheckForUpdatesDaysJLabel = new JLabel("days."); + private JLabel mDateLastUpdateCheckedJLabel = new JLabel("Date last checked: "); + private JLabel mFilledInDateLastCheckedJLabel = new JLabel("__/__/____"); + + // Text fields + private JTextField mFooterForOriginalJTextField = new JTextField(); + private JTextField mFooterForFirstCopyJTextField = new JTextField(); + private JTextField mFooterForSecondCopyJTextField = new JTextField(); + private JTextField mFooterForThirdCopyJTextField = new JTextField(); + private JTextField mLetterTrayJTextField = new JTextField(); + private JTextField mLegalTrayJTextField = new JTextField(); + + // Radio buttons + private JRadioButton mShowPrinterSetupEveryPrintJRadioButton = new JRadioButton("Every print"); + private JRadioButton mShowPrinterSetupFirstPrintOnlyJRadioButton = new JRadioButton("First print only"); + private JRadioButton mShowPrinterSetupFromOptionsDialogOnlyJRadioButton = new JRadioButton("Only clicking below button"); + private ButtonGroup mPrintSetupButtonGroup = new ButtonGroup(); + private JRadioButton mFormFillColorBlueJRadioButton = new JRadioButton("Blue"); + private JRadioButton mFormFillColorBlackJRadioButton = new JRadioButton("Black"); + private ButtonGroup mFormFillColorButtonGroup = new ButtonGroup(); + + // Check boxes + private JCheckBox mAntiAliasJCheckBox = new JCheckBox("Anti-alias image (highest quality)"); + + // ComboBoxes + private JComboBox mEMailClientJComboBox = new JComboBox(); + private JComboBox mCheckForUpdatesDaysJComboBox = new JComboBox(); + + // Strings + private static final String sNotImplementedString = "Not implemented: "; + + // Constructor + + public PosUserOptionsDialog(PosPrintSetupDialogChoices pPosPrintSetupDialogChoices, OpenPCLViewer pOpenPCLViewer, + String pTitleString, boolean pIsModal) { + + // Call JDialog superclass constructor passing the parent frame, title bar text, is modal + super(pOpenPCLViewer.getAppFrame(), pTitleString, pIsModal); + // Save the OpenPCLViewer + mOpenPCLViewer = pOpenPCLViewer; + // Save the parent Frame + mParentFrame = pOpenPCLViewer.getAppFrame(); + // Set the object that will hold the settings of the values from the dialog on the screen + mPosPrintSetupDialogChoices = pPosPrintSetupDialogChoices; + // Build the UI + buildUI(); + } + + private void buildUI() { + setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); + addWindowListener(new DialogWindowListener()); + + // Put the radio buttons in their button group so clicking one automatically unselects the other radio buttons + // that are in the same group + mPrintSetupButtonGroup.add(mShowPrinterSetupEveryPrintJRadioButton); + mPrintSetupButtonGroup.add(mShowPrinterSetupFirstPrintOnlyJRadioButton); + mPrintSetupButtonGroup.add(mShowPrinterSetupFromOptionsDialogOnlyJRadioButton); + mFormFillColorButtonGroup.add(mFormFillColorBlueJRadioButton); + mFormFillColorButtonGroup.add(mFormFillColorBlackJRadioButton); + + // Make the subpanels + mTopButtonsJPanel = makeTopButtonsJPanel(); + mPrintingOptionsInsideTopJPanel = makePrintingOptionsInsideTopJPanel(); + mPrintingOptionsInsideMiddleJPanel = makePrintingOptionsInsideMiddleJPanel(); + mPrintingOptionsInsideBottomJPanel = makePrintingOptionsInsideBottomJPanel(); + mPrintingOptionsJPanel = makePrintingOptionsJPanel(); + mEMailJPanel = makeEMailJPanel(); + mScanningJPanel = makeScanningJPanel(); + mUpdatesJPanel = makeUpdatesJPanel(); + mBottomButtonsJPanel = makeBottomButtonsJPanel(); + + // Make the outer panel + mOuterJPanel = makeOuterJPanel(); + + addActionListeners(); + makePanelTitledBorders(); + putOptionsOnScreen(); + setHoverHelpOnItems(); + setContentPane(mOuterJPanel); + pack(); + // setPreferredSize(new Dimension(200, 300)); + } + + private void addActionListeners() { + mPrinterSetupDefaultsJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + PosView tPosView = mOpenPCLViewer.getPosViewSelected(); + if (tPosView != null) { + tPosView.getPosPrintPages().showPrintDialog(); + } else { + JOptionPane.showMessageDialog(mParentFrame, "To show the Print Setup dialog, a file needs to be opened", + "To show the Print Setup dialog", + JOptionPane.WARNING_MESSAGE); + } + } + }); + + mOKJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + getOptionsFromScreen(); + mPosPrintSetupDialogChoices.setUserHitOk(true); + setVisible(false); + } + }); + + mCancelJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + mPosPrintSetupDialogChoices.setUserHitOk(false); + setVisible(false); + } + }); + } + + private void makePanelTitledBorders() { + mPrintingOptionsJPanel.setBorder(generateTitledBorder(mPrintingGroupBoxString)); + mEMailJPanel.setBorder(generateTitledBorder(mEMailGroupBoxString)); + mScanningJPanel.setBorder(generateTitledBorder(mScanningGroupBoxString)); + mUpdatesJPanel.setBorder(generateTitledBorder(mUpdatesGroupBoxString)); + } + + private TitledBorder generateTitledBorder(String title) { + return(new TitledBorder(BorderFactory.createEtchedBorder(), title, + TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, mTitledBorderFont, Color.BLACK)); + } + + private JPanel makeTopButtonsJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloHgap, mTloPref, mTloHgap, mTloPref, 20, mTloFill, mTloPref, mTloHgap, mTloPref, mTloHgap }, + { mTloPref, mTloVgap }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + mCreateShortcutJButton.setIconTextGap(0); + mCreateShortcutJButton.setPreferredSize(new Dimension(44, 44)); + mRegisterFileTypeJButton.setIconTextGap(0); + mRegisterFileTypeJButton.setPreferredSize(new Dimension(44, 44)); + tPanel.add(mCreateShortcutJButton, "1, 0"); + tPanel.add(mCreateShortcutJLabel, "3, 0"); + tPanel.add(mRegisterFileTypeJButton, "6, 0"); + tPanel.add(mResgisterFileTypeJLabel, "8, 0"); + return tPanel; + } + + private JPanel makePrintingOptionsInsideTopJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloPref, 40, mTloFill, mTloHgap }, + { mTloPref, mTloPref, mTloPref, mTloPref, mTloPref, 10 }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mWhenToShowPrinterSetupJLabel, "0, 0"); + tPanel.add(mShowPrinterSetupEveryPrintJRadioButton, "0, 1"); + tPanel.add(mShowPrinterSetupFirstPrintOnlyJRadioButton, "0, 2"); + tPanel.add(mShowPrinterSetupFromOptionsDialogOnlyJRadioButton, "0, 3"); + mPrinterSetupDefaultsJButton.setMaximumSize(mPrinterSetupDefaultsJButton.getPreferredSize()); + tPanel.add(mPrinterSetupDefaultsJButton, "0, 4"); + tPanel.add(mFormFillColorJLabel, "2, 0"); + tPanel.add(mFormFillColorBlueJRadioButton, "2, 1"); + tPanel.add(mFormFillColorBlackJRadioButton, "2, 2"); + tPanel.add(mAntiAliasJCheckBox, "2, 4"); + return tPanel; + } + + private JPanel makePrintingOptionsInsideMiddleJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloPref, mTloFill, mTloHgap }, + { mTloPref, 2, mTloPref, 2, mTloPref, 2, mTloPref, 10 }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mFooterForOriginalJLabel, "0, 0"); + tPanel.add(mFooterForOriginalJTextField, "1, 0"); + tPanel.add(mFooterForFirstCopyJLabel, "0, 2"); + tPanel.add(mFooterForFirstCopyJTextField, "1, 2"); + tPanel.add(mFooterForSecondCopyJLabel, "0, 4"); + tPanel.add(mFooterForSecondCopyJTextField, "1, 4"); + tPanel.add(mFooterForThirdCopyJLabel, "0, 6"); + tPanel.add(mFooterForThirdCopyJTextField, "1, 6"); + return tPanel; + } + + private JPanel makePrintingOptionsInsideBottomJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloPref, 160, mTloFill, mTloHgap }, + { mTloPref, 2, mTloPref, mTloVgap }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mLetterTrayJLabel, "0, 0"); + tPanel.add(mLetterTrayJTextField, "1, 0"); + tPanel.add(mLegalTrayJLabel, "0, 2"); + tPanel.add(mLegalTrayJTextField, "1, 2"); + return tPanel; + } + + private JPanel makePrintingOptionsJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] {{ mTloHgap, mTloFill }, { mTloPref, mTloPref, mTloPref, mTloPref }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mPrintingOptionsInsideTopJPanel, "1, 0"); + tPanel.add(mPrintingOptionsInsideMiddleJPanel, "1, 1"); + tPanel.add(mPclEscCodesJLabel, "1, 2"); + tPanel.add(mPrintingOptionsInsideBottomJPanel, "1, 3"); + return tPanel; + } + + private JPanel makeEMailJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloHgap, 260, mTloHgap, mTloFill, mTloPref, mTloHgap }, + { mTloPref, mTloVgap, mTloPref, mTloVgap }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mEMailClientJLabel, "1, 0"); + tPanel.add(mEMailClientJComboBox, "1, 2"); + tPanel.add(mEMailAdvancedSettingsJButton, "4, 2"); + return tPanel; + } + + private JPanel makeScanningJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloHgap, mTloPref, mTloHgap, mTloFill, mTloPref, mTloHgap }, + { mTloPref, mTloVgap }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mScanningDescJLabel, "1, 0"); + tPanel.add(mScanningSetupJButton, "4, 0"); + return tPanel; + } + + private JPanel makeUpdatesJPanel() { + JPanel tPanel = new JPanel(); + double tloGridSpec[][] = new double[][] { + { mTloHgap, mTloPref, mTloHgap, 80, mTloHgap, mTloPref, mTloFill, mTloHgap, mTloPref, mTloHgap }, + { mTloPref, mTloVgap, mTloPref, mTloVgap }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mCheckForUpdatesEveryJLabel, "1, 0"); + tPanel.add(mCheckForUpdatesDaysJComboBox, "3, 0"); + tPanel.add(mCheckForUpdatesDaysJLabel, "5, 0"); + tPanel.add(mCheckForUpdatesJButton, "8, 0"); + tPanel.add(mDateLastUpdateCheckedJLabel, "1, 2"); + tPanel.add(mFilledInDateLastCheckedJLabel, "3, 2"); + return tPanel; + } + + private JPanel makeBottomButtonsJPanel() { + JPanel tPanel = new JPanel(); + tPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + double tloGridSpec[][] = new double[][] {{ mTloFill, 80, 10, 80 }, { mTloPref }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mOKJButton, "1, 0"); + tPanel.add(mCancelJButton, "3, 0"); + return tPanel; + } + + private JPanel makeOuterJPanel() { + JPanel tPanel = new JPanel(); + tPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + double tloGridSpec[][] = new double[][] {{ mTloFill }, + { mTloPref, mTloVgap, mTloPref, mTloVgap, mTloPref, mTloVgap, mTloPref, mTloVgap, mTloPref, + mTloVgap, mTloFill, mTloPref }}; + tPanel.setLayout(new TableLayout(tloGridSpec)); + tPanel.add(mTopButtonsJPanel, "0, 0"); + tPanel.add(mPrintingOptionsJPanel, "0, 2"); + tPanel.add(mEMailJPanel, "0, 4"); + tPanel.add(mScanningJPanel, "0, 6"); + tPanel.add(mUpdatesJPanel, "0, 8"); + tPanel.add(mBottomButtonsJPanel, "0, 11"); + return tPanel; + } + + private void setHoverHelpOnItems() { + // Buttons + mCreateShortcutJButton.setToolTipText(sNotImplementedString + "Create shortcut on desktop"); + mRegisterFileTypeJButton.setToolTipText(sNotImplementedString + "Register DSI file types with ViewMagic"); + mPrinterSetupDefaultsJButton.setToolTipText("Printer Setup dialog"); + mEMailAdvancedSettingsJButton.setToolTipText(sNotImplementedString + "Advanced settings for EMail"); + mScanningSetupJButton.setToolTipText(sNotImplementedString + "Scanning setup"); + mCheckForUpdatesJButton.setToolTipText(sNotImplementedString + "Checking for updates"); + + // Text fields + mFooterForOriginalJTextField.setToolTipText(sNotImplementedString + "Footer for original"); + mFooterForFirstCopyJTextField.setToolTipText(sNotImplementedString + "Footer for first copy"); + mFooterForSecondCopyJTextField.setToolTipText(sNotImplementedString + "Footer for second copy"); + mFooterForThirdCopyJTextField.setToolTipText(sNotImplementedString + "Footer for third copy"); + mLetterTrayJTextField.setToolTipText(sNotImplementedString + "PCL Esc codes for Letter tray"); + mLegalTrayJTextField.setToolTipText(sNotImplementedString + "PCL Esc codes for Legal tray"); + + // Radio buttons + mShowPrinterSetupEveryPrintJRadioButton.setToolTipText(sNotImplementedString + "Every print"); + mShowPrinterSetupFirstPrintOnlyJRadioButton.setToolTipText(sNotImplementedString + "First print only"); + mShowPrinterSetupFromOptionsDialogOnlyJRadioButton.setToolTipText("Only clicking below button"); + mFormFillColorBlueJRadioButton.setToolTipText("Form's fill color Blue"); + mFormFillColorBlackJRadioButton.setToolTipText(sNotImplementedString + "Form's fill color Black (it's always blue)"); + + // Check boxes + mAntiAliasJCheckBox.setToolTipText("Anti-alias is always on and can't be turned off"); + + // Combo boxes + mEMailClientJComboBox.setToolTipText(sNotImplementedString + "Combo box of EMail clients"); + mCheckForUpdatesDaysJComboBox.setToolTipText(sNotImplementedString + "Doing updates from here"); + } + + private void getOptionsFromScreen() { + // TODO + } + + private void putOptionsOnScreen() { + // TODO + } + + public class DialogWindowListener implements WindowListener { + public void windowOpened(WindowEvent e) { + } + public void windowClosing(WindowEvent e) { + mPosPrintSetupDialogChoices.setUserHitOk(false); + setVisible(false); + } + public void windowClosed(WindowEvent e) { + } + public void windowIconified(WindowEvent e) { + } + public void windowDeiconified(WindowEvent e) { + } + public void windowActivated(WindowEvent e) { + } + public void windowDeactivated(WindowEvent e) { + } + } + +} Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-05-26 00:33:13 UTC (rev 74) @@ -398,8 +398,19 @@ } public boolean showPrintDialog() { + // Get a new PrinterJob using its static method mPrinterJob = PrinterJob.getPrinterJob(); - boolean userHitOk = mPrinterJob.printDialog(mAttributes); + + // Put up our custom printer setup dialog + mPosPrintSetupDialog = new PosPrintSetupDialog(mPosView, "Printer Setup", + 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.setVisible(true); + + boolean userHitOk = mPosPrintSetupDialogChoices.getDidUserHitOk(); + if (userHitOk) { return true; } else { Modified: openpcl/src/com/openpcl/viewer/toolbar/PosManageToolBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/toolbar/PosManageToolBar.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/toolbar/PosManageToolBar.java 2007-05-26 00:33:13 UTC (rev 74) @@ -35,6 +35,7 @@ private JButton mChangeTheLookButton = null; private JButton mCascadeWindowsButton = null; + private JButton mOptionsButton = null; private JButton mHelpButton = null; // Subclass plugins add their JButtons on the toolbar to this ArrayList to get grayed out along with the named JButtons here, @@ -63,7 +64,7 @@ mSaveOnePageToPclFileButton.setEnabled(false); // mChangeTheLookButton is not grayed out mCascadeWindowsButton.setEnabled(false); - + //mOptionsButton is not grayed out // mHelpButton is not grayed out mPosZoomSlider.setComponentsEnabled(false); @@ -99,7 +100,7 @@ mSaveOnePageToPclFileButton.setEnabled(true); // mChangeTheLookButton is not grayed out mCascadeWindowsButton.setEnabled(true); - + // mOptionsButton is not grayed out // mHelpButton is not grayed out mPosZoomSlider.setComponentsEnabled(true); @@ -131,6 +132,7 @@ public JButton getCascadeWindowsButton() {return mCascadeWindowsButton;} + public JButton getOptionsButton() { return mOptionsButton; } public JButton getHelpButton() {return mHelpButton;} // Setters @@ -159,6 +161,8 @@ public void setCascadeWindowsButton(JButton pCascadeWindowsButton) { mCascadeWindowsButton = pCascadeWindowsButton;} + public void setOptionsButton(JButton pOptionsButton) { + mOptionsButton = pOptionsButton; } public void setHelpAboutButton(JButton pHelpButton) { mHelpButton = pHelpButton;} Modified: openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-05-23 04:27:08 UTC (rev 73) +++ openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-05-26 00:33:13 UTC (rev 74) @@ -123,6 +123,10 @@ if (mPosStartupOptions.getShowWindowControlToolbarButton()) { mJToolBar.add(tJButton); } mPosManageToolBar.setCascadeWindowsButton(tJButton); + tJButton = createOptionsButton(); + if (mPosStartupOptions.getShowOptionsToolbarButton()) { mJToolBar.add(tJButton); } + mPosManageToolBar.setOptionsButton(tJButton); + tJButton = createHelpAboutButton(); if (mPosStartupOptions.getShowHelpChoicesToolbarButton()) { mJToolBar.add(tJButton); } mPosManageToolBar.setHelpAboutButton(tJButton); @@ -260,6 +264,15 @@ return tJButton; } + /** Options toolbar button */ + protected JButton createOptionsButton() { + JButton tJButton = createToolBarButton("Options.png", "Options"); + tJButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowOptionsDialog();} + }); + return tJButton; + } + /** Help About toolbar button */ protected JButton createHelpAboutButton() { JButton tJButton = createToolBarButton("HelpAbout.jpg", "Help Choices (License Info and About)"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |