summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-09 13:19:42 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2020-11-09 13:19:42 +0100
commitad8cccc8a24e8238dba18f636a138d72f5d77057 (patch)
treeb42d2c7e3b5c29a5cc475fbfd0d1e7728cf49f70
parent0d7f6f56d7a359d6d67763000712dd6b153f741f (diff)
downloadpdf-over-ad8cccc8a24e8238dba18f636a138d72f5d77057.tar.gz
pdf-over-ad8cccc8a24e8238dba18f636a138d72f5d77057.tar.bz2
pdf-over-ad8cccc8a24e8238dba18f636a138d72f5d77057.zip
added new group for signature profile selection
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java96
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java8
5 files changed, 106 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
index a1ebfc44..5c74b78e 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java
@@ -55,6 +55,8 @@ public class Constants {
/** Supported locales */
public static final Locale[] SUPPORTED_LOCALES = { Locale.GERMAN, Locale.ENGLISH };
+
+ public static final String[] SUPPORTED_PROFILES = {"Signaturblock Normal", "Signaturblock Klein", "Amtssignaturblock", "Nur Bildmarke"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
/** Configuration directory */
public static final String CONFIG_DIRECTORY = System.getProperty("user.home") + File.separator + ".pdf-over"; //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index 7396a6b0..dc88834b 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -173,6 +173,7 @@ public class ConfigurationComposite extends StateComposite {
this.simpleTabItem = new TabItem(this.tabFolder, SWT.NONE);
this.simpleTabItem.setText(Messages.getString("config.Simple")); //$NON-NLS-1$
+ System.out.println(Messages.getString("config.Simple"));
ScrolledComposite simpleCompositeScr = new ScrolledComposite(this.tabFolder,
SWT.H_SCROLL | SWT.V_SCROLL);
@@ -188,6 +189,7 @@ public class ConfigurationComposite extends StateComposite {
this.advancedTabItem = new TabItem(this.tabFolder, SWT.NONE);
this.advancedTabItem.setText(Messages.getString("config.Advanced")); //$NON-NLS-1$
+ System.out.print(Messages.getString("config.Advanced"));
ScrolledComposite advancedCompositeScr = new ScrolledComposite(
this.tabFolder, SWT.H_SCROLL | SWT.V_SCROLL);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
index e54b4a59..c3e4a138 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
@@ -113,6 +113,11 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
String logoFile;
Image sigPreview = null;
Image logo = null;
+
+ private final Group grpSingnatureProfile;
+ private final Label lblSignatureProfile;
+ private final Combo cmbSingatureProfiles;
+
/**
* @param parent
@@ -198,12 +203,80 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
processNumberChanged();
}
});
+
+
+ //-----------------------------------------------------------------------
+
+ this.grpSingnatureProfile = new Group(this, SWT.NONE);
+
+ FormData fd_grpSingnatureProfile = new FormData();
+ fd_grpSingnatureProfile.right = new FormAttachment(100, -5);
+ fd_grpSingnatureProfile.left = new FormAttachment(0, 5);
+ fd_grpSingnatureProfile.top = new FormAttachment(this.grpHandySignatur, 5);
+ this.grpSingnatureProfile.setLayoutData(fd_grpSingnatureProfile);
+ this.grpSingnatureProfile.setLayout(new GridLayout(2, false));
+ this.grpSingnatureProfile.setText("Signature Profile");
+
+
+ this.lblSignatureProfile = new Label(this.grpSingnatureProfile, SWT.NONE);
+
+ FontData[] fD_grpSingnatureProfile = this.grpSingnatureProfile.getFont()
+ .getFontData();
+ fD_grpSingnatureProfile[0].setHeight(Constants.TEXT_SIZE_NORMAL);
+ this.grpSingnatureProfile.setFont(new Font(Display.getCurrent(),
+ fD_grpSingnatureProfile[0]));
+
+ // TODO create text for each language
+ this.lblSignatureProfile.setText("Profile"); //$NON-NLS-1$
+
+ FontData[] fD_lblSignatureProfile = this.lblSignatureProfile.getFont()
+ .getFontData();
+ fD_lblSignatureProfile[0].setHeight(Constants.TEXT_SIZE_NORMAL);
+ this.lblSignatureProfile.setFont(new Font(Display.getCurrent(),
+ fD_lblSignatureProfile[0]));
+
+ this.cmbSingatureProfiles = new Combo(this.grpSingnatureProfile, SWT.READ_ONLY);
+ FormData fd_cmbSingatureProfiles = new FormData();
+ fd_cmbSingatureProfiles.left = new FormAttachment(this.grpSingnatureProfile, 10);
+ fd_cmbSingatureProfiles.right = new FormAttachment(100, -10);
+ fd_cmbSingatureProfiles.top = new FormAttachment(0, 10);
+ fd_cmbSingatureProfiles.bottom = new FormAttachment(100, -10);
+ this.grpSingnatureProfile.setLayoutData(fd_cmbSingatureProfiles);
+
+ FontData[] fD_cmbSignatureLang = this.grpSingnatureProfile.getFont()
+ .getFontData();
+ fD_cmbSignatureLang[0].setHeight(Constants.TEXT_SIZE_NORMAL);
+ this.grpSingnatureProfile.setFont(new Font(Display.getCurrent(),
+ fD_cmbSignatureLang[0]));
+
+ String[] profiles = new String[Constants.SUPPORTED_PROFILES.length];
+ for (int i = 0; i < Constants.SUPPORTED_PROFILES.length; ++i) {
+ profiles[i] = Constants.SUPPORTED_PROFILES[i];
+ }
+ this.cmbSignatureLang.setItems(profiles);
+ this.cmbSignatureLang.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Locale currentLocale = SimpleConfigurationComposite.this.configurationContainer
+ .getSignatureLocale();
+ String selectedLocale = Constants.
+ SUPPORTED_PROFILES[SimpleConfigurationComposite.this.cmbSignatureLang
+ .getSelectionIndex()];
+ if (!currentLocale.equals(selectedLocale)) {
+ performSignatureLangSelectionChanged(selectedLocale, currentLocale);
+ }
+ }
+ });
+
+
+ //------------------------------------------------------------------------
+
this.grpLogo = new Group(this, SWT.NONE);
FormData fd_grpBildmarke = new FormData();
fd_grpBildmarke.left = new FormAttachment(0, 5);
fd_grpBildmarke.right = new FormAttachment(100, -5);
- fd_grpBildmarke.top = new FormAttachment(this.grpHandySignatur, 5);
+ fd_grpBildmarke.top = new FormAttachment(this.grpSingnatureProfile, 5);
this.grpLogo.setLayoutData(fd_grpBildmarke);
this.grpLogo.setLayout(new FormLayout());
@@ -411,16 +484,16 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
fd_cmbSignatureLang.bottom = new FormAttachment(100, -10);
this.cmbSignatureLang.setLayoutData(fd_cmbSignatureLang);
- FontData[] fD_cmbSignatureLang = this.cmbSignatureLang.getFont()
- .getFontData();
- fD_cmbSignatureLang[0].setHeight(Constants.TEXT_SIZE_NORMAL);
+// FontData[] fD_cmbSignatureLang = this.cmbSignatureLang.getFont()
+// .getFontData();
+// fD_cmbSignatureLang[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.cmbSignatureLang.setFont(new Font(Display.getCurrent(),
fD_cmbSignatureLang[0]));
- String[] localeSignStrings = new String[Constants.SUPPORTED_LOCALES.length];
- for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; ++i) {
- localeSignStrings[i] = Constants.SUPPORTED_LOCALES[i].getDisplayLanguage();
- }
+// String[] localeSignStrings = new String[Constants.SUPPORTED_LOCALES.length];
+// for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; ++i) {
+// localeSignStrings[i] = Constants.SUPPORTED_LOCALES[i].getDisplayLanguage();
+// }
this.cmbSignatureLang.setItems(localeSignStrings);
this.cmbSignatureLang.addSelectionListener(new SelectionAdapter() {
@Override
@@ -705,6 +778,13 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
}
}
}
+
+ private void preformProfileSelectionChanged(String selected, String previous) {
+
+
+
+
+ }
/*
* (non-Javadoc)
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java
index d5976b3c..668c8cb7 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainer.java
@@ -412,4 +412,10 @@ public interface ConfigurationContainer {
* @return boolean
*/
public boolean getEnablePlaceholderUsage();
+
+
+ /**
+ * @return selected signature profile as string
+ */
+ public String getSignatureProfile();
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
index 8269cb0b..e6b168dc 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
@@ -144,6 +144,9 @@ public class ConfigurationContainerImpl implements ConfigurationContainer {
/** Either QR-Code or signature fields as marker */
protected boolean useSignatureFields = false;
+
+ /** The Signature Profile */
+ protected String signatureProfile = "Normal"; //$NON-NLS-1$
/* (non-Javadoc)
* @see at.asit.pdfover.gui.composites.ConfigurationContainer#getEmblem()
@@ -723,4 +726,9 @@ public class ConfigurationContainerImpl implements ConfigurationContainer {
return this.enabledPlaceholderUsage;
}
+ @Override
+ public String getSignatureProfile() {
+ return this.signatureProfile;
+ }
+
}