From 53f7ac73fbb1810770cbf68eb87e3db165245e64 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 17 Oct 2012 18:19:45 +0200 Subject: Move izpack stuff to resources, add icons dir --- trunk/pdf-over-gui/pom.xml | 4 +- trunk/pdf-over-gui/src/main/izpack/install.xml | 68 ---------------------- .../src/main/izpack/unix_shortcutSpec.xml | 29 --------- .../src/main/izpack/win_shortcutSpec.xml | 29 --------- .../src/main/resources/icons/delete_me | 0 .../src/main/resources/izpack/install.xml | 68 ++++++++++++++++++++++ .../main/resources/izpack/unix_shortcutSpec.xml | 29 +++++++++ .../src/main/resources/izpack/win_shortcutSpec.xml | 29 +++++++++ .../src/main/resources/scripts/pdfover_linux.sh | 2 + .../src/main/resources/scripts/pdfover_mac.sh | 2 + .../src/main/resources/scripts/pdfover_win.bat | 1 + .../pdf-over-gui/src/main/scripts/pdfover_linux.sh | 2 - trunk/pdf-over-gui/src/main/scripts/pdfover_mac.sh | 2 - .../pdf-over-gui/src/main/scripts/pdfover_win.bat | 1 - 14 files changed, 133 insertions(+), 133 deletions(-) delete mode 100644 trunk/pdf-over-gui/src/main/izpack/install.xml delete mode 100644 trunk/pdf-over-gui/src/main/izpack/unix_shortcutSpec.xml delete mode 100644 trunk/pdf-over-gui/src/main/izpack/win_shortcutSpec.xml create mode 100644 trunk/pdf-over-gui/src/main/resources/icons/delete_me create mode 100644 trunk/pdf-over-gui/src/main/resources/izpack/install.xml create mode 100644 trunk/pdf-over-gui/src/main/resources/izpack/unix_shortcutSpec.xml create mode 100644 trunk/pdf-over-gui/src/main/resources/izpack/win_shortcutSpec.xml create mode 100644 trunk/pdf-over-gui/src/main/resources/scripts/pdfover_linux.sh create mode 100644 trunk/pdf-over-gui/src/main/resources/scripts/pdfover_mac.sh create mode 100644 trunk/pdf-over-gui/src/main/resources/scripts/pdfover_win.bat delete mode 100644 trunk/pdf-over-gui/src/main/scripts/pdfover_linux.sh delete mode 100644 trunk/pdf-over-gui/src/main/scripts/pdfover_mac.sh delete mode 100644 trunk/pdf-over-gui/src/main/scripts/pdfover_win.bat (limited to 'trunk') diff --git a/trunk/pdf-over-gui/pom.xml b/trunk/pdf-over-gui/pom.xml index 646493e4..d08d48ef 100644 --- a/trunk/pdf-over-gui/pom.xml +++ b/trunk/pdf-over-gui/pom.xml @@ -134,14 +134,14 @@ ${staging.dir} - src/main + src/main/resources scripts/* icons/* - src/main/izpack + src/main/resources/izpack diff --git a/trunk/pdf-over-gui/src/main/izpack/install.xml b/trunk/pdf-over-gui/src/main/izpack/install.xml deleted file mode 100644 index 002584ca..00000000 --- a/trunk/pdf-over-gui/src/main/izpack/install.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - PDFOver - 4.0 - - 1.6 - - - - - http://www.a-sit.at/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Main Installation - - - - - - - - - - \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/izpack/unix_shortcutSpec.xml b/trunk/pdf-over-gui/src/main/izpack/unix_shortcutSpec.xml deleted file mode 100644 index 05e8bee8..00000000 --- a/trunk/pdf-over-gui/src/main/izpack/unix_shortcutSpec.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/izpack/win_shortcutSpec.xml b/trunk/pdf-over-gui/src/main/izpack/win_shortcutSpec.xml deleted file mode 100644 index 8ad6666f..00000000 --- a/trunk/pdf-over-gui/src/main/izpack/win_shortcutSpec.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/icons/delete_me b/trunk/pdf-over-gui/src/main/resources/icons/delete_me new file mode 100644 index 00000000..e69de29b diff --git a/trunk/pdf-over-gui/src/main/resources/izpack/install.xml b/trunk/pdf-over-gui/src/main/resources/izpack/install.xml new file mode 100644 index 00000000..002584ca --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/izpack/install.xml @@ -0,0 +1,68 @@ + + + + + + PDFOver + 4.0 + + 1.6 + + + + + http://www.a-sit.at/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Main Installation + + + + + + + + + + \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/izpack/unix_shortcutSpec.xml b/trunk/pdf-over-gui/src/main/resources/izpack/unix_shortcutSpec.xml new file mode 100644 index 00000000..05e8bee8 --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/izpack/unix_shortcutSpec.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/izpack/win_shortcutSpec.xml b/trunk/pdf-over-gui/src/main/resources/izpack/win_shortcutSpec.xml new file mode 100644 index 00000000..8ad6666f --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/izpack/win_shortcutSpec.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_linux.sh b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_linux.sh new file mode 100644 index 00000000..b785db7c --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_linux.sh @@ -0,0 +1,2 @@ +#!/bin/sh +java -cp "lib/*" at.asit.pdfover.gui.Main \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_mac.sh b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_mac.sh new file mode 100644 index 00000000..b785db7c --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_mac.sh @@ -0,0 +1,2 @@ +#!/bin/sh +java -cp "lib/*" at.asit.pdfover.gui.Main \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_win.bat b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_win.bat new file mode 100644 index 00000000..222bd263 --- /dev/null +++ b/trunk/pdf-over-gui/src/main/resources/scripts/pdfover_win.bat @@ -0,0 +1 @@ +..\lib\pdf-over-gui-4.0.0-SNAPSHOT.jar %* \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/scripts/pdfover_linux.sh b/trunk/pdf-over-gui/src/main/scripts/pdfover_linux.sh deleted file mode 100644 index b785db7c..00000000 --- a/trunk/pdf-over-gui/src/main/scripts/pdfover_linux.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -java -cp "lib/*" at.asit.pdfover.gui.Main \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/scripts/pdfover_mac.sh b/trunk/pdf-over-gui/src/main/scripts/pdfover_mac.sh deleted file mode 100644 index b785db7c..00000000 --- a/trunk/pdf-over-gui/src/main/scripts/pdfover_mac.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -java -cp "lib/*" at.asit.pdfover.gui.Main \ No newline at end of file diff --git a/trunk/pdf-over-gui/src/main/scripts/pdfover_win.bat b/trunk/pdf-over-gui/src/main/scripts/pdfover_win.bat deleted file mode 100644 index 222bd263..00000000 --- a/trunk/pdf-over-gui/src/main/scripts/pdfover_win.bat +++ /dev/null @@ -1 +0,0 @@ -..\lib\pdf-over-gui-4.0.0-SNAPSHOT.jar %* \ No newline at end of file -- cgit v1.2.3 From 5fd76c5831e7e6f4c36119ec142fd1f0b3adcc4c Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 17 Oct 2012 18:20:56 +0200 Subject: Add commons-io (for FilenameUtils) --- trunk/pdf-over-gui/.classpath | 2 +- trunk/pdf-over-gui/pom.xml | 4 ++++ trunk/pom.xml | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/.classpath b/trunk/pdf-over-gui/.classpath index d2c19212..d53f6394 100644 --- a/trunk/pdf-over-gui/.classpath +++ b/trunk/pdf-over-gui/.classpath @@ -22,6 +22,7 @@ + @@ -32,6 +33,5 @@ - diff --git a/trunk/pdf-over-gui/pom.xml b/trunk/pdf-over-gui/pom.xml index d08d48ef..ef3b745e 100644 --- a/trunk/pdf-over-gui/pom.xml +++ b/trunk/pdf-over-gui/pom.xml @@ -40,6 +40,10 @@ commons-httpclient commons-httpclient + + commons-io + commons-io + org.icepdf icepdf-core diff --git a/trunk/pom.xml b/trunk/pom.xml index 579264fd..be9dfa9c 100644 --- a/trunk/pom.xml +++ b/trunk/pom.xml @@ -150,6 +150,11 @@ commons-httpclient 3.0 + + commons-io + commons-io + 2.4 + org.icepdf icepdf-core -- cgit v1.2.3 From 1b21c58a97db6be37186690a7e830dde1e6ad97e Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 18 Oct 2012 08:46:13 +0200 Subject: Set foreground color to black --- .../src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'trunk') 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 5ee261f1..a3e95e23 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 @@ -83,7 +83,8 @@ public abstract class MainBarButton extends Canvas { this.inactiveBackground = new Color(getDisplay(),0xD4, 0xE7, 0xF1); this.activeBackground1 = new Color(getDisplay(),0x6B, 0xA5, 0xD9); this.activeBackground = new Color(getDisplay(),0xB4, 0xCD, 0xEC); - this.textColor = this.getForeground(); + //this.textColor = this.getForeground(); + this.textColor = new Color(getDisplay(), 0x00, 0x00, 0x00); this.borderColor = new Color(getDisplay(), 0xf9, 0xf9, 0xf9); this.inactiveText = new Color(getDisplay(), 0x40, 0x40, 0x40); this.textsize = StateComposite.TEXT_SIZE_BUTTON; -- cgit v1.2.3 From edd77362bcc7592f749608bf34761fc6c7aa4d80 Mon Sep 17 00:00:00 2001 From: vkrnjic Date: Thu, 18 Oct 2012 13:29:28 +0200 Subject: pdf-over icon for 256 x 256 --- .../src/main/resources/img/pdf-over-icon.png | Bin 13796 -> 14903 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/resources/img/pdf-over-icon.png b/trunk/pdf-over-gui/src/main/resources/img/pdf-over-icon.png index ceffae90..d74070d4 100644 Binary files a/trunk/pdf-over-gui/src/main/resources/img/pdf-over-icon.png and b/trunk/pdf-over-gui/src/main/resources/img/pdf-over-icon.png differ -- cgit v1.2.3 From 3032162bb2d76b0b4ac5d2e8abe7f9731a0768e9 Mon Sep 17 00:00:00 2001 From: vkrnjic Date: Thu, 18 Oct 2012 15:59:44 +0200 Subject: 96x96 icon --- .../pdf-over-gui/src/main/resources/icons/icon96x96.png | Bin 0 -> 4091 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 trunk/pdf-over-gui/src/main/resources/icons/icon96x96.png (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/resources/icons/icon96x96.png b/trunk/pdf-over-gui/src/main/resources/icons/icon96x96.png new file mode 100644 index 00000000..e4a3df8a Binary files /dev/null and b/trunk/pdf-over-gui/src/main/resources/icons/icon96x96.png differ -- cgit v1.2.3 From d843a72193d30509157b9bd8a439cd975bfef8a0 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 23 Oct 2012 08:30:58 +0200 Subject: + Color changed for drop border, + removed pack in BKUSelectionComposite + using default background color as mainbar border color --- .../java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java | 3 ++- .../java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java | 2 +- .../src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java index c59d50f9..a7a1b6aa 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java @@ -41,6 +41,7 @@ import at.asit.pdfover.signator.BKUs; */ public class BKUSelectionComposite extends StateComposite { + public static final int btnMargin = 2; /** * Listener for local bku selection @@ -151,7 +152,7 @@ public class BKUSelectionComposite extends StateComposite { btn_card.setImage(karte); - this.pack(); + //this.pack(); } @Override diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java index dffa38e7..fd466897 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java @@ -142,7 +142,7 @@ public class DataSourceSelectComposite extends StateComposite { Rectangle clientArea = DataSourceSelectComposite.this .drop_area.getClientArea(); - e.gc.setForeground(new Color(getDisplay(), 0x7E, 0x9F, 0xA5)); + e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); e.gc.setLineStyle(SWT.LINE_DASH); e.gc.drawRoundRectangle(clientArea.x, clientArea.y, clientArea.width - 2, clientArea.height - 2, 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 a3e95e23..32b44a78 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 @@ -85,7 +85,8 @@ public abstract class MainBarButton extends Canvas { this.activeBackground = new Color(getDisplay(),0xB4, 0xCD, 0xEC); //this.textColor = this.getForeground(); this.textColor = new Color(getDisplay(), 0x00, 0x00, 0x00); - this.borderColor = new Color(getDisplay(), 0xf9, 0xf9, 0xf9); + //this.borderColor = new Color(getDisplay(), 0xf9, 0xf9, 0xf9); + this.borderColor = this.getBackground(); this.inactiveText = new Color(getDisplay(), 0x40, 0x40, 0x40); this.textsize = StateComposite.TEXT_SIZE_BUTTON; -- cgit v1.2.3 From b8ce94f8e7392124e7f0db6c2558dfda66ea6c22 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 23 Oct 2012 08:31:32 +0200 Subject: + try to fix mainbar repaint issue for windows platform --- .../main/java/at/asit/pdfover/gui/MainWindow.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index 2bf827b6..fb29ae9b 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java @@ -101,6 +101,8 @@ public class MainWindow { private FormData mainBarFormData; + private Composite mainbar; + /** * Default constructor * @@ -191,16 +193,16 @@ public class MainWindow { getShell().setLayout(new FormLayout()); - Composite composite = new Composite(getShell(), SWT.NONE); - composite.setLayout(new FormLayout()); + this.mainbar = new Composite(getShell(), SWT.NONE); + this.mainbar.setLayout(new FormLayout()); this.mainBarFormData = new FormData(); this.mainBarFormData.left = new FormAttachment(0, 10); this.mainBarFormData.right = new FormAttachment(100, -10); this.mainBarFormData.top = new FormAttachment(0, 10); this.mainBarFormData.bottom = new FormAttachment(0, 67); - composite.setLayoutData(this.mainBarFormData); + this.mainbar.setLayoutData(this.mainBarFormData); - this.btn_config = new MainBarRectangleButton(composite, SWT.NONE); + this.btn_config = new MainBarRectangleButton(this.mainbar, SWT.NONE); FormData fd_btn_config = new FormData(); fd_btn_config.bottom = new FormAttachment(100); fd_btn_config.right = new FormAttachment(0, 57); @@ -236,7 +238,7 @@ public class MainWindow { this.btn_config.setImage(new Image(Display.getDefault(), new ImageData( is))); - this.btn_open = new MainBarStartButton(composite, SWT.NONE); + this.btn_open = new MainBarStartButton(this.mainbar, SWT.NONE); FormData fd_btn_open = new FormData(); fd_btn_open.bottom = new FormAttachment(100); fd_btn_open.right = new FormAttachment(35, (MainBarButton.SplitFactor / 2)); @@ -265,7 +267,7 @@ public class MainWindow { }); this.buttonMap.put(Buttons.OPEN, this.btn_open); - this.btn_position = new MainBarMiddleButton(composite, SWT.NONE); + this.btn_position = new MainBarMiddleButton(this.mainbar, SWT.NONE); FormData fd_btn_position = new FormData(); fd_btn_position.bottom = new FormAttachment(100); fd_btn_position.right = new FormAttachment(60, (MainBarButton.SplitFactor / 2)); @@ -294,7 +296,7 @@ public class MainWindow { }); this.buttonMap.put(Buttons.POSITION, this.btn_position); - this.btn_sign = new MainBarMiddleButton(composite, SWT.NONE); + this.btn_sign = new MainBarMiddleButton(this.mainbar, SWT.NONE); FormData fd_btn_sign = new FormData(); fd_btn_sign.bottom = new FormAttachment(100); fd_btn_sign.right = new FormAttachment(85, (MainBarButton.SplitFactor / 2)); @@ -323,7 +325,7 @@ public class MainWindow { }); this.buttonMap.put(Buttons.SIGN, this.btn_sign); - MainBarEndButton end = new MainBarEndButton(composite, SWT.NONE); + MainBarEndButton end = new MainBarEndButton(this.mainbar, SWT.NONE); FormData fd_btn_end = new FormData(); fd_btn_end.bottom = new FormAttachment(100); fd_btn_end.right = new FormAttachment(100); @@ -371,6 +373,8 @@ public class MainWindow { } else { this.mainBarFormData.bottom = new FormAttachment(0, 0); } + + this.mainbar.redraw(); } /** -- cgit v1.2.3 From 86f1565d19616563bfa492a3f7ab56135a2f7d7f Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 23 Oct 2012 09:10:47 +0200 Subject: + fixed windows mainbar redraw issue --- trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index fb29ae9b..c8455d3f 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java @@ -205,7 +205,7 @@ public class MainWindow { this.btn_config = new MainBarRectangleButton(this.mainbar, SWT.NONE); FormData fd_btn_config = new FormData(); fd_btn_config.bottom = new FormAttachment(100); - fd_btn_config.right = new FormAttachment(0, 57); + fd_btn_config.right = new FormAttachment(0, 50); fd_btn_config.top = new FormAttachment(0); fd_btn_config.left = new FormAttachment(0); this.btn_config.setLayoutData(fd_btn_config); @@ -374,6 +374,8 @@ public class MainWindow { this.mainBarFormData.bottom = new FormAttachment(0, 0); } + this.getShell().getDisplay().update(); + this.mainbar.layout(true, true); this.mainbar.redraw(); } -- cgit v1.2.3 From e96e9dd6bcab614a60fa491ef68017bea4862af3 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 23 Oct 2012 15:46:53 +0200 Subject: + added Signator Placeholder generation for PDF-AS: check: SignatureParameter.getPlaceholder() --- .../asit/pdfover/gui/controls/MainBarButton.java | 20 +- .../pdfover/gui/workflow/states/OpenState.java | 8 +- .../asit/pdfover/signator/SignatureParameter.java | 9 + .../at/asit/pdfover/signer/pdfas/PDFASHelper.java | 4 + .../at/asit/pdfover/signer/pdfas/PDFASSigner.java | 56 ++-- .../signer/pdfas/PdfAsSignatureParameter.java | 343 ++++++++++++++++++++- 6 files changed, 405 insertions(+), 35 deletions(-) (limited to 'trunk') 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); } } diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index 08212c8f..a158d7ca 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -26,6 +26,9 @@ import at.asit.pdfover.gui.composites.DataSourceSelectComposite; import at.asit.pdfover.gui.workflow.ConfigProvider; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; +import at.asit.pdfover.signator.FileNameEmlbem; +import at.asit.pdfover.signator.SignatureException; +import at.asit.pdfover.signator.SignatureParameter; /** * Selects the data source for the signature process. @@ -58,6 +61,9 @@ public class OpenState extends State { @Override public void run() { + + + Status status = this.stateMachine.getStatus(); if (!(status.getPreviousState() instanceof PrepareConfigurationState) && !(status.getPreviousState() instanceof OpenState)) @@ -67,7 +73,7 @@ public class OpenState extends State { status.setDocument(null); status.setSignaturePosition(config.getDefaultSignaturePosition()); } - + if (status.getDocument() == null) { DataSourceSelectComposite selection = this .getSelectionComposite(); diff --git a/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java b/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java index e16656dd..8cc97f7e 100644 --- a/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java +++ b/trunk/pdf-over-signator/src/main/java/at/asit/pdfover/signator/SignatureParameter.java @@ -15,6 +15,8 @@ */ package at.asit.pdfover.signator; +import java.awt.Image; + //Imports /** @@ -121,6 +123,13 @@ public abstract class SignatureParameter { */ public abstract SignatureDimension getPlaceholderDimension(); + /** + * Gets the Dimension to display the Placeholder + * @return the placeholder dimensions + */ + public abstract Image getPlaceholder() throws SignatureException; + + /** * Gets the Emblem * @return the Emblem diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java index ee3cc7a9..2553eaad 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java @@ -50,6 +50,10 @@ public class PDFASHelper { return new at.gv.egiz.pdfas.impl.api.PdfAsObject(); } + public static String getWorkDir() { + return System.getProperty("user.home")+"/.pdfover"; + } + /** * Creates a PDF-AS Internal object * @return the PDF-AS Internal object diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java index 1b058553..91581a17 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java @@ -1,5 +1,11 @@ package at.asit.pdfover.signer.pdfas; +import java.util.Iterator; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.ByteArrayDocumentSource; import at.asit.pdfover.signator.SLResponse; @@ -19,12 +25,18 @@ import at.gv.egiz.pdfas.api.commons.Constants; import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.internal.LocalBKUParams; import at.gv.egiz.pdfas.api.internal.PdfAsInternal; +import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; /** * PDF AS Signer Implementation */ public class PDFASSigner implements Signer { + /** + * SFL4J Logger instance + **/ + static final Logger log = LoggerFactory.getLogger(PDFASSigner.class); + /** * The profile ID */ @@ -38,8 +50,9 @@ public class PDFASSigner implements Signer { /** * Location reference string */ - protected static final String LOC_REF = "" + URL_TEMPLATE + ""; - + protected static final String LOC_REF = "" + URL_TEMPLATE + + ""; + @Override public SigningState prepare(SignatureParameter parameter) throws SignatureException { @@ -60,12 +73,12 @@ public class PDFASSigner implements Signer { SignParameters params = new SignParameters(); params.setSignaturePositioning(sign_para.getPDFASPositioning()); - - if(parameter.getSignatureDevice() == BKUs.LOCAL) { + + if (parameter.getSignatureDevice() == BKUs.LOCAL) { params.setSignatureDevice(Constants.SIGNATURE_DEVICE_BKU); - } else if(parameter.getSignatureDevice() == BKUs.MOBILE) { + } else if (parameter.getSignatureDevice() == BKUs.MOBILE) { params.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOBILE); - //params.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOBILETEST); + // params.setSignatureDevice(Constants.SIGNATURE_DEVICE_MOBILETEST); } params.setSignatureType(Constants.SIGNATURE_TYPE_BINARY); params.setSignatureProfileId(PROFILE_ID); @@ -75,7 +88,7 @@ public class PDFASSigner implements Signer { params.setProfileOverrideValue("SIG_LABEL", parameter .getEmblem().getFileName()); } - + // Prepare Output sink state.setOutput(new ByteArrayDataSink()); params.setOutput(state.getOutput()); @@ -95,17 +108,18 @@ public class PDFASSigner implements Signer { String slRequest = pdfasInternal.prepareLocalSignRequest(params, false, URL_TEMPLATE, sdi); - at.gv.egiz.pdfas.api.io.DataSource sig_data = sdi.getSignatureData(); - - PDFASSLRequest request = new PDFASSLRequest(slRequest, sig_data.getAsByteArray()); + at.gv.egiz.pdfas.api.io.DataSource sig_data = sdi + .getSignatureData(); + + PDFASSLRequest request = new PDFASSLRequest(slRequest, + sig_data.getAsByteArray()); state.setSignatureRequest(request); return state; - } catch(PDFASSLRequestException e) { + } catch (PDFASSLRequestException e) { throw new SignatureException(e); - } - catch (PdfAsException e) { + } catch (PdfAsException e) { throw new SignatureException(e); } } @@ -130,13 +144,14 @@ public class PDFASSigner implements Signer { SignParameters params = sstate.getSignParameters(); - SignatureDetailInformation sdi = sstate .getSignatureDetailInformation(); SLResponse slResponse = sstate.getSignatureResponse(); - - LocalBKUParams bkuParams = new LocalBKUParams(slResponse.getServer(), slResponse.getUserAgent(), slResponse.getSignaturLayout()); + + LocalBKUParams bkuParams = new LocalBKUParams( + slResponse.getServer(), slResponse.getUserAgent(), + slResponse.getSignaturLayout()); // Perform signature at.gv.egiz.pdfas.api.sign.SignResult signResult = pdfasInternal @@ -154,12 +169,15 @@ public class PDFASSigner implements Signer { // Set Signature position SignaturePosition pos = new SignaturePosition(pdfasPos.getX(), pdfasPos.getY(), pdfasPos.getPage()); -/* pos.SetAuto(sstate.getPDFAsSignatureParameter() - .getSignaturePosition().useAutoPositioning());*/ + /* + * pos.SetAuto(sstate.getPDFAsSignatureParameter() + * .getSignaturePosition().useAutoPositioning()); + */ result.setSignaturePosition(pos); // Set signed Document - result.setSignedDocument(new ByteArrayDocumentSource(((ByteArrayDataSink)sstate.getOutput()).getData())); + result.setSignedDocument(new ByteArrayDocumentSource( + ((ByteArrayDataSink) sstate.getOutput()).getData())); return result; } catch (PdfAsException e) { diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java index fa1572e9..eb598f07 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java @@ -16,53 +16,87 @@ package at.asit.pdfover.signer.pdfas; //Imports +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.ImageCapabilities; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import javax.imageio.ImageIO; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import at.asit.pdfover.signator.SignatureDimension; +import at.asit.pdfover.signator.SignatureException; import at.asit.pdfover.signator.SignatureParameter; import at.asit.pdfover.signator.SignaturePosition; +import at.asit.pdfover.signer.pdfas.exceptions.PDFASSLRequestException; import at.gv.egiz.pdfas.api.io.DataSource; import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning; +import at.gv.egiz.pdfas.impl.signator.binary.BinarySignator_1_1_0; import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException; +import at.knowcenter.wag.egov.egiz.sig.SignatureObject; +import at.knowcenter.wag.egov.egiz.table.Entry; +import at.knowcenter.wag.egov.egiz.table.Style; +import at.knowcenter.wag.egov.egiz.table.Table; /** * Implementation of SignatureParameter specific for PDF - AS Library */ public class PdfAsSignatureParameter extends SignatureParameter { - private HashMap genericProperties = new HashMap(); - + /** + * SFL4J Logger instance + **/ + static final Logger log = LoggerFactory + .getLogger(PdfAsSignatureParameter.class); + + private HashMap genericProperties = new HashMap(); + @Override public SignatureDimension getPlaceholderDimension() { - return new SignatureDimension(487, 206); + // return new SignatureDimension(487, 206); + + return new SignatureDimension(976, 329); } /** * Gets the PDFAS Positioning + * * @return SignaturePositioning - * @throws PDFDocumentException + * @throws PDFDocumentException */ - public SignaturePositioning getPDFASPositioning() throws PDFDocumentException { + public SignaturePositioning getPDFASPositioning() + throws PDFDocumentException { SignaturePosition position = this.getSignaturePosition(); position.useAutoPositioning(); - + SignaturePositioning positioning = null; - if(!position.useAutoPositioning()) { - positioning = new SignaturePositioning(String.format("p:%d;x:%f;y:%f", - position.getPage(), position.getX(), position.getY())); + if (!position.useAutoPositioning()) { + positioning = new SignaturePositioning(String.format( + "p:%d;x:%f;y:%f", position.getPage(), position.getX(), + position.getY())); } else { positioning = new SignaturePositioning(); } - + return positioning; } /** * Gets PDF - AS specific data source + * * @return ByteArrayPDFASDataSource */ public DataSource getPDFASDataSource() { - return new ByteArrayPDFASDataSource(this.getInputDocument().getByteArray()); + return new ByteArrayPDFASDataSource(this.getInputDocument() + .getByteArray()); } @Override @@ -74,4 +108,291 @@ public class PdfAsSignatureParameter extends SignatureParameter { public String getProperty(String key) { return this.genericProperties.get(key); } + + /* + * (non-Javadoc) + * + * @see at.asit.pdfover.signator.SignatureParameter#getPlaceholder() + */ + @Override + public Image getPlaceholder() throws SignatureException { + + try + { + PDFASHelper.getPdfAs(); + + SignatureObject sign_obj = at.knowcenter.wag.egov.egiz.PdfAS + .createSignatureObjectFromType(PDFASSigner.PROFILE_ID); + + sign_obj.fillValues(' ', true, false); + sign_obj.setKZ(BinarySignator_1_1_0.MY_ID); + + float width = getPlaceholderDimension().getWidth(); + float height = getPlaceholderDimension().getHeight(); + + Table table = sign_obj.getAbstractTable(); + + table.getStyle().getBgColor(); + + log.info(table.toString()); + + float[] heights = this.getTableHeights(table, table.getStyle(), height); + + log.info("Width: " + width + " Height: " + height); + BufferedImage image = new BufferedImage((int) width, (int) height, + BufferedImage.TYPE_INT_RGB); + Graphics graphic = image.getGraphics(); + + graphic.setColor(table.getStyle().getBgColor()); + graphic.fillRect(0, 0, (int) width, (int) height); + + graphic.setColor(Color.black); + graphic.drawRect(0, 0, (int) width, (int) height); + + this.drawTable(0, 0, (int) width, (int) height, table, + table.getStyle(), graphic, heights); + + save(image, "jpg"); + + return image; + } + catch (Exception ex) { + log.error("Failed to create Placeholder!", ex); + throw new SignatureException(ex.getMessage()); + } + } + + private static void save(BufferedImage image, String ext) { + String fileName = "savingAnImage"; + File file = new File(fileName + "." + ext); + try { + ImageIO.write(image, ext, file); // ignore returned boolean + log.debug("Saved as: " + file.getAbsolutePath()); + } catch (IOException e) { + System.out.println("Write error for " + file.getPath() + ": " + + e.getMessage()); + } + } + + private Font getFont(Style style) { + String def = "COURIER-NORMAL-8"; + String fontString = style.getFont(); + String[] font_arr = fontString.split(","); + if (font_arr.length != 3) { + return Font.decode(def); + } + return Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], + font_arr[1])); + + } + + private Font getValueFont(Style style) { + String def = "COURIER-NORMAL-8"; + String fontString = style.getValueFont(); + String[] font_arr = fontString.split(","); + if (font_arr.length != 3) { + return Font.decode(def); + } + return Font.decode(String.format("%s-%s-%s", font_arr[0], font_arr[2], + font_arr[1])); + } + + private int drawTable(int xoff, int yoff, int width, int height, + Table table, Style parentstyle, Graphics graphic, float[] heights) { + Style style = parentstyle; + if (table.getStyle() != null) { + style = table.getStyle(); + } + + log.debug(String.format("Table@ %dx%d", xoff, yoff)); + + Font oldFont = graphic.getFont(); + Font font = this.getFont(style); + Font valuefont = this.getValueFont(style); + + // draw background + // graphic.setColor(style.getBgColor()); + // graphic.fillRect(xoff, yoff, width, height); + + graphic.setColor(Color.black); + + // draw border + if (style.getBorder() > 0) { + graphic.setColor(Color.black); + graphic.drawRect(xoff, yoff, width, height); + } + float[] colWidths = table.getColsRelativeWith(); + float sum = 0; + + for (int i = 0; i < colWidths.length; i++) { + sum += colWidths[i]; + } + + float perUnit = width / sum; + + int padding = (int) (style.getPadding() * this.perUnitHeight); + + ArrayList rows = table.getRows(); + float roffset = 0; + for (int rowidx = 0; rowidx < rows.size(); rowidx++) { + ArrayList cols = (ArrayList) rows.get(rowidx); + int rsize = (int) heights[rowidx]; + for (int j = 0; j < cols.size(); j++) { + Entry entry = (Entry) cols.get(j); + float offset = 0; + for (int k = 0; k < j; k++) { + offset += colWidths[k] * perUnit; + } + if (entry.getType() == 0 || entry.getType() == 1) { + // Text + graphic.drawRect((int) (xoff + offset), + (int) (yoff + roffset), + (int) (colWidths[j] * perUnit), rsize); + + graphic.drawString(entry.getValue().toString(), (int) (xoff + + offset + padding), (int) (yoff + padding + + roffset + font.getSize() * this.perUnitHeight)); + } else if (entry.getType() == 2) { + // Image ... + BufferedImage image; + try { + if (this.getEmblem() != null + && this.getEmblem().getFileName() != null + && new File(this.getEmblem().getFileName()) + .exists()) { + image = ImageIO.read(new File(this.getEmblem() + .getFileName())); + } else { + image = ImageIO.read(new File(PDFASHelper + .getWorkDir() + + "/" + + entry.getValue().toString())); + } + Image img = image.getScaledInstance(80, 80, + Image.SCALE_DEFAULT); + + graphic.drawImage( + img, + (int) (xoff + offset + padding + (((colWidths[j] * perUnit) - 80 - padding)) / 2), + (int) (yoff + roffset + padding + ((rsize - 80 - padding) / 2)), + null); + } catch (IOException e) { + log.warn("Failed to paint emblem to placeholder image"); + } + } else { + // Table + + float[] cheights = this.getTableHeights( + (Table) entry.getValue(), style, rsize); + + int tsize = this.drawTable( + (int) (xoff + offset), + (int) (yoff + roffset), + (int) (colWidths[j] * perUnit), + // (int)this.getTableHeight((Table) + // entry.getValue(), style), + rsize, (Table) entry.getValue(), style, graphic, + cheights); + /* + * if (rsize < tsize) { rsize = tsize; } + */ + } + } + roffset += rsize; + } + + graphic.setFont(oldFont); + + return (int) roffset; + } + + private float perUnitHeight = 0; + + private float[] getTableHeights(Table table, Style parentstyle, float height) { + ArrayList rows = table.getRows(); + float[] sizes = new float[rows.size()]; + + float total_height = this.getTableHeight(table, parentstyle); + + float perUnit = height / total_height; + + this.perUnitHeight = perUnit; + + Style style = parentstyle; + if (table.getStyle() != null) { + style = table.getStyle(); + } + + for (int i = 0; i < rows.size(); i++) { + Object robj = rows.get(i); + ArrayList cols = (ArrayList) robj; + float tsize = 0; + float rsize = 0; + for (int j = 0; j < cols.size(); j++) { + Entry entry = (Entry) cols.get(j); + if (entry.getType() == 0 || entry.getType() == 1) { + String fontString = style.getFont(); + String[] font_arr = fontString.split(","); + int fontSize = 8; + + if (font_arr.length == 3) { + fontSize = Integer.parseInt(font_arr[1]); + } + + if (rsize < ((style.getPadding() * 2) + fontSize)) { + rsize = ((style.getPadding() * 2) + fontSize); + } + } else if (entry.getType() == 3) { + tsize = this + .getTableHeight((Table) entry.getValue(), style); + if (rsize < tsize) { + rsize = tsize; + } + } + } + sizes[i] = perUnit * rsize; + } + + return sizes; + } + + private float getTableHeight(Table table, Style parentstyle) { + ArrayList rows = table.getRows(); + Style style = parentstyle; + if (table.getStyle() != null) { + style = table.getStyle(); + } + float size = 0; + for (int i = 0; i < rows.size(); i++) { + Object robj = rows.get(i); + ArrayList cols = (ArrayList) robj; + float tsize = 0; + float rsize = 0; + for (int j = 0; j < cols.size(); j++) { + Entry entry = (Entry) cols.get(j); + if (entry.getType() == 0 || entry.getType() == 1) { + String fontString = style.getFont(); + String[] font_arr = fontString.split(","); + int fontSize = 8; + + if (font_arr.length == 3) { + fontSize = Integer.parseInt(font_arr[1]); + } + + if (rsize < ((style.getPadding() * 2) + fontSize)) { + rsize = ((style.getPadding() * 2) + fontSize); + } + } else if (entry.getType() == 3) { + tsize = this + .getTableHeight((Table) entry.getValue(), style); + if (rsize < tsize) { + rsize = tsize; + } + } + } + size += rsize; + } + + return size; + } } -- cgit v1.2.3 From 74ff027ae135c9280912009d23cbd9945121b088 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 23 Oct 2012 17:00:12 +0200 Subject: + fixed Warnings --- .../gui/composites/BKUSelectionComposite.java | 31 +++- .../pdfover/gui/workflow/states/OpenState.java | 3 - .../workflow/states/PrepareConfigurationState.java | 4 +- .../at/asit/pdfover/gui/messages.properties | 188 +++++++++------------ .../asit/pdfover/signator/SignatureParameter.java | 1 + .../at/asit/pdfover/signer/pdfas/PDFASHelper.java | 4 + .../at/asit/pdfover/signer/pdfas/PDFASSigner.java | 14 +- .../signer/pdfas/PdfAsSignatureParameter.java | 20 ++- 8 files changed, 135 insertions(+), 130 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java index a7a1b6aa..522b3bad 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java @@ -41,6 +41,9 @@ import at.asit.pdfover.signator.BKUs; */ public class BKUSelectionComposite extends StateComposite { + /** + * Margin for button + */ public static final int btnMargin = 2; /** @@ -115,12 +118,12 @@ public class BKUSelectionComposite extends StateComposite { Button btn_mobile = new Button(this, SWT.NATIVE | SWT.RESIZE); - btn_mobile.setText(Messages.getString("bku_selection.mobile")); //$NON-NLS-1$ + //btn_mobile.setText(Messages.getString("bku_selection.mobile")); //$NON-NLS-1$ //Point mobile_size = btn_mobile.computeSize(SWT.DEFAULT, SWT.DEFAULT); FormData fd_btn_mobile = new FormData(); //fd_btn_mobile.left = new FormAttachment(40, 0); fd_btn_mobile.right = new FormAttachment(50, -5); - fd_btn_mobile.top = new FormAttachment(40, 0); + fd_btn_mobile.top = new FormAttachment(40, -20); //fd_btn_mobile.bottom = new FormAttachment(55, 0); btn_mobile.setLayoutData(fd_btn_mobile); btn_mobile.addSelectionListener(new MobileSelectionListener()); @@ -134,12 +137,12 @@ public class BKUSelectionComposite extends StateComposite { btn_mobile.setFont(new Font(Display.getCurrent(), fD_btn_mobile[0])); Button btn_card = new Button(this, SWT.NATIVE | SWT.RESIZE); - btn_card.setText(Messages.getString("bku_selection.card")); //$NON-NLS-1$ + //btn_card.setText(Messages.getString("bku_selection.card")); //$NON-NLS-1$ //Point card_size = btn_card.computeSize(SWT.DEFAULT, SWT.DEFAULT); FormData fd_btn_card = new FormData(); fd_btn_card.left = new FormAttachment(50, 5); //fd_btn_card.right = new FormAttachment(60, 0); - fd_btn_card.top = new FormAttachment(40, 0); + fd_btn_card.top = new FormAttachment(40, -20); //fd_btn_card.bottom = new FormAttachment(55, 0); btn_card.setLayoutData(fd_btn_card); btn_card.addSelectionListener(new LocalSelectionListener()); @@ -152,6 +155,25 @@ public class BKUSelectionComposite extends StateComposite { btn_card.setImage(karte); + Button btnMobile = new Button(this, SWT.NONE); + FormData fd_btnMobile = new FormData(); + fd_btnMobile.top = new FormAttachment(btn_mobile, 10); + //fd_btnMobile.left = new FormAttachment(btn_mobile, 0); + fd_btnMobile.right = new FormAttachment(50, -5); + fd_btnMobile.width = btn_mobile.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; + btnMobile.setLayoutData(fd_btnMobile); + btnMobile.setText(Messages.getString("bku_selection.mobile")); //$NON-NLS-1$ + btnMobile.addSelectionListener(new MobileSelectionListener()); + + Button btnCard = new Button(this, SWT.NONE); + FormData fd_btnCard = new FormData(); + fd_btnCard.top = new FormAttachment(btn_card, 10); + //fd_btnMobile.left = new FormAttachment(btn_mobile, 0); + fd_btnCard.left = new FormAttachment(50, 5); + fd_btnCard.width = btn_card.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; + btnCard.setLayoutData(fd_btnCard); + btnCard.setText(Messages.getString("bku_selection.card")); //$NON-NLS-1$ + btnCard.addSelectionListener(new LocalSelectionListener()); //this.pack(); } @@ -167,5 +189,4 @@ public class BKUSelectionComposite extends StateComposite { public void doLayout() { this.layout(true, true); } - } diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index a158d7ca..cafcc64e 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -26,9 +26,6 @@ import at.asit.pdfover.gui.composites.DataSourceSelectComposite; import at.asit.pdfover.gui.workflow.ConfigProvider; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; -import at.asit.pdfover.signator.FileNameEmlbem; -import at.asit.pdfover.signator.SignatureException; -import at.asit.pdfover.signator.SignatureParameter; /** * Selects the data source for the signature process. diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index 92cdb774..b4398581 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -170,7 +170,7 @@ public class PrepareConfigurationState extends State { log.error( "Failed to write PDF Over config file to config directory", e); //$NON-NLS-1$ throw new InitializationException( - "Failed to write PDF Over config file to config directory", + "Failed to write PDF Over config file to config directory", //$NON-NLS-1$ e); } finally { if (pdfOverConfig != null) { @@ -201,7 +201,7 @@ public class PrepareConfigurationState extends State { log.error( "Failed to create local configuration directory!", e); //$NON-NLS-1$ throw new InitializationException( - "Failed to create local configuration directory!", + "Failed to create local configuration directory!", //$NON-NLS-1$ e); } allOK = true; diff --git a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index 7f7e8590..643d3cff 100644 --- a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -1,117 +1,97 @@ +#Eclipse messages class +#Tue Oct 23 16:04:42 CEST 2012 +BKU.LOCAL=Local BKU +BKU.MOBILE=Mobile BKU +BKU.NONE=no default +BKUSelectionComposite.btnMobile.text=MOBILE TrustedSocketFactory.FailedToCreateSecureConnection=Failed to create secure network connection - -main.title=PDF-Over -main.configuration=Configuration -main.position=Positioning -main.signature=Signing -main.done=Finish - -common.browse=browse +advanced_config.AutoPosition=Automatic positioning +advanced_config.AutoPosition_Title=Positioning +advanced_config.BKUSelection_Title=BKU Selection +advanced_config.OutputFolder=Default output folder\: +advanced_config.OutputFolder.Dialog=Select a folder +advanced_config.OutputFolder.Dialog_Title=Select Output folder +advanced_config.OutputFolder_Title=Output location +argument.error.output=is not a directory +argument.help.bku=Select the BKU to use values are\: LOCAL, MOBILE (example\: -b - diff --git a/trunk/pdf-over-gui/swing2swt.jar b/trunk/pdf-over-gui/swing2swt.jar deleted file mode 100644 index 3e781b04..00000000 Binary files a/trunk/pdf-over-gui/swing2swt.jar and /dev/null differ -- cgit v1.2.3 From 9e17d6420dc2baa48b604760879a84825ca7ce1a Mon Sep 17 00:00:00 2001 From: vkrnjic Date: Wed, 24 Oct 2012 09:39:25 +0200 Subject: new config button --- trunk/pdf-over-gui/src/main/resources/img/config.png | Bin 1370 -> 900 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/resources/img/config.png b/trunk/pdf-over-gui/src/main/resources/img/config.png index 71783015..cf88fe2b 100644 Binary files a/trunk/pdf-over-gui/src/main/resources/img/config.png and b/trunk/pdf-over-gui/src/main/resources/img/config.png differ -- cgit v1.2.3 From a612969c89ce5433e3b8761b092db28e1f6a8dfe Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 11:11:04 +0200 Subject: + polishing UI :) --- .../gui/composites/DataSourceSelectComposite.java | 98 ++++++++++++++----- .../composites/MobileBKUEnterNumberComposite.java | 107 ++++++++++++++------- .../gui/composites/MobileBKUEnterTANComposite.java | 107 +++++++++++++++------ .../at/asit/pdfover/gui/messages.properties | 2 +- 4 files changed, 226 insertions(+), 88 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java index fd466897..af87e3c7 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java @@ -112,6 +112,32 @@ public class DataSourceSelectComposite extends StateComposite { return this.selected; } + void MarkDragEnter() { + this.backgroundColor = this.activeBackground; + this.borderColor = this.activeBorder; + this.redrawDrop(); + } + + void MarkDragLeave() { + this.backgroundColor = this.getBackground(); + this.borderColor = this.inactiveBorder; + this.redrawDrop(); + } + + void redrawDrop() { + this.lbl_drag.setBackground(this.backgroundColor); + this.lbl_drag2.setBackground(this.backgroundColor); + this.btn_open.setBackground(this.backgroundColor); + this.drop_area.redraw(); + this.drop_area.layout(true, true); + } + + Color activeBackground; + Color inactiveBorder; + Color activeBorder; + Color borderColor; + Color backgroundColor; + /** * Create the composite. * @@ -122,6 +148,12 @@ public class DataSourceSelectComposite extends StateComposite { public DataSourceSelectComposite(Composite parent, int style, State state) { super(parent, style, state); + this.activeBackground = new Color(getDisplay(),0xD4, 0xE7, 0xF1); + this.inactiveBorder = this.activeBackground; + this.activeBorder = new Color(getDisplay(),0x6B, 0xA5, 0xD9); + this.backgroundColor = this.getBackground(); + this.borderColor = this.inactiveBorder; + this.setLayout(new FormLayout()); // Color back = new Color(Display.getCurrent(), 77, 190, 250); @@ -142,8 +174,14 @@ public class DataSourceSelectComposite extends StateComposite { Rectangle clientArea = DataSourceSelectComposite.this .drop_area.getClientArea(); - e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + //e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + e.gc.setForeground(DataSourceSelectComposite.this.borderColor); + e.gc.setLineWidth(3); e.gc.setLineStyle(SWT.LINE_DASH); + e.gc.setBackground(DataSourceSelectComposite.this.backgroundColor); + e.gc.fillRoundRectangle(clientArea.x, + clientArea.y, clientArea.width - 2, clientArea.height - 2, + 10, 10); e.gc.drawRoundRectangle(clientArea.x, clientArea.y, clientArea.width - 2, clientArea.height - 2, 10, 10); @@ -193,6 +231,7 @@ public class DataSourceSelectComposite extends StateComposite { if (event.detail == DND.DROP_DEFAULT) { if ((event.operations & DND.DROP_COPY) != 0) { event.detail = DND.DROP_COPY; + MarkDragEnter(); } else { event.detail = DND.DROP_NONE; } @@ -214,22 +253,31 @@ public class DataSourceSelectComposite extends StateComposite { } } } + + /* (non-Javadoc) + * @see org.eclipse.swt.dnd.DropTargetAdapter#dragLeave(org.eclipse.swt.dnd.DropTargetEvent) + */ + @Override + public void dragLeave(DropTargetEvent event) { + MarkDragLeave(); + super.dragLeave(event); + } }); - final Label lbl_drag2 = new Label(this.drop_area, SWT.NONE | SWT.RESIZE ); + this.lbl_drag2 = new Label(this.drop_area, SWT.NONE | SWT.RESIZE ); - final Label lbl_drag = new Label(this.drop_area, SWT.NONE | SWT.RESIZE ); + this.lbl_drag = new Label(this.drop_area, SWT.NONE | SWT.RESIZE ); this.fd_lbl_drag = new FormData(); this.fd_lbl_drag.left = new FormAttachment(0, 10); this.fd_lbl_drag.right = new FormAttachment(100, -10); //this.fd_lbl_drag.top = new FormAttachment(40, -10); - this.fd_lbl_drag.bottom = new FormAttachment(lbl_drag2, -10); - lbl_drag.setLayoutData(this.fd_lbl_drag); - FontData[] fD = lbl_drag.getFont().getFontData(); + this.fd_lbl_drag.bottom = new FormAttachment(this.lbl_drag2, -10); + this.lbl_drag.setLayoutData(this.fd_lbl_drag); + FontData[] fD = this.lbl_drag.getFont().getFontData(); fD[0].setHeight(TEXT_SIZE_BIG); - lbl_drag.setFont(new Font(Display.getCurrent(), fD[0])); - lbl_drag.setText(Messages.getString("dataSourceSelection.DropLabel")); //$NON-NLS-1$ - lbl_drag.setAlignment(SWT.CENTER); + this.lbl_drag.setFont(new Font(Display.getCurrent(), fD[0])); + this.lbl_drag.setText(Messages.getString("dataSourceSelection.DropLabel")); //$NON-NLS-1$ + this.lbl_drag.setAlignment(SWT.CENTER); this.fd_lbl_drag2 = new FormData(); @@ -237,19 +285,19 @@ public class DataSourceSelectComposite extends StateComposite { this.fd_lbl_drag2.right = new FormAttachment(100, -10); this.fd_lbl_drag2.top = new FormAttachment(50, -10); // fd_lbl_drag.bottom = new FormAttachment(100, -10); - lbl_drag2.setLayoutData(this.fd_lbl_drag2); - FontData[] fD2 = lbl_drag2.getFont().getFontData(); + this.lbl_drag2.setLayoutData(this.fd_lbl_drag2); + FontData[] fD2 = this.lbl_drag2.getFont().getFontData(); fD2[0].setHeight(TEXT_SIZE_NORMAL); - lbl_drag2.setFont(new Font(Display.getCurrent(), fD2[0])); - lbl_drag2.setText(Messages.getString("dataSourceSelection.DropLabel2")); //$NON-NLS-1$ - lbl_drag2.setAlignment(SWT.CENTER); + this.lbl_drag2.setFont(new Font(Display.getCurrent(), fD2[0])); + this.lbl_drag2.setText(Messages.getString("dataSourceSelection.DropLabel2")); //$NON-NLS-1$ + this.lbl_drag2.setAlignment(SWT.CENTER); - final Button btn_open = new Button(this.drop_area, SWT.NATIVE | SWT.RESIZE); - btn_open.setText(Messages.getString("dataSourceSelection.browse")); //$NON-NLS-1$ + this.btn_open = new Button(this.drop_area, SWT.NATIVE | SWT.RESIZE); + this.btn_open.setText(Messages.getString("dataSourceSelection.browse")); //$NON-NLS-1$ - FontData[] fD_open = btn_open.getFont().getFontData(); + FontData[] fD_open = this.btn_open.getFont().getFontData(); fD_open[0].setHeight(TEXT_SIZE_BUTTON); - btn_open.setFont(new Font(Display.getCurrent(), fD_open[0])); + this.btn_open.setFont(new Font(Display.getCurrent(), fD_open[0])); /* lbl_drag.addListener(SWT.Resize, new Listener() { @@ -275,17 +323,17 @@ public class DataSourceSelectComposite extends StateComposite { */ // lbl_drag.setBackground(back); - Point size = btn_open.computeSize(SWT.DEFAULT, SWT.DEFAULT); + Point size = this.btn_open.computeSize(SWT.DEFAULT, SWT.DEFAULT); this.fd_btn_open = new FormData(); this.fd_btn_open.left = new FormAttachment(50, (size.x / 2 ) * -1); //this.fd_btn_open.right = new FormAttachment(100, -5); //this.fd_btn_open.top = new FormAttachment(100, size.y * -1 - 10); - this.fd_btn_open.top = new FormAttachment(lbl_drag2, 10); + this.fd_btn_open.top = new FormAttachment(this.lbl_drag2, 10); //this.fd_btn_open.bottom = new FormAttachment(100, -5); - btn_open.setLayoutData(this.fd_btn_open); + this.btn_open.setLayoutData(this.fd_btn_open); // btn_open.setBackground(back); - btn_open.addSelectionListener(new FileBrowseDialogListener()); + this.btn_open.addSelectionListener(new FileBrowseDialogListener()); this.drop_area.pack(); } @@ -298,6 +346,12 @@ public class DataSourceSelectComposite extends StateComposite { FormData fd_btn_open; + private Label lbl_drag2; + + private Label lbl_drag; + + private Button btn_open; + @Override protected void checkSubclass() { // Disable the check that prevents subclassing of SWT components diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index 1c7e371a..da685f62 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -17,8 +17,14 @@ package at.asit.pdfover.gui.composites; // Imports import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.events.TraverseEvent; +import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -166,60 +172,95 @@ public class MobileBKUEnterNumberComposite extends StateComposite { super(parent, style, state); setLayout(new FormLayout()); - this.txt_number = new Text(this, SWT.SINGLE | SWT.NATIVE | SWT.BORDER); + final Composite containerComposite = new Composite(this, SWT.NATIVE); + containerComposite.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Rectangle clientArea = containerComposite.getClientArea(); + + //e.gc.setForeground(); + e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + e.gc.setLineWidth(3); + e.gc.setLineStyle(SWT.LINE_SOLID); + e.gc.drawRoundRectangle(clientArea.x, + clientArea.y, clientArea.width - 2, clientArea.height - 2, + 10, 10); + } + }); + containerComposite.setLayout(new FormLayout()); + FormData fd_containerComposite = new FormData(); + fd_containerComposite.top = new FormAttachment(50, -100); + fd_containerComposite.bottom = new FormAttachment(50, 100); + fd_containerComposite.left = new FormAttachment(50, -250); + fd_containerComposite.right = new FormAttachment(50, 250); + containerComposite.setLayoutData(fd_containerComposite); + + + this.txt_number = new Text(containerComposite, SWT.SINGLE | SWT.NATIVE | SWT.BORDER); FormData fd_number = new FormData(); - fd_number.top = new FormAttachment(30, -15); - fd_number.bottom = new FormAttachment(30, 15); - fd_number.left = new FormAttachment(50, 0); - fd_number.right = new FormAttachment(85, 0); + //fd_number.top = new FormAttachment(0, 20); + fd_number.bottom = new FormAttachment(50, -10); + fd_number.left = new FormAttachment(50, 10); + fd_number.right = new FormAttachment(100, -20); this.txt_number.setLayoutData(fd_number); this.txt_number.setEditable(true); - Label lbl_number = new Label(this, SWT.NATIVE); + Label lbl_number = new Label(containerComposite, SWT.NATIVE); lbl_number.setText(Messages.getString("mobileBKU.number")); //$NON-NLS-1$ FormData fd_lbl_number = new FormData(); - fd_lbl_number.top = new FormAttachment(30, -15); - fd_lbl_number.bottom = new FormAttachment(30, 15); - fd_lbl_number.left = new FormAttachment(15, 0); - fd_lbl_number.right = new FormAttachment(45, 0); + //fd_lbl_number.top = new FormAttachment(30, -15); + fd_lbl_number.bottom = new FormAttachment(50, -10); + fd_lbl_number.left = new FormAttachment(0, 20); + fd_lbl_number.right = new FormAttachment(50, -10); lbl_number.setLayoutData(fd_lbl_number); - this.txt_password = new Text(this, SWT.SINGLE | SWT.PASSWORD + this.txt_password = new Text(containerComposite, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER | SWT.NATIVE); FormData fd_password = new FormData(); - fd_password.top = new FormAttachment(50, -15); - fd_password.bottom = new FormAttachment(50, 15); - fd_password.left = new FormAttachment(50, 0); - fd_password.right = new FormAttachment(85, 0); + fd_password.top = new FormAttachment(50, 10); + //fd_password.bottom = new FormAttachment(50, 15); + fd_password.left = new FormAttachment(50, 10); + fd_password.right = new FormAttachment(100, -20); this.txt_password.setLayoutData(fd_password); this.txt_password.setEditable(true); + this.txt_password.addTraverseListener(new TraverseListener() { + + @Override + public void keyTraversed(TraverseEvent e) { + if (e.detail == SWT.TRAVERSE_RETURN) { + (new OkSelectionListener()).widgetSelected(null); + } + } + }); - Label lbl_password = new Label(this, SWT.NATIVE); + Label lbl_password = new Label(containerComposite, SWT.NATIVE); lbl_password.setText(Messages.getString("mobileBKU.password")); //$NON-NLS-1$ FormData fd_lbl_password = new FormData(); - fd_lbl_password.top = new FormAttachment(50, -15); - fd_lbl_password.bottom = new FormAttachment(50, 15); - fd_lbl_password.left = new FormAttachment(15, 0); - fd_lbl_password.right = new FormAttachment(45, 0); + fd_lbl_password.top = new FormAttachment(50, 10); + //fd_lbl_password.bottom = new FormAttachment(50, 15); + fd_lbl_password.left = new FormAttachment(0, 20); + fd_lbl_password.right = new FormAttachment(50, -10); lbl_password.setLayoutData(fd_lbl_password); - this.lbl_error = new Label(this, SWT.WRAP | SWT.NATIVE); - FormData fd_lbl_error = new FormData(); - fd_lbl_error.top = new FormAttachment(70, -15); - fd_lbl_error.bottom = new FormAttachment(70, 15); - fd_lbl_error.left = new FormAttachment(15, 0); - fd_lbl_error.right = new FormAttachment(85, 0); - this.lbl_error.setLayoutData(fd_lbl_error); - - Button btn_ok = new Button(this, SWT.NATIVE); + Button btn_ok = new Button(containerComposite, SWT.NATIVE); btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$ FormData fd_btn_ok = new FormData(); - fd_btn_ok.top = new FormAttachment(87, 0); - fd_btn_ok.bottom = new FormAttachment(95, 0); - fd_btn_ok.left = new FormAttachment(75, 0); - fd_btn_ok.right = new FormAttachment(95, 0); + //fd_btn_ok.top = new FormAttachment(87, 0); + fd_btn_ok.bottom = new FormAttachment(100, -20); + fd_btn_ok.right = new FormAttachment(100, -20); + fd_btn_ok.left = new FormAttachment(100, -70); btn_ok.setLayoutData(fd_btn_ok); btn_ok.addSelectionListener(new OkSelectionListener()); + + this.lbl_error = new Label(containerComposite, SWT.WRAP | SWT.NATIVE); + FormData fd_lbl_error = new FormData(); + //fd_lbl_error.top = new FormAttachment(70, -15); + fd_lbl_error.bottom = new FormAttachment(100, -20); + //fd_lbl_error.left = new FormAttachment(15, 0); + fd_lbl_error.right = new FormAttachment(btn_ok, -10); + this.lbl_error.setLayoutData(fd_lbl_error); + } @Override diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index 92a3515b..683ebd12 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -19,8 +19,14 @@ package at.asit.pdfover.gui.composites; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TraverseEvent; +import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -74,8 +80,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { /** * SLF4J Logger instance **/ - @SuppressWarnings("unused") - private static final Logger log = LoggerFactory + static final Logger log = LoggerFactory .getLogger(MobileBKUEnterTANComposite.class); Text txt_tan; @@ -103,6 +108,8 @@ public class MobileBKUEnterTANComposite extends StateComposite { */ public void setMessage(String msg) { this.lbl_tries.setText(msg); + this.lbl_tries.redraw(); + this.lbl_tries.getParent().layout(true, true); } /** @@ -171,69 +178,105 @@ public class MobileBKUEnterTANComposite extends StateComposite { super(parent, style, state); setLayout(new FormLayout()); - Label lblVergleichswert = new Label(this, SWT.NATIVE); + final Composite containerComposite = new Composite(this, SWT.NATIVE); + containerComposite.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Rectangle clientArea = containerComposite.getClientArea(); + + //e.gc.setForeground(); + e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + e.gc.setLineWidth(3); + e.gc.setLineStyle(SWT.LINE_SOLID); + e.gc.drawRoundRectangle(clientArea.x, + clientArea.y, clientArea.width - 2, clientArea.height - 2, + 10, 10); + } + }); + containerComposite.setLayout(new FormLayout()); + FormData fd_containerComposite = new FormData(); + fd_containerComposite.top = new FormAttachment(50, -100); + fd_containerComposite.bottom = new FormAttachment(50, 100); + fd_containerComposite.left = new FormAttachment(50, -250); + fd_containerComposite.right = new FormAttachment(50, 250); + containerComposite.setLayoutData(fd_containerComposite); + + + Label lblVergleichswert = new Label(containerComposite, SWT.NATIVE); FormData fd_lblVergleichswert = new FormData(); - fd_lblVergleichswert.left = new FormAttachment(15, 0); - fd_lblVergleichswert.right = new FormAttachment(50, 0); - fd_lblVergleichswert.top = new FormAttachment(30, -15); - fd_lblVergleichswert.bottom = new FormAttachment(30, 15); + fd_lblVergleichswert.left = new FormAttachment(0, 20); + fd_lblVergleichswert.right = new FormAttachment(50, -10); + //fd_lblVergleichswert.top = new FormAttachment(30, -15); + fd_lblVergleichswert.bottom = new FormAttachment(50, -10); lblVergleichswert.setLayoutData(fd_lblVergleichswert); lblVergleichswert.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ - this.lblvergleich = new Label(this, SWT.NATIVE); + this.lblvergleich = new Label(containerComposite, SWT.NATIVE); FormData fd_lblvergleich = new FormData(); - fd_lblvergleich.left = new FormAttachment(50, 0); - fd_lblvergleich.right = new FormAttachment(85, 0); - fd_lblvergleich.top = new FormAttachment(30, -15); - fd_lblvergleich.bottom = new FormAttachment(30, 15); + fd_lblvergleich.left = new FormAttachment(50, 10); + fd_lblvergleich.right = new FormAttachment(100, -20); + //fd_lblvergleich.top = new FormAttachment(30, -15); + fd_lblvergleich.bottom = new FormAttachment(50, -10); this.lblvergleich.setLayoutData(fd_lblvergleich); this.lblvergleich.setText(""); //$NON-NLS-1$ - Label lblTan = new Label(this, SWT.NATIVE); + Label lblTan = new Label(containerComposite, SWT.NATIVE); FormData fd_lblTan = new FormData(); - fd_lblTan.left = new FormAttachment(15, 5); - fd_lblTan.right = new FormAttachment(50, -5); - fd_lblTan.top = new FormAttachment(50, -15); - fd_lblTan.bottom = new FormAttachment(50, 15); + fd_lblTan.left = new FormAttachment(0, 20); + fd_lblTan.right = new FormAttachment(50, -10); + fd_lblTan.top = new FormAttachment(50, 10); + //fd_lblTan.bottom = new FormAttachment(50, 15); lblTan.setLayoutData(fd_lblTan); lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$ - this.txt_tan = new Text(this, SWT.BORDER | SWT.NATIVE); + this.txt_tan = new Text(containerComposite, SWT.BORDER | SWT.NATIVE); FormData fd_text = new FormData(); - fd_text.left = new FormAttachment(50, 0); - fd_text.right = new FormAttachment(85, 0); - fd_text.top = new FormAttachment(50, -15); - fd_text.left = new FormAttachment(50, 15); + fd_text.left = new FormAttachment(50, 10); + fd_text.right = new FormAttachment(100, -20); + fd_text.top = new FormAttachment(50, 10); this.txt_tan.setEditable(true); this.txt_tan.setLayoutData(fd_text); + this.txt_tan.addTraverseListener(new TraverseListener() { + + @Override + public void keyTraversed(TraverseEvent e) { + if (e.detail == SWT.TRAVERSE_RETURN) { + (new OkSelectionListener()).widgetSelected(null); + } + } + }); + this.txt_tan.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { String text = MobileBKUEnterTANComposite.this.txt_tan.getText(); - + log.debug("Current TAN: " + text); //$NON-NLS-1$ if(text.length() > 3 && MobileBKUEnterTANComposite.this.getVergleichswert().startsWith(text.trim())) { MobileBKUEnterTANComposite.this.setMessage(Messages.getString("error.EnteredReferenceValue")); //$NON-NLS-1$ } } }); - this.lbl_tries = new Label(this, SWT.WRAP | SWT.NATIVE); + Button btn_ok = new Button(containerComposite, SWT.NATIVE); + + this.lbl_tries = new Label(containerComposite, SWT.WRAP | SWT.NATIVE); FormData fd_lbl_tries = new FormData(); - fd_lbl_tries.left = new FormAttachment(15, 5); - fd_lbl_tries.right = new FormAttachment(85, -5); - fd_lbl_tries.top = new FormAttachment(70, -15); - fd_lbl_tries.bottom = new FormAttachment(70, 15); + //fd_lbl_tries.left = new FormAttachment(15, 5); + fd_lbl_tries.right = new FormAttachment(btn_ok, -10); + //fd_lbl_tries.top = new FormAttachment(70, -15); + fd_lbl_tries.bottom = new FormAttachment(100, -20); this.lbl_tries.setLayoutData(fd_lbl_tries); - Button btn_ok = new Button(this, SWT.NATIVE); + FormData fd_btn_ok = new FormData(); //fd_btn_ok.left = new FormAttachment(95, 0); - fd_btn_ok.right = new FormAttachment(95, 0); - fd_btn_ok.top = new FormAttachment(85); - fd_btn_ok.bottom = new FormAttachment(95); + fd_btn_ok.right = new FormAttachment(100, -20); + fd_btn_ok.left = new FormAttachment(100, -70); + fd_btn_ok.bottom = new FormAttachment(100,-20); btn_ok.setLayoutData(fd_btn_ok); btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$ diff --git a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index 643d3cff..c32ffb0f 100644 --- a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -94,4 +94,4 @@ simple_config.Proxy_Title=Proxy simple_config.UseEmblem=Use emblem tanEnter.ReferenceValue=reference value tanEnter.TAN=TAN\: -tanEnter.tries=tries left\!" +tanEnter.tries=tries left\! -- cgit v1.2.3 From cb87f630c412abe118df8ede580a1759c3b35859 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 24 Oct 2012 11:14:40 +0200 Subject: Local repo added (with PDFRenderer) --- trunk/pom.xml | 9 +++++++++ trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar | Bin 0 -> 1615628 bytes .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 | 1 + .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 | 1 + trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom | 9 +++++++++ .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 | 1 + .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 | 1 + trunk/repo/com/sun/pdfview/maven-metadata-local.xml | 12 ++++++++++++ .../repo/com/sun/pdfview/maven-metadata-local.xml.md5 | 1 + .../com/sun/pdfview/maven-metadata-local.xml.sha1 | 1 + 10 files changed, 36 insertions(+) create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 create mode 100644 trunk/repo/com/sun/pdfview/maven-metadata-local.xml create mode 100644 trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 create mode 100644 trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 (limited to 'trunk') diff --git a/trunk/pom.xml b/trunk/pom.xml index be9dfa9c..ae005667 100644 --- a/trunk/pom.xml +++ b/trunk/pom.xml @@ -160,6 +160,11 @@ icepdf-core 4.3.3 + + com.sun + pdfview + 0.9.2 + @@ -179,5 +184,9 @@ ICEpdf repository http://anonsvn.icesoft.org/repo/maven2/releases/ + + local-repo + file://${project.basedir}/repo + \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar new file mode 100644 index 00000000..c051ff39 Binary files /dev/null and b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar differ diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 new file mode 100644 index 00000000..50fa9fb3 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 @@ -0,0 +1 @@ +0574d4b45cbb919a39122824a76ff2fb \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 new file mode 100644 index 00000000..eb8e5140 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 @@ -0,0 +1 @@ +3517175e667aa454f8c7a014b01e4f9ee59cf2b6 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom new file mode 100644 index 00000000..c2a115d0 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + com.sun + pdfview + 0.9.2 + POM was created from install:install-file + diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 new file mode 100644 index 00000000..5b55cf15 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 @@ -0,0 +1 @@ +f4d6cdf65e8230987340e43e0bb18373 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 new file mode 100644 index 00000000..9203424a --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 @@ -0,0 +1 @@ +a56e3f8c021d8586a9236ca114136ce3c075a73a \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml new file mode 100644 index 00000000..3b333323 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + com.sun + pdfview + 0.9.2 + + + 0.9.2 + + 20121023171708 + + diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 new file mode 100644 index 00000000..b69dcb6a --- /dev/null +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 @@ -0,0 +1 @@ +95bd0fc3631723abc442b1e8a6577eb8 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 new file mode 100644 index 00000000..bc8dc80b --- /dev/null +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 @@ -0,0 +1 @@ +1ded7fa89decc8f1732c5538965db3bb3b2349ae \ No newline at end of file -- cgit v1.2.3 From bede6916cbf26574b94958e5bf5306433dbfe707 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 11:20:17 +0200 Subject: + add dashed border to config emblem drop --- .../composites/SimpleConfigurationComposite.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 07a0da53..9bc75be5 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -27,15 +27,19 @@ import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -101,7 +105,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } } - private Label lblEmblem; + Label lblEmblem; private Text txtProxyHost; Text txtProxyPort; Text txtMobileNumber; @@ -433,7 +437,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { new Label(grpBildmarke, SWT.NONE); new Label(grpBildmarke, SWT.NONE); - this.lblEmblem = new Label(grpBildmarke, SWT.BORDER | SWT.RESIZE); + this.lblEmblem = new Label(grpBildmarke, SWT.RESIZE); this.lblEmblem.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); this.lblEmblem.setAlignment(SWT.CENTER); @@ -446,6 +450,20 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { SimpleConfigurationComposite.this.recalculateEmblemSize(); } }); + + this.lblEmblem.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + //e.gc.setForeground(); + e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + e.gc.setLineWidth(3); + e.gc.setLineStyle(SWT.LINE_DASH); + e.gc.drawRoundRectangle(e.x, + e.y, e.width - 2, e.height - 2, + 10, 10); + } + }); FontData[] fD_lblEmblem = this.lblEmblem.getFont().getFontData(); fD_lblEmblem[0].setHeight(TEXT_SIZE_NORMAL); -- cgit v1.2.3 From 909c59aef09aeb2e4e08795d226895f5a383a125 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 14:02:22 +0200 Subject: + changed drop border color + changed emblem config --- .../java/at/asit/pdfover/gui/ImageConverter.java | 154 +++++++++++ .../composites/AdvancedConfigurationComposite.java | 18 ++ .../gui/composites/BaseConfigurationComposite.java | 28 ++ .../gui/composites/ConfigurationComposite.java | 27 +- .../gui/composites/DataSourceSelectComposite.java | 2 +- .../composites/SimpleConfigurationComposite.java | 300 +++++++++++++-------- .../gui/workflow/states/ConfigurationUIState.java | 2 + .../pdfover/gui/workflow/states/OpenState.java | 2 +- 8 files changed, 411 insertions(+), 122 deletions(-) create mode 100644 trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/ImageConverter.java (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/ImageConverter.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/ImageConverter.java new file mode 100644 index 00000000..28fb55a6 --- /dev/null +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/ImageConverter.java @@ -0,0 +1,154 @@ +/* + * Copyright 2012 by A-SIT, Secure Information Technology Center Austria + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://joinup.ec.europa.eu/software/page/eupl + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + */ +package at.asit.pdfover.gui; + +// Imports +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.DirectColorModel; +import java.awt.image.IndexColorModel; +import java.awt.image.WritableRaster; + +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.graphics.RGB; + +/** + * + */ +public class ImageConverter { + + /** + * Convert Image Data to AWT Image + * @param data + * @return AWT Image + */ + public static BufferedImage convertToAWT(ImageData data) { + ColorModel colorModel = null; + PaletteData palette = data.palette; + if (palette.isDirect) { + colorModel = new DirectColorModel(data.depth, palette.redMask, + palette.greenMask, palette.blueMask); + BufferedImage bufferedImage = new BufferedImage(colorModel, + colorModel.createCompatibleWritableRaster(data.width, + data.height), false, null); + WritableRaster raster = bufferedImage.getRaster(); + int[] pixelArray = new int[3]; + for (int y = 0; y < data.height; y++) { + for (int x = 0; x < data.width; x++) { + int pixel = data.getPixel(x, y); + RGB rgb = palette.getRGB(pixel); + pixelArray[0] = rgb.red; + pixelArray[1] = rgb.green; + pixelArray[2] = rgb.blue; + raster.setPixels(x, y, 1, 1, pixelArray); + } + } + return bufferedImage; + } + RGB[] rgbs = palette.getRGBs(); + byte[] red = new byte[rgbs.length]; + byte[] green = new byte[rgbs.length]; + byte[] blue = new byte[rgbs.length]; + for (int i = 0; i < rgbs.length; i++) { + RGB rgb = rgbs[i]; + red[i] = (byte) rgb.red; + green[i] = (byte) rgb.green; + blue[i] = (byte) rgb.blue; + } + if (data.transparentPixel != -1) { + colorModel = new IndexColorModel(data.depth, rgbs.length, red, + green, blue, data.transparentPixel); + } else { + colorModel = new IndexColorModel(data.depth, rgbs.length, red, + green, blue); + } + BufferedImage bufferedImage = new BufferedImage(colorModel, + colorModel.createCompatibleWritableRaster(data.width, + data.height), false, null); + WritableRaster raster = bufferedImage.getRaster(); + int[] pixelArray = new int[1]; + for (int y = 0; y < data.height; y++) { + for (int x = 0; x < data.width; x++) { + int pixel = data.getPixel(x, y); + pixelArray[0] = pixel; + raster.setPixel(x, y, pixelArray); + } + } + return bufferedImage; + + } + + /** + * Convert AWT Image to SWT Image + * + * @param bufferedImage + * @return SWT Image data + */ + public static ImageData convertToSWT(final BufferedImage bufferedImage) { + if (bufferedImage.getColorModel() instanceof DirectColorModel) { + DirectColorModel colorModel = (DirectColorModel) bufferedImage + .getColorModel(); + PaletteData palette = new PaletteData(colorModel.getRedMask(), + colorModel.getGreenMask(), colorModel.getBlueMask()); + ImageData data = new ImageData(bufferedImage.getWidth(), + bufferedImage.getHeight(), colorModel.getPixelSize(), + palette); + WritableRaster raster = bufferedImage.getRaster(); + int[] pixelArray = new int[3]; + for (int y = 0; y < data.height; y++) { + for (int x = 0; x < data.width; x++) { + raster.getPixel(x, y, pixelArray); + int pixel = palette.getPixel(new RGB(pixelArray[0], + pixelArray[1], pixelArray[2])); + data.setPixel(x, y, pixel); + } + } + return data; + } else if (bufferedImage.getColorModel() instanceof IndexColorModel) { + IndexColorModel colorModel = (IndexColorModel) bufferedImage + .getColorModel(); + int size = colorModel.getMapSize(); + byte[] reds = new byte[size]; + byte[] greens = new byte[size]; + byte[] blues = new byte[size]; + colorModel.getReds(reds); + colorModel.getGreens(greens); + colorModel.getBlues(blues); + RGB[] rgbs = new RGB[size]; + for (int i = 0; i < rgbs.length; i++) { + rgbs[i] = new RGB(reds[i] & 0xFF, greens[i] & 0xFF, + blues[i] & 0xFF); + } + PaletteData palette = new PaletteData(rgbs); + ImageData data = new ImageData(bufferedImage.getWidth(), + bufferedImage.getHeight(), colorModel.getPixelSize(), + palette); + data.transparentPixel = colorModel.getTransparentPixel(); + WritableRaster raster = bufferedImage.getRaster(); + int[] pixelArray = new int[1]; + for (int y = 0; y < data.height; y++) { + for (int x = 0; x < data.width; x++) { + raster.getPixel(x, y, pixelArray); + data.setPixel(x, y, pixelArray[0]); + } + } + return data; + } + return null; + } + +} diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java index c3b7973f..19e56b68 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java @@ -69,6 +69,16 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fd_tabFolder.left = new FormAttachment(0, 5); tabFolder.setLayoutData(fd_tabFolder); + tabFolder.addSelectionListener(new SelectionAdapter() { + /* (non-Javadoc) + * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) + */ + @Override + public void widgetSelected(SelectionEvent e) { + AdvancedConfigurationComposite.this.simpleComposite.signerChanged(); + } + }); + TabItem simpleTabItem = new TabItem(tabFolder, SWT.NULL); simpleTabItem.setText(Messages.getString("config.Simple")); //$NON-NLS-1$ @@ -263,6 +273,14 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { tabFolder.setSelection(advancedTabItem); } + /* (non-Javadoc) + * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#signerChanged() + */ + @Override + protected void signerChanged() { + this.simpleComposite.setSigner(this.getSigner()); + } + void performOutputFolderChanged(String foldername) { log.debug("Selected Output folder: " + foldername); //$NON-NLS-1$ this.configurationContainer.setOutputFolder(foldername); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BaseConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BaseConfigurationComposite.java index d97f3a5f..db3304d5 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BaseConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BaseConfigurationComposite.java @@ -19,6 +19,7 @@ package at.asit.pdfover.gui.composites; import org.eclipse.swt.widgets.Composite; import at.asit.pdfover.gui.workflow.ConfigurationContainer; +import at.asit.pdfover.gui.workflow.PDFSigner; import at.asit.pdfover.gui.workflow.states.State; /** @@ -31,6 +32,33 @@ public abstract class BaseConfigurationComposite extends StateComposite { */ protected ConfigurationContainer configurationContainer; + /** + * The PDF Signer used to produce signature block preview + */ + protected PDFSigner signer; + + /** + * @return the signer + */ + public PDFSigner getSigner() { + return this.signer; + } + + /** + * @param signer the signer to set + */ + public void setSigner(PDFSigner signer) { + this.signer = signer; + this.signerChanged(); + } + + /** + * Called when the signer is changed! + */ + protected void signerChanged() { + // overwrite + } + /** * @param parent * @param style diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java index 25cedaf0..105fcd54 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java @@ -33,6 +33,7 @@ import at.asit.pdfover.gui.workflow.ConfigManipulator; import at.asit.pdfover.gui.workflow.ConfigProvider; import at.asit.pdfover.gui.workflow.ConfigurationContainer; import at.asit.pdfover.gui.workflow.ConfigurationContainerImpl; +import at.asit.pdfover.gui.workflow.PDFSigner; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.SignaturePosition; @@ -53,6 +54,28 @@ import org.eclipse.swt.layout.FormAttachment; */ public class ConfigurationComposite extends StateComposite { + /** + * The PDF Signer used to produce signature block preview + */ + protected PDFSigner signer; + + /** + * @return the signer + */ + public PDFSigner getSigner() { + return this.signer; + } + + /** + * @param signer the signer to set + */ + public void setSigner(PDFSigner signer) { + this.signer = signer; + if(this.configComposite != null) { + this.configComposite.setSigner(getSigner()); + } + } + /** * Configuration Mode selection listener */ @@ -76,6 +99,7 @@ public class ConfigurationComposite extends StateComposite { ConfigurationComposite.this.style, ConfigurationComposite.this.state, ConfigurationComposite.this.configurationContainer); + ConfigurationComposite.this.configComposite.setSigner(getSigner()); ConfigurationComposite.this.btnAdvanced.setText(Messages.getString("config.Simple")); //$NON-NLS-1$ } else { // switch to simple @@ -85,6 +109,7 @@ public class ConfigurationComposite extends StateComposite { ConfigurationComposite.this.style, ConfigurationComposite.this.state, ConfigurationComposite.this.configurationContainer); + ConfigurationComposite.this.configComposite.setSigner(getSigner()); ConfigurationComposite.this.btnAdvanced.setText(Messages.getString("config.Advanced")); //$NON-NLS-1$ } @@ -225,7 +250,7 @@ public class ConfigurationComposite extends StateComposite { this.configComposite = new SimpleConfigurationComposite( this.containerComposite, SWT.FILL | style, state, this.configurationContainer); - + FormData fd_composite = new FormData(); fd_composite.top = new FormAttachment(0, 5); fd_composite.bottom = new FormAttachment(90, -5); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java index af87e3c7..3ee71997 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java @@ -149,7 +149,7 @@ public class DataSourceSelectComposite extends StateComposite { super(parent, style, state); this.activeBackground = new Color(getDisplay(),0xD4, 0xE7, 0xF1); - this.inactiveBorder = this.activeBackground; + this.inactiveBorder = new Color(getDisplay(),0xB4, 0xCD, 0xEC); this.activeBorder = new Color(getDisplay(),0x6B, 0xA5, 0xD9); this.backgroundColor = this.getBackground(); this.borderColor = this.inactiveBorder; diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 9bc75be5..94d42a18 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -16,6 +16,7 @@ package at.asit.pdfover.gui.composites; // Imports +import java.awt.image.BufferedImage; import java.io.File; import org.eclipse.swt.SWT; @@ -57,6 +58,7 @@ import org.eclipse.swt.widgets.Text; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import at.asit.pdfover.gui.ImageConverter; import at.asit.pdfover.gui.Messages; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.ErrorMarker; @@ -65,6 +67,8 @@ import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.workflow.ConfigurationContainer; import at.asit.pdfover.gui.workflow.states.State; +import at.asit.pdfover.signator.FileNameEmlbem; +import at.asit.pdfover.signator.SignatureParameter; /** * @@ -87,8 +91,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FileDialog dialog = new FileDialog( SimpleConfigurationComposite.this.getShell(), SWT.OPEN); dialog.setFilterExtensions(new String[] { "*.jpg", "*.gif" }); //$NON-NLS-1$ //$NON-NLS-2$ - dialog.setFilterNames(new String[] { - Messages.getString("common.JPGExtension_Description"), //$NON-NLS-1$ + dialog.setFilterNames(new String[] { + Messages.getString("common.JPGExtension_Description"), //$NON-NLS-1$ Messages.getString("common.GIFExtension_Description") }); //$NON-NLS-1$ String fileName = dialog.open(); File file = null; @@ -160,9 +164,16 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { betterFactor = 1.0f; } - Image emblem = new Image(this.getDisplay(), this.origEmblem - .getImageData().scaledTo((int) (width * betterFactor), - (int) (height * betterFactor))); + BufferedImage awt_image = ImageConverter.convertToAWT(this.origEmblem.getImageData()); + + java.awt.Image scaled_awt = awt_image.getScaledInstance((int) (width * betterFactor), + (int) (height * betterFactor), java.awt.Image.SCALE_SMOOTH); + + BufferedImage scaled_buffered = new BufferedImage((int) (width * betterFactor), + (int) (height * betterFactor), BufferedImage.TYPE_INT_RGB); + scaled_buffered.getGraphics().drawImage(scaled_awt, 0, 0, null); + + Image emblem = new Image(this.getDisplay(), ImageConverter.convertToSWT(scaled_buffered)); Image old = this.lblEmblem.getImage(); @@ -172,6 +183,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.lblEmblem.setText(""); //$NON-NLS-1$ this.lblEmblem.setImage(emblem); + } else { + this.lblEmblem.setImage(null); } } @@ -189,40 +202,43 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } } - try { - this.configurationContainer.setEmblem(filename); - - if (filename == null || filename.trim().equals("")) { //$NON-NLS-1$ - return; - } + this.configurationContainer.setEmblem(filename); + this.setVisibleImage(); + this.doLayout(); + } - // this.txtEmblemFile.setText(); + void setVisibleImage() { + String image = this.configurationContainer.getEmblem(); + ImageData img = null; + try { - this.emblemFile = this.configurationContainer.getEmblem(); - if (this.origEmblem != null) { - this.origEmblem.dispose(); + if (image == null || image.trim().equals("")) { //$NON-NLS-1$ + if (this.signer != null) { + img = ImageConverter.convertToSWT((BufferedImage) this.signer + .getPDFSigner().newParameter().getPlaceholder()); + } + } else { + if (this.signer != null) { + SignatureParameter param = this.signer.getPDFSigner() + .newParameter(); + param.setEmblem(new FileNameEmlbem(image)); + img = ImageConverter.convertToSWT((BufferedImage) param + .getPlaceholder()); + } else { + img = new ImageData(image); + } } - - this.origEmblem = new Image(this.getDisplay(), new ImageData( - filename)); - - this.lblEmblem.setText(""); //$NON-NLS-1$ - - this.recalculateEmblemSize(); } catch (Exception e) { - this.lblEmblem - .setText(Messages.getString("simple_config.EmblemEmpty")); //$NON-NLS-1$ - this.lblEmblem.setImage(null); - if (this.origEmblem != null) { - this.origEmblem.dispose(); - } + log.error("Failed to load image for display...", e); //$NON-NLS-1$ + } + + if (img != null) { + this.origEmblem = new Image(this.getDisplay(), img); + } else { this.origEmblem = null; - throw e; } - // this.lblEmblem.pack(); - // this.lblEmblem.getParent().pack(); - this.doLayout(); + this.recalculateEmblemSize(); } void processEmblemChanged(String filename) { @@ -231,7 +247,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { plainEmblemSetter(filename); } catch (Exception ex) { log.error("processEmblemChanged: ", ex); //$NON-NLS-1$ - ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, + ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, Messages.getString("error.FailedToLoadEmblem"), ex, false); //$NON-NLS-1$ dialog.open(); } @@ -242,9 +258,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { * @throws Exception */ private void plainEmblemSetter(String filename) throws Exception { - this.emblemFile = filename; + //this.emblemFile = filename; this.setEmblemFileInternal(filename); - this.btnUseImage.setSelection(true); + // this.btnClearImage.setSelection(true); } void processNumberChanged() { @@ -253,12 +269,20 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { plainMobileNumberSetter(); } catch (Exception ex) { this.txtMobileNumberErrorMarker.setVisible(true); - this.txtMobileNumberErrorMarker - .setToolTipText(Messages.getString("error.InvalidPhoneNumber")); //$NON-NLS-1$ + this.txtMobileNumberErrorMarker.setToolTipText(Messages + .getString("error.InvalidPhoneNumber")); //$NON-NLS-1$ log.error("processNumberChanged: ", ex); //$NON-NLS-1$ } } + /* (non-Javadoc) + * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#signerChanged() + */ + @Override + protected void signerChanged() { + this.setVisibleImage(); + } + /** * @throws InvalidNumberException */ @@ -355,23 +379,28 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { fd_grpHandySignatur.top = new FormAttachment(0, 5); fd_grpHandySignatur.bottom = new FormAttachment(20, -5); grpHandySignatur.setLayoutData(fd_grpHandySignatur); - grpHandySignatur.setText(Messages.getString("simple_config.MobileBKU_Title")); //$NON-NLS-1$ + grpHandySignatur.setText(Messages + .getString("simple_config.MobileBKU_Title")); //$NON-NLS-1$ grpHandySignatur.setLayout(new GridLayout(2, false)); - FontData[] fD_grpHandySignatur = grpHandySignatur.getFont().getFontData(); + FontData[] fD_grpHandySignatur = grpHandySignatur.getFont() + .getFontData(); fD_grpHandySignatur[0].setHeight(TEXT_SIZE_NORMAL); - grpHandySignatur.setFont(new Font(Display.getCurrent(), fD_grpHandySignatur[0])); - + grpHandySignatur.setFont(new Font(Display.getCurrent(), + fD_grpHandySignatur[0])); + Label lblMobileNumber = new Label(grpHandySignatur, SWT.NONE | SWT.RESIZE); lblMobileNumber.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); - lblMobileNumber.setText(Messages.getString("simple_config.PhoneNumber")); //$NON-NLS-1$ + lblMobileNumber + .setText(Messages.getString("simple_config.PhoneNumber")); //$NON-NLS-1$ FontData[] fD_lblMobileNumber = lblMobileNumber.getFont().getFontData(); fD_lblMobileNumber[0].setHeight(TEXT_SIZE_NORMAL); - lblMobileNumber.setFont(new Font(Display.getCurrent(), fD_lblMobileNumber[0])); - + lblMobileNumber.setFont(new Font(Display.getCurrent(), + fD_lblMobileNumber[0])); + Composite composite_2 = new Composite(grpHandySignatur, SWT.NONE); composite_2.setLayout(new FormLayout()); composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, @@ -396,10 +425,12 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.txtMobileNumberErrorMarker .setLayoutData(this.fd_txtMobileNumberErrorMarker); - FontData[] fD_txtMobileNumber = this.txtMobileNumber.getFont().getFontData(); + FontData[] fD_txtMobileNumber = this.txtMobileNumber.getFont() + .getFontData(); fD_txtMobileNumber[0].setHeight(TEXT_SIZE_NORMAL); - this.txtMobileNumber.setFont(new Font(Display.getCurrent(), fD_txtMobileNumber[0])); - + this.txtMobileNumber.setFont(new Font(Display.getCurrent(), + fD_txtMobileNumber[0])); + this.txtMobileNumber.addTraverseListener(new TraverseListener() { @Override @@ -410,7 +441,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } }); - this.txtMobileNumber.setMessage(Messages.getString("simple_config.ExampleNumber")); //$NON-NLS-1$ + this.txtMobileNumber.setMessage(Messages + .getString("simple_config.ExampleNumber")); //$NON-NLS-1$ this.txtMobileNumber.addFocusListener(new FocusAdapter() { @@ -427,50 +459,73 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { fd_grpBildmarke.bottom = new FormAttachment(65, -5); fd_grpBildmarke.top = new FormAttachment(20, 5); grpBildmarke.setLayoutData(fd_grpBildmarke); - grpBildmarke.setLayout(new GridLayout(5, false)); - + grpBildmarke.setLayout(new FormLayout()); + FontData[] fD_grpBildmarke = grpBildmarke.getFont().getFontData(); fD_grpBildmarke[0].setHeight(TEXT_SIZE_NORMAL); - grpBildmarke.setFont(new Font(Display.getCurrent(), fD_grpBildmarke[0])); - + grpBildmarke + .setFont(new Font(Display.getCurrent(), fD_grpBildmarke[0])); + grpBildmarke.setText(Messages.getString("simple_config.Emblem_Title")); //$NON-NLS-1$ - new Label(grpBildmarke, SWT.NONE); - new Label(grpBildmarke, SWT.NONE); - this.lblEmblem = new Label(grpBildmarke, SWT.RESIZE); - this.lblEmblem.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, - true, 3, 1)); - this.lblEmblem.setAlignment(SWT.CENTER); - this.lblEmblem - .setText(Messages.getString("simple_config.EmblemEmpty")); //$NON-NLS-1$ - this.lblEmblem.addListener(SWT.Resize, new Listener() { + Composite containerComposite = new Composite(grpBildmarke, SWT.NONE); + containerComposite.setLayout(new FormLayout()); + FormData fd_containerComposite = new FormData(); + fd_containerComposite.left = new FormAttachment(0); + fd_containerComposite.right = new FormAttachment(100); + fd_containerComposite.top = new FormAttachment(0); + fd_containerComposite.bottom = new FormAttachment(100); + containerComposite.setLayoutData(fd_containerComposite); + containerComposite.addPaintListener(new PaintListener() { - @Override - public void handleEvent(Event event) { - SimpleConfigurationComposite.this.recalculateEmblemSize(); - } - }); - - this.lblEmblem.addPaintListener(new PaintListener() { - @Override public void paintControl(PaintEvent e) { - //e.gc.setForeground(); - e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9)); + // e.gc.setForeground(); + e.gc.setForeground(new Color(getDisplay(),0xB4, 0xCD, 0xEC)); e.gc.setLineWidth(3); e.gc.setLineStyle(SWT.LINE_DASH); - e.gc.drawRoundRectangle(e.x, - e.y, e.width - 2, e.height - 2, + e.gc.drawRoundRectangle(e.x, e.y, e.width - 2, e.height - 2, 10, 10); } }); + this.lblEmblem = new Label(containerComposite, SWT.RESIZE); + + Label lbl_drop = new Label(containerComposite, SWT.NATIVE); + lbl_drop.setText(Messages.getString("simple_config.EmblemEmpty")); + this.btnClearImage = new Button(containerComposite, SWT.NATIVE); + + FormData fd_lbl_drop = new FormData(); + // fd_lbl_drop.left = new FormAttachment(0); + fd_lbl_drop.right = new FormAttachment(100, -20); + // fd_lbl_drop.top = new FormAttachment(0, 20); + fd_lbl_drop.bottom = new FormAttachment(50, -10); + + lbl_drop.setLayoutData(fd_lbl_drop); + + FormData fd_lblEmblem = new FormData(); + fd_lblEmblem.left = new FormAttachment(0, 20); + fd_lblEmblem.right = new FormAttachment(lbl_drop, -20); + fd_lblEmblem.top = new FormAttachment(0, 20); + fd_lblEmblem.bottom = new FormAttachment(100, -20); + + this.lblEmblem.setLayoutData(fd_lblEmblem); + this.lblEmblem.setAlignment(SWT.CENTER); + + this.lblEmblem.addListener(SWT.Resize, new Listener() { + + @Override + public void handleEvent(Event event) { + SimpleConfigurationComposite.this.recalculateEmblemSize(); + } + }); + FontData[] fD_lblEmblem = this.lblEmblem.getFont().getFontData(); fD_lblEmblem[0].setHeight(TEXT_SIZE_NORMAL); this.lblEmblem.setFont(new Font(Display.getCurrent(), fD_lblEmblem[0])); - - DropTarget dnd_target = new DropTarget(this.lblEmblem, DND.DROP_DEFAULT - | DND.DROP_COPY); + + DropTarget dnd_target = new DropTarget(containerComposite, + DND.DROP_DEFAULT | DND.DROP_COPY); final FileTransfer fileTransfer = FileTransfer.getInstance(); Transfer[] types = new Transfer[] { fileTransfer }; dnd_target.setTransfer(types); @@ -531,47 +586,44 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { } }); - new Label(grpBildmarke, SWT.NONE); - new Label(grpBildmarke, SWT.NONE); - - this.btnUseImage = new Button(grpBildmarke, SWT.CHECK); - this.btnUseImage.setText(Messages.getString("simple_config.UseEmblem")); //$NON-NLS-1$ - this.btnUseImage.addSelectionListener(new SelectionAdapter() { + this.btnClearImage.setText(Messages + .getString("simple_config.ClearEmblem")); //$NON-NLS-1$ + this.btnClearImage.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - if (SimpleConfigurationComposite.this.btnUseImage - .getSelection()) { - processEmblemChanged(SimpleConfigurationComposite.this.emblemFile); - } else { - try { - SimpleConfigurationComposite.this.configurationContainer - .setEmblem(null); - } catch (InvalidEmblemFile e1) { - // This exception should not occur! - log.error("Failed to load emblem", e1); //$NON-NLS-1$ - } - } + SimpleConfigurationComposite.this.processEmblemChanged(null); } }); - new Label(grpBildmarke, SWT.NONE); - - - FontData[] fD_btnUseImage = this.btnUseImage.getFont().getFontData(); + FontData[] fD_btnUseImage = this.btnClearImage.getFont().getFontData(); fD_btnUseImage[0].setHeight(TEXT_SIZE_BUTTON); - this.btnUseImage.setFont(new Font(Display.getCurrent(), fD_btnUseImage[0])); - - Button btnBrowseEmblem = new Button(grpBildmarke, SWT.NONE); - btnBrowseEmblem.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, - false, false, 1, 1)); + this.btnClearImage.setFont(new Font(Display.getCurrent(), + fD_btnUseImage[0])); + + Button btnBrowseEmblem = new Button(containerComposite, SWT.NONE); + + FormData fd_btnUseImage = new FormData(); + + fd_btnUseImage.top = new FormAttachment(50, 10); + fd_btnUseImage.right = new FormAttachment(btnBrowseEmblem, -10); + + this.btnClearImage.setLayoutData(fd_btnUseImage); + + FormData fd_btnBrowseEmblem = new FormData(); + + fd_btnBrowseEmblem.top = new FormAttachment(50, 10); + fd_btnBrowseEmblem.right = new FormAttachment(100, -20); + + btnBrowseEmblem.setLayoutData(fd_btnBrowseEmblem); btnBrowseEmblem.addSelectionListener(new ImageFileBrowser()); btnBrowseEmblem.setText(Messages.getString("common.browse")); //$NON-NLS-1$ FontData[] fD_btnBrowseEmblem = btnBrowseEmblem.getFont().getFontData(); fD_btnBrowseEmblem[0].setHeight(TEXT_SIZE_BUTTON); - btnBrowseEmblem.setFont(new Font(Display.getCurrent(), fD_btnBrowseEmblem[0])); - + btnBrowseEmblem.setFont(new Font(Display.getCurrent(), + fD_btnBrowseEmblem[0])); + Group grpProxy = new Group(this, SWT.NONE); FormData fd_grpProxy = new FormData(); fd_grpProxy.right = new FormAttachment(100, -5); @@ -585,7 +637,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpProxy = grpProxy.getFont().getFontData(); fD_grpProxy[0].setHeight(TEXT_SIZE_NORMAL); grpProxy.setFont(new Font(Display.getCurrent(), fD_grpProxy[0])); - + Label lblNewLabel = new Label(grpProxy, SWT.NONE); GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); @@ -597,7 +649,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_lblNewLabel = lblNewLabel.getFont().getFontData(); fD_lblNewLabel[0].setHeight(TEXT_SIZE_NORMAL); lblNewLabel.setFont(new Font(Display.getCurrent(), fD_lblNewLabel[0])); - + Composite composite = new Composite(grpProxy, SWT.NONE); composite.setLayout(new FormLayout()); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, @@ -611,8 +663,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_txtProxyHost = this.txtProxyHost.getFont().getFontData(); fD_txtProxyHost[0].setHeight(TEXT_SIZE_NORMAL); - this.txtProxyHost.setFont(new Font(Display.getCurrent(), fD_txtProxyHost[0])); - + this.txtProxyHost.setFont(new Font(Display.getCurrent(), + fD_txtProxyHost[0])); + this.proxyHostErrorMarker = new ErrorMarker(composite, SWT.NONE, null, "", this.txtProxyHost); //$NON-NLS-1$ @@ -625,7 +678,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.proxyHostErrorMarker.setVisible(false); this.txtProxyHost.setLayoutData(fd_txtProxyHost); - this.txtProxyHost.setMessage(Messages.getString("simple_config.ProxyHostTemplate")); //$NON-NLS-1$ + this.txtProxyHost.setMessage(Messages + .getString("simple_config.ProxyHostTemplate")); //$NON-NLS-1$ this.txtProxyHost.addFocusListener(new FocusAdapter() { @@ -651,8 +705,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_lblNewLabel_1 = lblNewLabel_1.getFont().getFontData(); fD_lblNewLabel_1[0].setHeight(TEXT_SIZE_NORMAL); - lblNewLabel_1.setFont(new Font(Display.getCurrent(), fD_lblNewLabel_1[0])); - + lblNewLabel_1.setFont(new Font(Display.getCurrent(), + fD_lblNewLabel_1[0])); + Composite composite_1 = new Composite(grpProxy, SWT.NONE); composite_1.setLayout(new FormLayout()); composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, @@ -665,11 +720,12 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.fd_txtProxyPort.right = new FormAttachment(100, -42); this.fd_txtProxyPort.bottom = new FormAttachment(100); this.txtProxyPort.setLayoutData(this.fd_txtProxyPort); - + FontData[] fD_txtProxyPort = this.txtProxyPort.getFont().getFontData(); fD_txtProxyPort[0].setHeight(TEXT_SIZE_NORMAL); - this.txtProxyPort.setFont(new Font(Display.getCurrent(), fD_txtProxyPort[0])); - + this.txtProxyPort.setFont(new Font(Display.getCurrent(), + fD_txtProxyPort[0])); + this.txtProxyPort.addTraverseListener(new TraverseListener() { @Override @@ -690,7 +746,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { .setLayoutData(this.fd_txtProxyPortErrorMarker); this.txtProxyPortErrorMarker.setVisible(false); - this.txtProxyPort.setMessage(Messages.getString("simple_config.ProxyPortTemplate")); //$NON-NLS-1$ + this.txtProxyPort.setMessage(Messages + .getString("simple_config.ProxyPortTemplate")); //$NON-NLS-1$ this.txtProxyPort.addFocusListener(new FocusAdapter() { @@ -745,7 +802,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { FormData fd_txtMobileNumber; FormData fd_txtProxyPort; ErrorMarker txtProxyPortErrorMarker; - Button btnUseImage; + Button btnClearImage; /* * (non-Javadoc) @@ -778,10 +835,13 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { this.emblemFile = emblemFile; try { this.setEmblemFileInternal(emblemFile, true); - this.btnUseImage.setSelection(true); + this.btnClearImage.setSelection(true); } catch (Exception e1) { log.error("Failed to load emblem: ", e1); //$NON-NLS-1$ - ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, Messages.getString("error.FailedToLoadEmblem"), e1, false); //$NON-NLS-1$ + ErrorDialog dialog = new ErrorDialog( + getShell(), + SWT.NONE, + Messages.getString("error.FailedToLoadEmblem"), e1, false); //$NON-NLS-1$ dialog.open(); } } @@ -796,6 +856,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { if (host != null) { this.txtProxyHost.setText(host); } + + this.setVisibleImage(); } /* diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java index 333b82d5..d8ddc403 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/ConfigurationUIState.java @@ -37,6 +37,7 @@ public class ConfigurationUIState extends State { .getLogger(ConfigurationUIState.class); + private ConfigurationComposite configurationComposite = null; private ConfigurationComposite getConfigurationComposite() { @@ -45,6 +46,7 @@ public class ConfigurationUIState extends State { this.stateMachine.getGUIProvider().createComposite(ConfigurationComposite.class, SWT.RESIZE, this); this.configurationComposite.setConfigManipulator(this.stateMachine.getConfigManipulator()); this.configurationComposite.setConfigProvider(this.stateMachine.getConfigProvider()); + this.configurationComposite.setSigner(this.stateMachine.getPDFSigner()); } return this.configurationComposite; diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index cafcc64e..bc8a9e83 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -52,7 +52,7 @@ public class OpenState extends State { this.selectionComposite = this.stateMachine.getGUIProvider().createComposite(DataSourceSelectComposite.class, SWT.RESIZE, this); } - + return this.selectionComposite; } -- cgit v1.2.3 From 914c3ade4b6c8bba74ebc8a07780f34d9fab426b Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 14:05:24 +0200 Subject: + messages for pdfover --- .../src/main/resources/at/asit/pdfover/gui/messages.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index c32ffb0f..2dddbe00 100644 --- a/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/trunk/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -81,7 +81,7 @@ mobileBKU.password=Password\: output.link_open_message=You can open the signed file here output.link_save_message=You can save the signed file output.success_message=Signature was successful -simple_config.EmblemEmpty=No image.\nDrag and Drop an image.\nOr use the browse button to select an emblem. +simple_config.EmblemEmpty=Drag and Drop an image here\nor use the browse button to select an emblem. simple_config.Emblem_Title=Emblem simple_config.ExampleNumber=+43676123456789 simple_config.MobileBKU_Title=Mobile signature @@ -91,7 +91,7 @@ simple_config.ProxyHostTemplate=Hostname or IP of proxy server simple_config.ProxyPort=Port\: simple_config.ProxyPortTemplate=port proxy server [1-65535] simple_config.Proxy_Title=Proxy -simple_config.UseEmblem=Use emblem +simple_config.ClearEmblem=clear tanEnter.ReferenceValue=reference value tanEnter.TAN=TAN\: tanEnter.tries=tries left\! -- cgit v1.2.3 From ec8001812b8518b8f0154b92f504d90b9073fec4 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 14:19:07 +0200 Subject: + added pdf-as-3.2.jar to repo --- trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar | Bin 0 -> 2752580 bytes trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.md5 | 1 + trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.sha1 | 1 + trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom | 9 +++++++++ trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.md5 | 1 + trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.sha1 | 1 + trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml | 12 ++++++++++++ .../knowcenter/pdf-as/maven-metadata-local.xml.md5 | 1 + .../knowcenter/pdf-as/maven-metadata-local.xml.sha1 | 1 + 9 files changed, 27 insertions(+) create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.md5 create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.sha1 create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.md5 create mode 100644 trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.sha1 create mode 100644 trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml create mode 100644 trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.md5 create mode 100644 trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.sha1 (limited to 'trunk') diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar new file mode 100644 index 00000000..d3320cb2 Binary files /dev/null and b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar differ diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.md5 b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.md5 new file mode 100644 index 00000000..9f4fe1ce --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.md5 @@ -0,0 +1 @@ +e0d05959883d17a865f1bf1fcc49bbf7 \ No newline at end of file diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.sha1 b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.sha1 new file mode 100644 index 00000000..b0987ac9 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.jar.sha1 @@ -0,0 +1 @@ +725091dca8b46b660fe51076388f8529f6a10fdc \ No newline at end of file diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom new file mode 100644 index 00000000..4ccfd110 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + knowcenter + pdf-as + 3.2 + POM was created from install:install-file + diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.md5 b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.md5 new file mode 100644 index 00000000..577e27e0 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.md5 @@ -0,0 +1 @@ +cacd4a2a2866807e77625d2d900f0281 \ No newline at end of file diff --git a/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.sha1 b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.sha1 new file mode 100644 index 00000000..cea141cb --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/3.2/pdf-as-3.2.pom.sha1 @@ -0,0 +1 @@ +d88f2b64bb34a6e4b4b197a1dc76778dd5952fa4 \ No newline at end of file diff --git a/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml new file mode 100644 index 00000000..f8c09e79 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + knowcenter + pdf-as + 3.2 + + + 3.2 + + 20121024121829 + + diff --git a/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.md5 b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.md5 new file mode 100644 index 00000000..0c59c5f6 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.md5 @@ -0,0 +1 @@ +be78dcdfdb88cedb00752c5533381634 \ No newline at end of file diff --git a/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.sha1 b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.sha1 new file mode 100644 index 00000000..9fbd5416 --- /dev/null +++ b/trunk/repo/knowcenter/pdf-as/maven-metadata-local.xml.sha1 @@ -0,0 +1 @@ +4ffd9b52c8953fa6c69f020f898cf159f942cdc7 \ No newline at end of file -- cgit v1.2.3 From 9bd2610c25862653afb945229a41e035e17e42d2 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 24 Oct 2012 14:27:34 +0200 Subject: Renamed PDFRenderer version --- .../pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar | Bin 0 -> 1615628 bytes .../0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.md5 | 1 + .../0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.sha1 | 1 + .../pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom | 9 +++++++++ .../0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.md5 | 1 + .../0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.sha1 | 1 + trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar | Bin 1615628 -> 0 bytes .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 | 1 - .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 | 1 - trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom | 9 --------- .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 | 1 - .../repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 | 1 - trunk/repo/com/sun/pdfview/maven-metadata-local.xml | 6 +++--- .../repo/com/sun/pdfview/maven-metadata-local.xml.md5 | 2 +- .../com/sun/pdfview/maven-metadata-local.xml.sha1 | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.md5 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.sha1 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.md5 create mode 100644 trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.sha1 delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 delete mode 100644 trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 (limited to 'trunk') diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar new file mode 100644 index 00000000..c051ff39 Binary files /dev/null and b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar differ diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.md5 b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.md5 new file mode 100644 index 00000000..50fa9fb3 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.md5 @@ -0,0 +1 @@ +0574d4b45cbb919a39122824a76ff2fb \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.sha1 b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.sha1 new file mode 100644 index 00000000..eb8e5140 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.jar.sha1 @@ -0,0 +1 @@ +3517175e667aa454f8c7a014b01e4f9ee59cf2b6 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom new file mode 100644 index 00000000..5b518927 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + com.sun + pdfview + 0.9.2-Borisvl + POM was created from install:install-file + diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.md5 b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.md5 new file mode 100644 index 00000000..d56ddc67 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.md5 @@ -0,0 +1 @@ +95d76d70920beb27b5171bd0282a22d5 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.sha1 b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.sha1 new file mode 100644 index 00000000..ad0e94b5 --- /dev/null +++ b/trunk/repo/com/sun/pdfview/0.9.2-Borisvl/pdfview-0.9.2-Borisvl.pom.sha1 @@ -0,0 +1 @@ +514daec85cd5b97c216086f3c890222318ef1050 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar deleted file mode 100644 index c051ff39..00000000 Binary files a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar and /dev/null differ diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 deleted file mode 100644 index 50fa9fb3..00000000 --- a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -0574d4b45cbb919a39122824a76ff2fb \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 deleted file mode 100644 index eb8e5140..00000000 --- a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3517175e667aa454f8c7a014b01e4f9ee59cf2b6 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom deleted file mode 100644 index c2a115d0..00000000 --- a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom +++ /dev/null @@ -1,9 +0,0 @@ - - - 4.0.0 - com.sun - pdfview - 0.9.2 - POM was created from install:install-file - diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 deleted file mode 100644 index 5b55cf15..00000000 --- a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -f4d6cdf65e8230987340e43e0bb18373 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 b/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 deleted file mode 100644 index 9203424a..00000000 --- a/trunk/repo/com/sun/pdfview/0.9.2/pdfview-0.9.2.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -a56e3f8c021d8586a9236ca114136ce3c075a73a \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml index 3b333323..b559b782 100644 --- a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml @@ -2,11 +2,11 @@ com.sun pdfview - 0.9.2 + 0.9.2-Borisvl - 0.9.2 + 0.9.2-Borisvl - 20121023171708 + 20121024122652 diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 index b69dcb6a..7fe8ca0a 100644 --- a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.md5 @@ -1 +1 @@ -95bd0fc3631723abc442b1e8a6577eb8 \ No newline at end of file +f966fbc4fc078a8abdbf5a228e329f50 \ No newline at end of file diff --git a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 index bc8dc80b..cbb7e210 100644 --- a/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 +++ b/trunk/repo/com/sun/pdfview/maven-metadata-local.xml.sha1 @@ -1 +1 @@ -1ded7fa89decc8f1732c5538965db3bb3b2349ae \ No newline at end of file +b958accd1536f5dc54be571d07af3d288a13752f \ No newline at end of file -- cgit v1.2.3 From ceef4ee0c2efe466f1f754d2aa56804fd086ce24 Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 24 Oct 2012 14:28:28 +0200 Subject: Use new PDFRenderer version --- trunk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trunk') diff --git a/trunk/pom.xml b/trunk/pom.xml index ae005667..5555e1f3 100644 --- a/trunk/pom.xml +++ b/trunk/pom.xml @@ -163,7 +163,7 @@ com.sun pdfview - 0.9.2 + 0.9.2-Borisvl -- cgit v1.2.3 From 1b35ac9c8f28392a0e157355b4b73fbb6886a9f9 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 24 Oct 2012 14:45:00 +0200 Subject: + Mobile icon added + main window shell icon added --- .../main/java/at/asit/pdfover/gui/MainWindow.java | 6 +++++ .../composites/MobileBKUEnterNumberComposite.java | 27 ++++++++++++++++++---- .../gui/composites/MobileBKUEnterTANComposite.java | 25 ++++++++++++++++---- 3 files changed, 50 insertions(+), 8 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index d981189d..d9bfe86f 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java @@ -191,6 +191,12 @@ public class MainWindow { getShell().setSize(1024, 768); getShell().setText(Messages.getString("main.title")); //$NON-NLS-1$ + ImageData data = new ImageData(this.getClass().getResourceAsStream("/img/icon.png"));//$NON-NLS-1$ + Image shellicon = new Image(this.shell.getDisplay(), data); + + this.shell.setImage(shellicon); + + getShell().setLayout(new FormLayout()); this.mainbar = new Composite(getShell(), SWT.NONE); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index da685f62..fb716104 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -24,6 +24,8 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; @@ -192,8 +194,8 @@ public class MobileBKUEnterNumberComposite extends StateComposite { FormData fd_containerComposite = new FormData(); fd_containerComposite.top = new FormAttachment(50, -100); fd_containerComposite.bottom = new FormAttachment(50, 100); - fd_containerComposite.left = new FormAttachment(50, -250); - fd_containerComposite.right = new FormAttachment(50, 250); + fd_containerComposite.left = new FormAttachment(50, -200); + fd_containerComposite.right = new FormAttachment(50, 200); containerComposite.setLayoutData(fd_containerComposite); @@ -206,15 +208,31 @@ public class MobileBKUEnterNumberComposite extends StateComposite { this.txt_number.setLayoutData(fd_number); this.txt_number.setEditable(true); + Label lbl_number = new Label(containerComposite, SWT.NATIVE); + lbl_number.setAlignment(SWT.RIGHT); lbl_number.setText(Messages.getString("mobileBKU.number")); //$NON-NLS-1$ FormData fd_lbl_number = new FormData(); //fd_lbl_number.top = new FormAttachment(30, -15); fd_lbl_number.bottom = new FormAttachment(50, -10); - fd_lbl_number.left = new FormAttachment(0, 20); + //fd_lbl_number.left = new FormAttachment(0, 20); fd_lbl_number.right = new FormAttachment(50, -10); lbl_number.setLayoutData(fd_lbl_number); + Label lbl_image = new Label(containerComposite, SWT.NATIVE); + + ImageData data = new ImageData(this.getClass().getResourceAsStream("/img/handy.gif"));//$NON-NLS-1$ + Image mobile = new Image(getDisplay(), data); + + FormData fd_lbl_image = new FormData(); + fd_lbl_image.top = new FormAttachment(50, -1 * (data.width / 2)); + fd_lbl_image.bottom = new FormAttachment(50, data.width / 2); + fd_lbl_image.left = new FormAttachment(0, 10); + fd_lbl_image.width = data.width; + lbl_image.setLayoutData(fd_lbl_image); + lbl_image.setImage(mobile); + + this.txt_password = new Text(containerComposite, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER | SWT.NATIVE); FormData fd_password = new FormData(); @@ -235,11 +253,12 @@ public class MobileBKUEnterNumberComposite extends StateComposite { }); Label lbl_password = new Label(containerComposite, SWT.NATIVE); + lbl_password.setAlignment(SWT.RIGHT); lbl_password.setText(Messages.getString("mobileBKU.password")); //$NON-NLS-1$ FormData fd_lbl_password = new FormData(); fd_lbl_password.top = new FormAttachment(50, 10); //fd_lbl_password.bottom = new FormAttachment(50, 15); - fd_lbl_password.left = new FormAttachment(0, 20); + //fd_lbl_password.left = new FormAttachment(0, 20); fd_lbl_password.right = new FormAttachment(50, -10); lbl_password.setLayoutData(fd_lbl_password); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index 683ebd12..833d2670 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -26,6 +26,8 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; @@ -198,20 +200,34 @@ public class MobileBKUEnterTANComposite extends StateComposite { FormData fd_containerComposite = new FormData(); fd_containerComposite.top = new FormAttachment(50, -100); fd_containerComposite.bottom = new FormAttachment(50, 100); - fd_containerComposite.left = new FormAttachment(50, -250); - fd_containerComposite.right = new FormAttachment(50, 250); + fd_containerComposite.left = new FormAttachment(50, -200); + fd_containerComposite.right = new FormAttachment(50, 200); containerComposite.setLayoutData(fd_containerComposite); Label lblVergleichswert = new Label(containerComposite, SWT.NATIVE); + lblVergleichswert.setAlignment(SWT.RIGHT); FormData fd_lblVergleichswert = new FormData(); - fd_lblVergleichswert.left = new FormAttachment(0, 20); + //fd_lblVergleichswert.left = new FormAttachment(0, 20); fd_lblVergleichswert.right = new FormAttachment(50, -10); //fd_lblVergleichswert.top = new FormAttachment(30, -15); fd_lblVergleichswert.bottom = new FormAttachment(50, -10); lblVergleichswert.setLayoutData(fd_lblVergleichswert); lblVergleichswert.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ + Label lbl_image = new Label(containerComposite, SWT.NATIVE); + + ImageData data = new ImageData(this.getClass().getResourceAsStream("/img/handy.gif"));//$NON-NLS-1$ + Image mobile = new Image(getDisplay(), data); + + FormData fd_lbl_image = new FormData(); + fd_lbl_image.top = new FormAttachment(50, -1 * (data.width / 2)); + fd_lbl_image.bottom = new FormAttachment(50, data.width / 2); + fd_lbl_image.left = new FormAttachment(0, 10); + fd_lbl_image.width = data.width; + lbl_image.setLayoutData(fd_lbl_image); + lbl_image.setImage(mobile); + this.lblvergleich = new Label(containerComposite, SWT.NATIVE); FormData fd_lblvergleich = new FormData(); fd_lblvergleich.left = new FormAttachment(50, 10); @@ -222,8 +238,9 @@ public class MobileBKUEnterTANComposite extends StateComposite { this.lblvergleich.setText(""); //$NON-NLS-1$ Label lblTan = new Label(containerComposite, SWT.NATIVE); + lblTan.setAlignment(SWT.RIGHT); FormData fd_lblTan = new FormData(); - fd_lblTan.left = new FormAttachment(0, 20); + //fd_lblTan.left = new FormAttachment(0, 20); fd_lblTan.right = new FormAttachment(50, -10); fd_lblTan.top = new FormAttachment(50, 10); //fd_lblTan.bottom = new FormAttachment(50, 15); -- cgit v1.2.3 From f617a0d0435f5c6822fd00ef79ce73314a4e90ce Mon Sep 17 00:00:00 2001 From: Tobias Kellner Date: Wed, 24 Oct 2012 14:56:11 +0200 Subject: add maindir property for local repo --- trunk/pdf-over-gui/pom.xml | 3 ++- trunk/pdf-over-signer/pdf-over-sigpdfas/pom.xml | 5 ++++- trunk/pom.xml | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/pom.xml b/trunk/pdf-over-gui/pom.xml index ef3b745e..050097ae 100644 --- a/trunk/pdf-over-gui/pom.xml +++ b/trunk/pdf-over-gui/pom.xml @@ -184,6 +184,7 @@ ${project.build.directory}/staging linux 4.3.5 + ${project.basedir}/.. @@ -295,4 +296,4 @@ - \ No newline at end of file + diff --git a/trunk/pdf-over-signer/pdf-over-sigpdfas/pom.xml b/trunk/pdf-over-signer/pdf-over-sigpdfas/pom.xml index 7a1122ea..3316cc55 100644 --- a/trunk/pdf-over-signer/pdf-over-sigpdfas/pom.xml +++ b/trunk/pdf-over-signer/pdf-over-sigpdfas/pom.xml @@ -9,6 +9,9 @@ pdf-over-sigpdfas PDF-Over PDF-AS Signer + + ${project.basedir}/../.. + a-sit.at @@ -21,4 +24,4 @@ 3.2 - \ No newline at end of file + diff --git a/trunk/pom.xml b/trunk/pom.xml index 5555e1f3..08bbc108 100644 --- a/trunk/pom.xml +++ b/trunk/pom.xml @@ -78,6 +78,7 @@ UTF-8 + ${project.basedir} @@ -186,7 +187,7 @@ local-repo - file://${project.basedir}/repo + file://${project.maindir}/repo - \ No newline at end of file + -- cgit v1.2.3