summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:01:09 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:01:09 +0000
commit01f6e6d262fbc0be426e72e047d255399002e335 (patch)
treec936d58b38ab8eb549e43f2270bdeda3576b2f5b /pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls
parentfa1fe4e607377417b0e9c6483e734b599f7b6f8d (diff)
downloadmocca-01f6e6d262fbc0be426e72e047d255399002e335.tar.gz
mocca-01f6e6d262fbc0be426e72e047d255399002e335.tar.bz2
mocca-01f6e6d262fbc0be426e72e047d255399002e335.zip
+ added Signator Placeholder generation for PDF-AS:
check: SignatureParameter.getPlaceholder() git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@84 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
index 32b44a78..5c7af927 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
+++ b/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);
}
}