summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-03 14:09:46 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-08-03 14:09:46 +0200
commit8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0 (patch)
tree858249b882cccd070ecf918fd9b3971ff1e03def /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
parent761431947a2c6bc1e14ea848b97eee0f9a950171 (diff)
downloadpdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.tar.gz
pdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.tar.bz2
pdf-over-8ed8c7ff59cf052aaab1fbe07deca55aa1dcacc0.zip
exterminate SignaturePlaceholderCache
(it does not offer any measurable benefit)
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java5
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java7
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java4
3 files changed, 8 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index d9263d72..1336d7b6 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -187,12 +187,11 @@ public class PositioningComposite extends StateComposite {
* @param transparency
* transparency of the signature placeholder (0 - 255)
*/
- public void setPlaceholder(final Image placeholder, final int width, final int height,
- final int transparency) {
+ public void setPlaceholder(final Image placeholder, final int transparency) {
EventQueue.invokeLater(() -> {
if (this.viewer == null)
return;
- this.viewer.setSignaturePlaceholder(placeholder, width, height, transparency);
+ this.viewer.setSignaturePlaceholder(placeholder, transparency);
});
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
index 34837b2d..879a3e98 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
@@ -150,10 +150,11 @@ public class SignaturePanel extends JPanel {
* @param height height of the placeholder in page space
* @param transparency transparency of the signature placeholder (0 - 255)
*/
- public void setSignaturePlaceholder(Image placeholder, int width, int height, int transparency) {
+ public void setSignaturePlaceholder(Image placeholder, int transparency) {
this.sigPlaceholder = placeholder;
- this.sigPageWidth = width;
- this.sigPageHeight = height;
+ // TODO figure out why this is divided by 4 (factor ported from old code)
+ this.sigPageWidth = placeholder.getWidth(null) / 4;
+ this.sigPageHeight = placeholder.getHeight(null) / 4;
this.sigPlaceholderTransparency = transparency;
}
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 3d351292..34155668 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
@@ -15,6 +15,7 @@
*/
package at.asit.pdfover.gui.composites.configuration;
+import java.awt.image.BufferedImage;
// Imports
import java.io.File;
import java.io.IOException;
@@ -62,7 +63,6 @@ import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.ErrorMarker;
import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
import at.asit.pdfover.gui.utils.ImageConverter;
-import at.asit.pdfover.gui.utils.SignaturePlaceholderCache;
import at.asit.pdfover.gui.workflow.config.ConfigurationManager;
import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory;
import at.asit.pdfover.gui.workflow.states.State;
@@ -434,7 +434,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase {
logo = new ImageData(image);
param.emblem = new Emblem(image);
}
- img = SignaturePlaceholderCache.getSWTPlaceholder(param);
+ img = ImageConverter.convertToSWT((BufferedImage) param.getPlaceholder());
} catch (Exception e) {
log.error("Failed to load image for display...", e);
}