From: <doc...@us...> - 2007-07-25 23:58:16
|
Revision: 122 http://openpcl.svn.sourceforge.net/openpcl/?rev=122&view=rev Author: documentsystems Date: 2007-07-25 16:58:18 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Howard Hoagland. In 3 files, changed the actionShowHideTree toolbar button to pass a boolean whether the user did a Ctrl-click and if the control key was down when the user clicked the toggle show hide the tree panel, then do the hidden feature action which draws an underline under each char that was bumped to the right or left to center each character in its char cell. A red underline means the char was bumped to the right to center it. A cyan color underline means the char was bumped to the left to center it. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/api/IOpenPCL.java openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-07-25 19:57:45 UTC (rev 121) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-07-25 23:58:18 UTC (rev 122) @@ -1505,6 +1505,9 @@ int tPageNumber = mPosViewSelected.getCurrentPageNumberSelected(); String tPaperSize = getPaperSizeForPage(tPageNumber); + // Save the (x,y) scrolled to point + Rectangle tScrollBarPosition = mPosViewSelected.getCurrentViewRectangle(); + // Show the "Updating Image" message on the currently selected PosView mPosViewSelected.showUpdatingImageVisualCue(); @@ -1524,6 +1527,9 @@ // Make the JTree panel scroll left all the way mPosViewSelected.getTreeJScrollPane().getHorizontalScrollBar().setValue(0); + // Scroll the view to where it was before updating the image + mPosViewSelected.scrollViewToPosition(tScrollBarPosition); + if (tBufferedImage == null) { // PclRenderImage returned null for the BufferedImage, so here return the last error string from the // currently selected PosView's PclRenderImage @@ -2066,14 +2072,25 @@ } /** Toggle show/hide the pages tree */ - public void actionShowHideTree() { - if (mPosViewSelected != null) { - if (mPosViewSelected.getIsTreePanelShowing()) { - actionHideTree(); + public void actionShowHideTree(boolean pControlKeyPressed) { + if (mPosViewSelected == null) { return; } + + if (!pControlKeyPressed) { + if (mPosViewSelected.getIsTreePanelShowing()) { + actionHideTree(); + } else { + actionShowTree(); + } + } else { - actionShowTree(); + // Hidden feature. If the Control key is pressed when clicking this button, then do the below + // that draws an underline under each char that was bumped to the right or left to center each character in its char cell. + // A red underline means the char was bumped to the right to center it. + // A cyan color underline means the char was bumped to the left to center it. + boolean tToggleCenterCharInCharCellBox = mPosViewSelected.getPclRenderImage().getWantToCenterCharInCharCellBox(); + mPosViewSelected.getPclRenderImage().setWantToCenterCharInCharCellBox(!tToggleCenterCharInCharCellBox); + renderImageCurrentPageAndZoom(); } - } } /** Show the pages tree */ Modified: openpcl/src/com/openpcl/viewer/api/IOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-07-25 19:57:45 UTC (rev 121) +++ openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-07-25 23:58:18 UTC (rev 122) @@ -194,7 +194,7 @@ public void actionNextPage(); /** Toggle show/hide the pages tree */ - public void actionShowHideTree(); + public void actionShowHideTree(boolean pControlKeyPressed); /** Show the pages tree */ public void actionShowTree(); Modified: openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-07-25 19:57:45 UTC (rev 121) +++ openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-07-25 23:58:18 UTC (rev 122) @@ -204,7 +204,13 @@ protected JButton createShowHideTreeButton() { JButton tJButton = createToolBarButton("TogglePane.gif", "Show/Hide Tree (Ctrl T)"); tJButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowHideTree();} + public void actionPerformed(ActionEvent e) { + if ((e.getModifiers() & ActionEvent.CTRL_MASK) > 1) { + mOpenPCLViewer.actionShowHideTree(true); + } else { + mOpenPCLViewer.actionShowHideTree(false); + } + } }); return tJButton; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |