From 4a5cfff2bcaa517644f1719ee92fa52cb6173aeb Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:04:03 +0000 Subject: Set signature page git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@109 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../asit/pdfover/gui/composites/PositioningComposite.java | 2 +- .../java/at/asit/pdfover/gui/composites/SignaturePanel.java | 13 ++++++++++++- .../asit/pdfover/gui/workflow/states/PositioningState.java | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index d1309cf9..71e4149a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -182,7 +182,7 @@ public class PositioningComposite extends StateComposite { */ void setFinalPosition() { // TODO: check if this is the real position - this.position = new SignaturePosition(this.viewer.getSignaturePositionX(), this.viewer.getSignaturePositionY()); + this.position = new SignaturePosition(this.viewer.getSignaturePositionX(), this.viewer.getSignaturePositionY(), this.viewer.getCurrentPage()); PositioningComposite.this.state.updateStateMachine(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index f90b2591..4d3ba584 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -54,8 +54,10 @@ public class SignaturePanel extends JPanel { Image currentImage; /** The current PDFPage that was rendered into currentImage */ private PDFPage currentPage; - /** The current page number */ + /** The current transform from screen to page space */ AffineTransform currentXform; + /** The current page number */ + private int currentPageNr; /** The horizontal offset of the image from the left edge of the panel */ int offx; /** The vertical offset of the image from the top of the panel */ @@ -98,6 +100,7 @@ public class SignaturePanel extends JPanel { */ public void showPage(int page) { //sigPagePos = null; + this.currentPageNr = page; showPage(this.pdf.getPage(page)); } @@ -117,6 +120,14 @@ public class SignaturePanel extends JPanel { return (float) this.sigPagePos.getY(); } + /** + * return the currently displayed page + * @return current page number + */ + public int getCurrentPage() { + return this.currentPageNr; + } + /** * Stop the generation of any previous page, and draw the new one. * diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index 1837cdc7..e08a0f69 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -29,7 +29,6 @@ import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.signator.Emblem; import at.asit.pdfover.signator.FileNameEmblem; -import at.asit.pdfover.signator.SignatureException; import at.asit.pdfover.signator.SignatureParameter; /** -- cgit v1.2.3