From 4c855f38594a63060061d90f17b62cfe47aab533 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:38:16 +0000 Subject: 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 --- .../cliarguments/AutomaticPositioningArgument.java | 48 ++++++++++++++++++++++ .../workflow/states/PrepareConfigurationState.java | 2 + .../at/asit/pdfover/gui/messages.properties | 21 +++++----- .../at/asit/pdfover/gui/messages_de.properties | 3 +- 4 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java (limited to 'pdf-over-gui/src') 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); diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index e2247ec0..7557948f 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -22,7 +22,8 @@ advanced_config.SigPHTransparencyMax=Opaque advanced_config.SigPHTransparencyMin=Invisible advanced_config.SigPHTransparencyTooltip=Set the transparency of the signature placeholder in the positioning step argument.error.output=is not a directory -argument.help.bku=Select the CCE to use. Values are: LOCAL, MOBILE. Example: -b