From 45b3417659761a96335605e588faf62a8a5a18c3 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 7 Jul 2022 15:44:04 +0200 Subject: auto positioning cleanup --- .../configuration/AdvancedConfigurationComposite.java | 11 ++++------- .../configuration/SimpleConfigurationComposite.java | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java index be872c1e..b2db3875 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java @@ -57,7 +57,6 @@ import at.asit.pdfover.gui.workflow.config.ConfigurationManager; import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.BKUs; -import at.asit.pdfover.signator.SignaturePosition; /** * Composite for advanced configuration @@ -532,8 +531,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { void performPositionSelection(boolean automatic) { log.debug("Selected Position: {}", automatic); - SignaturePosition pos = automatic ? new SignaturePosition() : null; - this.configurationContainer.defaultSignaturePosition = pos; + this.configurationContainer.autoPositionSignature = automatic; this.btnAutomatischePositionierung.setSelection(automatic); } @@ -648,7 +646,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { @Override public void initConfiguration(ConfigurationManager provider) { - this.configurationContainer.defaultSignaturePosition = provider.getDefaultSignaturePositionPersistent(); + this.configurationContainer.autoPositionSignature = provider.getAutoPositionSignaturePersistent(); this.configurationContainer.setUseMarker(provider.getUseMarker()); this.configurationContainer.setUseSignatureFields(provider.getUseSignatureFields()); this.configurationContainer.enabledPlaceholderUsage = provider.getEnablePlaceholderUsage(); @@ -696,8 +694,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { } else { performPostFixChanged(Constants.DEFAULT_POSTFIX); } - SignaturePosition pos = this.configurationContainer.defaultSignaturePosition; - performPositionSelection(pos != null && pos.useAutoPositioning()); + performPositionSelection(this.configurationContainer.autoPositionSignature); performUseMarkerSelection(this.configurationContainer.getUseMarker()); performUseSignatureFieldsSelection(this.configurationContainer.getUseSignatureFields()); performEnableUsePlaceholder(this.configurationContainer.enabledPlaceholderUsage); @@ -740,7 +737,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { @Override public void storeConfiguration(ConfigurationManager store) { - store.setDefaultSignaturePosition(this.configurationContainer.defaultSignaturePosition); + store.setAutoPositionSignature(this.configurationContainer.autoPositionSignature); store.setUseMarker(this.configurationContainer.getUseMarker()); store.setUseSignatureFields(this.configurationContainer.getUseSignatureFields()); store.setEnablePlaceholderUsage(this.configurationContainer.enabledPlaceholderUsage); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java index c8d9c208..887ea91a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java @@ -68,7 +68,6 @@ import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.CachedFileNameEmblem; import at.asit.pdfover.signator.SignatureParameter; -import at.asit.pdfover.signator.SignaturePosition; /** * @@ -539,7 +538,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.cmbSignatureProfiles.select(newProfile.ordinal()); if (newProfile.equals(Profile.AMTSSIGNATURBLOCK) || newProfile.equals(Profile.INVISIBLE)){ - this.configurationContainer.defaultSignaturePosition = new SignaturePosition(); + this.configurationContainer.autoPositionSignature = true; } setSignatureProfileSetting(); if (txtSignatureNote.getText().equals(getDefaultSignatureBlockNoteTextFor(oldProfile, null))) -- cgit v1.2.3