summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2012-10-23 15:46:53 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2012-10-23 15:46:53 +0200
commite96e9dd6bcab614a60fa491ef68017bea4862af3 (patch)
tree9e0e67fb085a1dd3a70b73ebd59c9faba1b5c5ab /trunk/pdf-over-gui/src/main/java
parent86f1565d19616563bfa492a3f7ab56135a2f7d7f (diff)
downloadpdf-over-e96e9dd6bcab614a60fa491ef68017bea4862af3.tar.gz
pdf-over-e96e9dd6bcab614a60fa491ef68017bea4862af3.tar.bz2
pdf-over-e96e9dd6bcab614a60fa491ef68017bea4862af3.zip
+ added Signator Placeholder generation for PDF-AS:
check: SignatureParameter.getPlaceholder()
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java')
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java20
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java8
2 files changed, 23 insertions, 5 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
index 32b44a78..5c7af927 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
+++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java
@@ -309,7 +309,7 @@ public abstract class MainBarButton extends Canvas {
*/
protected void paintText(PaintEvent e) {
Point size = this.getSize();
- int height = size.y - 2;
+ int height = size.y;
int width = size.x;
@@ -351,9 +351,21 @@ public abstract class MainBarButton extends Canvas {
e.gc.setForeground(current);
} else {
- int imgx = (width - height) / 2;
- Image tmp = new Image(getDisplay(), this.image.getImageData());
- e.gc.drawImage(tmp, imgx, 0);
+
+ //log.debug("Width: " + width + " Height: " + height);
+
+ int w = 0;
+ Image tmp = null;
+ if(this.image.getImageData().width < width) {
+ tmp = new Image(getDisplay(), this.image.getImageData());
+ w = (width - this.image.getImageData().width) / 2;
+ } else if(this.image.getImageData().width > width) {
+ tmp = new Image(getDisplay(), this.image.getImageData().scaledTo(width, width));
+ } else {
+ tmp = new Image(getDisplay(), this.image.getImageData());
+ }
+
+ e.gc.drawImage(tmp, w, w);
}
}
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();