diff options
author | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-10-31 16:36:23 +0000 |
---|---|---|
committer | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-10-31 16:36:23 +0000 |
commit | ff2c2dc579a9d275d64358eca20cbc795ce519e0 (patch) | |
tree | 9e0e67fb085a1dd3a70b73ebd59c9faba1b5c5ab /trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java | |
parent | 2447b1d86aee2c0c279773890dcfe0f44486c6aa (diff) | |
download | pdf-over-ff2c2dc579a9d275d64358eca20cbc795ce519e0.tar.gz pdf-over-ff2c2dc579a9d275d64358eca20cbc795ce519e0.tar.bz2 pdf-over-ff2c2dc579a9d275d64358eca20cbc795ce519e0.zip |
+ added Signator Placeholder generation for PDF-AS:
check: SignatureParameter.getPlaceholder()
git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12670 3a0b52a2-8410-0410-bc02-ff6273a87459
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java')
-rw-r--r-- | trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java index 32b44a78..5c7af927 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java @@ -309,7 +309,7 @@ public abstract class MainBarButton extends Canvas { */ protected void paintText(PaintEvent e) { Point size = this.getSize(); - int height = size.y - 2; + int height = size.y; int width = size.x; @@ -351,9 +351,21 @@ public abstract class MainBarButton extends Canvas { e.gc.setForeground(current); } else { - int imgx = (width - height) / 2; - Image tmp = new Image(getDisplay(), this.image.getImageData()); - e.gc.drawImage(tmp, imgx, 0); + + //log.debug("Width: " + width + " Height: " + height); + + int w = 0; + Image tmp = null; + if(this.image.getImageData().width < width) { + tmp = new Image(getDisplay(), this.image.getImageData()); + w = (width - this.image.getImageData().width) / 2; + } else if(this.image.getImageData().width > width) { + tmp = new Image(getDisplay(), this.image.getImageData().scaledTo(width, width)); + } else { + tmp = new Image(getDisplay(), this.image.getImageData()); + } + + e.gc.drawImage(tmp, w, w); } } |