diff options
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java | 22 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 12 |
2 files changed, 29 insertions, 5 deletions
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 ff708e93..988965b3 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 @@ -70,15 +70,16 @@ public class PositioningComposite extends StateComposite { private Composite mainArea = null; - private Label lblPage = null; + Label lblPage = null; + + ScrollBar scrollbar = null; + + private SignaturePosition position = null; int currentPage = 0; int numPages = 0; - private SignaturePosition position = null; - - ScrollBar scrollbar = null; /** * Create the composite. @@ -282,7 +283,7 @@ public class PositioningComposite extends StateComposite { PositioningComposite.this.scrollbar.setSelection( PositioningComposite.this.currentPage); PositioningComposite.this.lblPage.setText(String.format( - "Page %d of %d", + "Page %d of %d", //$NON-NLS-1$ PositioningComposite.this.currentPage, PositioningComposite.this.numPages)); } @@ -326,6 +327,17 @@ public class PositioningComposite extends StateComposite { } /** + * Set the signature position + * @param x the horizontal signature position + * @param y the vertical signature position + * @param page the page the signature is on + */ + public void setPosition(float x, float y, int page) { + showPage(page); + this.viewer.setSignaturePosition(x, y); + } + + /** * Get the signature position * @return the signature position */ 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 b7edb669..33afce4a 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 @@ -138,6 +138,7 @@ public class SignaturePanel extends JPanel { public void setSignaturePlaceholderBorderColor(Color color) { this.sigPlaceholderBorderColor = color; } + /** * Change the currently displayed page * @param page the number of the page to display @@ -157,6 +158,17 @@ public class SignaturePanel extends JPanel { } /** + * Set the signature placeholder position + * Call showPage afterwards to update actual position + * @param x the horizontal signature position + * @param y the vertical signature position + */ + public void setSignaturePosition(float x, float y) + { + this.sigPagePos = new Point2D.Double(x, y); + } + + /** * Get the current horizontal position of the signature * @return signature x coordinate */ |