From: <doc...@us...> - 2007-05-31 23:58:49
|
Revision: 76 http://openpcl.svn.sourceforge.net/openpcl/?rev=76&view=rev Author: documentsystems Date: 2007-05-31 16:58:49 -0700 (Thu, 31 May 2007) Log Message: ----------- Howrard Hoagland. 1. In the event listeners for the right click tree node pop up menu, added a call to the same code that the toolbar executes to do Print All/Selected/Remaining. 2. Added 5 methods and event handling code in PosTree for vmTree to get and clear the right clicked TreePath and node object. 3. Fixed a the bug where View Selected didn't view if one of the 3 prints were clicked on before that. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/api/IPluginHooksPosTree.java openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java openpcl/src/com/openpcl/viewer/tree/PosTree.java Modified: openpcl/src/com/openpcl/viewer/api/IPluginHooksPosTree.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IPluginHooksPosTree.java 2007-05-30 22:57:59 UTC (rev 75) +++ openpcl/src/com/openpcl/viewer/api/IPluginHooksPosTree.java 2007-05-31 23:58:49 UTC (rev 76) @@ -1,7 +1,10 @@ package com.openpcl.viewer.api; import javax.swing.JPopupMenu; +import javax.swing.tree.TreePath; +import com.openpcl.viewer.tree.PosTreeNode; + /** * The methods in this interface are designed to be overridden by a subclass of PosTree * that is a plugin that adds additional features. @@ -12,8 +15,23 @@ * @author DocMagic, Document Systems Inc, HowardH. 5/29/07 */ public interface IPluginHooksPosTree { - /** - * Build the JPopupMenu to show when the user right clicks on tree nodes.<br> + + /** Get the left clicked PosTreeNode. */ + public PosTreeNode getClickedNode(); + + /** Get the right clicked PosTreeNode. */ + public PosTreeNode getRightClickedNode(); + + /** Get the right clicked TreePath. */ + public TreePath getRightClickedTreePath(); + + /** Clear the right clicked PosTreeNode. */ + public void clearRightClickedNode(); + + /** Clear the right clicked TreePath. */ + public void clearRightClickedTreePath(); + + /** Build the JPopupMenu to show when the user right clicks on tree nodes.<br> * The items on this popup menu are in the String array mTreePopupMenuItems. */ public void buildTreePopupMenu(JPopupMenu pJPopupMenu); } Modified: openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java 2007-05-30 22:57:59 UTC (rev 75) +++ openpcl/src/com/openpcl/viewer/options/PosUserOptionsDialog.java 2007-05-31 23:58:49 UTC (rev 76) @@ -12,7 +12,6 @@ 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; @@ -28,7 +27,6 @@ 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 { Modified: openpcl/src/com/openpcl/viewer/tree/PosTree.java =================================================================== --- openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-05-30 22:57:59 UTC (rev 75) +++ openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-05-31 23:58:49 UTC (rev 76) @@ -38,8 +38,8 @@ private JTree mPagesJTree = null; private TreePath mLastSelectedTreePath = null; private PosTreeNode mClickedNode = null; - protected TreePath mRightClickedTreePath = null; - protected PosTreeNode mRightClickedNode = null; + private TreePath mRightClickedTreePath = null; + private PosTreeNode mRightClickedNode = null; private DefaultMutableTreeNode mTreeNodeRoot = null; private String mRootNodeName = null; private static String[] sTreePopupMenuItems = new String[] { @@ -115,8 +115,27 @@ } public TreePath getLastSelectedTreePath() { return mLastSelectedTreePath; } + + /** Get the left clicked PosTreeNode.<br> + * Subclass plugins override this method so do not delete or rename this method. */ public PosTreeNode getClickedNode() { return mClickedNode; } + /** Get the right clicked PosTreeNode.<br> + * Subclass plugins override this method so do not delete or rename this method. */ + public PosTreeNode getRightClickedNode() { return mRightClickedNode; } + + /** Get the right clicked TreePath.<br> + * Subclass plugins override this method so do not delete or rename this method. */ + public TreePath getRightClickedTreePath() { return mRightClickedTreePath; } + + /** Clear the right clicked PosTreeNode.<br> + * Subclass plugins override this method so do not delete or rename this method. */ + public void clearRightClickedNode() { mRightClickedNode = null; } + + /** Clear the right clicked TreePath.<br> + * Subclass plugins override this method so do not delete or rename this method. */ + public void clearRightClickedTreePath() { mRightClickedTreePath = null; } + public void setLastSelectedTreePath(TreePath pLastSelectedTreePath) { mLastSelectedTreePath = pLastSelectedTreePath; } public void setClickedNode(PosTreeNode pClickedNode) { mClickedNode = pClickedNode; } @@ -431,7 +450,9 @@ tJMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent pE) { // The user clicked "Print All" on the popup menu. - System.out.println("To do: Handle Print All"); + mPosView.getOpenPCLViewer().actionPrintAll(); + mRightClickedNode = null; + mRightClickedTreePath = null; }}); pJPopupMenu.add(tJMenuItem); @@ -439,7 +460,9 @@ tJMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent pE) { // The user clicked "Print Selected" on the popup menu. - System.out.println("To do: Handle Print Selected"); + mPosView.getOpenPCLViewer().actionPrintSelected(); + mRightClickedNode = null; + mRightClickedTreePath = null; }}); pJPopupMenu.add(tJMenuItem); @@ -447,7 +470,9 @@ tJMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent pE) { // The user clicked "Print Remaining" on the popup menu. - System.out.println("To do: Handle Print Remaining"); + mPosView.getOpenPCLViewer().actionPrintRemaining(); + mRightClickedNode = null; + mRightClickedTreePath = null; }}); pJPopupMenu.add(tJMenuItem); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |