From: <doc...@us...> - 2007-06-04 23:42:36
|
Revision: 79 http://openpcl.svn.sourceforge.net/openpcl/?rev=79&view=rev Author: documentsystems Date: 2007-06-04 16:42:37 -0700 (Mon, 04 Jun 2007) Log Message: ----------- Howard Hoagland. 1. Re-draw node names on the tree because sometimes node names have ... and the last 5 to 10 chars chopped off. 2. Upon adding each node to the tree, set the PCL bytes paper size in the tree PosTreeNode. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/panels/PosView.java openpcl/src/com/openpcl/viewer/tree/PosTree.java openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-06-02 00:25:06 UTC (rev 78) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-06-04 23:42:37 UTC (rev 79) @@ -936,6 +936,8 @@ * Subclass plugins override this method so do not delete or rename this method. */ public void applySelectedLookAndFeel() { SwingUtilities.updateComponentTreeUI(mParentFrame); + // Re-draw node names on the tree because sometimes node names have ... and the last 5 to 10 chars chopped off + SwingUtilities.updateComponentTreeUI(mPosViewSelected.getPosTree().getPagesJTree()); SwingUtilities.updateComponentTreeUI(mPosPrintChoicesPopupDialog); SwingUtilities.updateComponentTreeUI(mPosZoomPopupDialog); SwingUtilities.updateComponentTreeUI(mPosChangeTheLookPopupDialog); @@ -1400,11 +1402,15 @@ for (int i = 0; i < tNumPages; i++) { // Add node to the tree for this viewable page. The page number is 1 based while the ArrayList is 0 based, so add 1 here - mPosViewSelected.getPosTree().makePclPageTreeNode(i + 1); + PosTreeNode tPosTreeNode =mPosViewSelected.getPosTree().makePclPageTreeNode(i + 1); + tPosTreeNode.setPaperSize(getPaperSizeForPage(i + 1)); } // Signal new view is shown so if it's the first view open then it ungrays out buttons in the toolbar mPosManageToolBar.setAViewIsOpen(); + + // Re-draw node names on the tree because sometimes node names have ... and the last 5 to 10 chars chopped off + SwingUtilities.updateComponentTreeUI(mPosViewSelected.getPosTree().getPagesJTree()); return null; // If no error then it returns a null String } Modified: openpcl/src/com/openpcl/viewer/panels/PosView.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosView.java 2007-06-02 00:25:06 UTC (rev 78) +++ openpcl/src/com/openpcl/viewer/panels/PosView.java 2007-06-04 23:42:37 UTC (rev 79) @@ -62,7 +62,7 @@ private MouseWheelListener[] mMouseWheelListeners = null; // Splitter divider default location - public static final int sDefaultSplitterLocPclFiles = 110; + public static final int sDefaultSplitterLocPclFiles = 150; public static final int sTreatSplitterAsClosedIfLessThan = 10; private int mPixelLocForSplitter = 0; Modified: openpcl/src/com/openpcl/viewer/tree/PosTree.java =================================================================== --- openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-06-02 00:25:06 UTC (rev 78) +++ openpcl/src/com/openpcl/viewer/tree/PosTree.java 2007-06-04 23:42:37 UTC (rev 79) @@ -16,6 +16,7 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JTree; +import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; @@ -196,8 +197,8 @@ * If a 1 page PCL file, then there will end up 1 node saying "Page 1". * else, if a multi page PCL file, then there will be several nodes saying "Page 1", then "Page 2", "Page 3" */ - public void makePclPageTreeNode(int pPageNumber) { - if (mPagesJTree == null) { return; } + public PosTreeNode makePclPageTreeNode(int pPageNumber) { + if (mPagesJTree == null) { return null; } // Put the PCL page as the user object in the tree node PosTreeNode tPosTreeNode = new PosTreeNode(null, pPageNumber, null); tPosTreeNode.setPclBytes(null); // If the Pcl bytes of this pages is needed later, they can be gotten later @@ -206,6 +207,7 @@ // Add to tree under the root node addChildNodeToTree(child, getTreeNodeRoot(), true); + return tPosTreeNode; } /** Modified: openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java =================================================================== --- openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java 2007-06-02 00:25:06 UTC (rev 78) +++ openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java 2007-06-04 23:42:37 UTC (rev 79) @@ -64,7 +64,13 @@ // toString() here is used to show on the screen the name of the node public String toString() { // This is a Pcl file page node - return mNodeName; + if (mRootNodeName == null) { + String tPaperSize = "Legal"; + if (getPaperSize().equalsIgnoreCase("LTR")) { tPaperSize = "Letter"; } + return mNodeName + " (" + tPaperSize + ")"; + } else { + return mNodeName; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |