summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:38:16 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:38:16 +0000
commit4c855f38594a63060061d90f17b62cfe47aab533 (patch)
tree65692521cde693caf361d8d2f9dda0e84e361d9e /pdf-over-gui/src/main/java
parentea349f87b971751dfefc21a2bb60ce8a6d61061b (diff)
downloadpdf-over-4c855f38594a63060061d90f17b62cfe47aab533.tar.gz
pdf-over-4c855f38594a63060061d90f17b62cfe47aab533.tar.bz2
pdf-over-4c855f38594a63060061d90f17b62cfe47aab533.zip
Add cmd line arg for automatic positioning
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@428 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java48
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java2
2 files changed, 50 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java
new file mode 100644
index 00000000..3c6b9f3e
--- /dev/null
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java
@@ -0,0 +1,48 @@
+/*
+ * 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.cliarguments;
+
+import at.asit.pdfover.gui.exceptions.InitializationException;
+import at.asit.pdfover.signator.SignaturePosition;
+
+/**
+ * CLI Argument to set the BKU to use
+ */
+public class AutomaticPositioningArgument extends Argument {
+ /**
+ * Constructor
+ */
+ public AutomaticPositioningArgument() {
+ super(new String[] { "-a" }, "argument.help.autopos"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.asit.pdfover.gui.cliarguments.CLIArgument#handleArgument(java.lang
+ * .String[], int, at.asit.pdfover.gui.workflow.StateMachine,
+ * at.asit.pdfover.gui.cliarguments.ArgumentHandler)
+ */
+ @Override
+ public int handleArgument(String[] args, int argOffset,
+ ArgumentHandler handler)
+ throws InitializationException {
+ getConfiguration().setDefaultSignaturePositionOverlay(new SignaturePosition());
+ return argOffset;
+ }
+
+}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
index bf0694d4..d0f1f014 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.cliarguments.ArgumentHandler;
+import at.asit.pdfover.gui.cliarguments.AutomaticPositioningArgument;
import at.asit.pdfover.gui.cliarguments.BKUArgument;
import at.asit.pdfover.gui.cliarguments.ConfigFileArgument;
import at.asit.pdfover.gui.cliarguments.EmblemArgument;
@@ -71,6 +72,7 @@ public class PrepareConfigurationState extends State {
super(stateMachine);
this.handler = new ArgumentHandler(this.stateMachine);
this.handler.addCLIArgument(HelpArgument.class);
+ this.handler.addCLIArgument(AutomaticPositioningArgument.class);
this.handler.addCLIArgument(BKUArgument.class);
this.handler.addCLIArgument(PhoneNumberArgument.class);
this.handler.addCLIArgument(EmblemArgument.class);