From d658f95290ea03bd0ecdc01110b48244b28e6f19 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Fri, 13 Nov 2020 13:49:59 +0100 Subject: refactored Profile --- .../main/java/at/asit/pdfover/commons/Profile.java | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java (limited to 'pdf-over-commons/src/main/java/at/asit/pdfover') diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java new file mode 100644 index 00000000..84de1aaa --- /dev/null +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java @@ -0,0 +1,58 @@ +package at.asit.pdfover.commons; + +public enum Profile { + + SIGNATURBLOCK("Signaturblock Normal") , //$NON-NLS-1$ + SIGNATURBLOCK_SMALL("Signaturblock Klein"), //$NON-NLS-1$ + AMTSSIGNATURBLOCK("Amtssignatur"), //$NON-NLS-1$ + LOGO_ONLY("Nur Bildmarke"), //$NON-NLS-1$ + INVISIBLE("Unsichtbar"); + + public static int length = 5; + private String name; + + Profile(String profile){ + this.name = profile; + } + + public static String[] getProfileStrings() { + String[] profiles = new String[Profile.length]; + int i = 0; + for (Profile profile : Profile.values()) { + profiles[i] = profile.getName(); + i++; + } + return profiles; + } + + public static Profile getProfileByIndex(int index) { + String[] profiles = getProfileStrings(); + if (profiles.length < index) { + return null; + } + return getProfile(profiles[index]); + } + + public String getName() { + return this.name; + } + + public static Profile getProfile(String profile) { + if (SIGNATURBLOCK.getName().equals(profile)) { + return SIGNATURBLOCK; + } else if (SIGNATURBLOCK_SMALL.getName().equals(profile)) { + return SIGNATURBLOCK_SMALL; + } else if (AMTSSIGNATURBLOCK.getName().equals(profile)) { + return AMTSSIGNATURBLOCK; + } else if (LOGO_ONLY.getName().equals(profile)) { + return LOGO_ONLY; + } else if (INVISIBLE.getName().equals(profile)){ + return INVISIBLE; + } + return null; + } + + + + +} -- cgit v1.2.3 From af14459241ed7c653531f769216d4e97d3c9ef2f Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Wed, 18 Nov 2020 13:54:40 +0100 Subject: changes in pom and SignatureProfle --- .../src/main/java/at/asit/pdfover/commons/Profile.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'pdf-over-commons/src/main/java/at/asit/pdfover') diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java index 84de1aaa..d9694f18 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java @@ -2,13 +2,12 @@ package at.asit.pdfover.commons; public enum Profile { - SIGNATURBLOCK("Signaturblock Normal") , //$NON-NLS-1$ - SIGNATURBLOCK_SMALL("Signaturblock Klein"), //$NON-NLS-1$ + SIGNATURBLOCK_SMALL("Signaturblock Normal"), //$NON-NLS-1$ AMTSSIGNATURBLOCK("Amtssignatur"), //$NON-NLS-1$ - LOGO_ONLY("Nur Bildmarke"), //$NON-NLS-1$ + BASE_LOGO("Nur Bildmarke"), //$NON-NLS-1$ INVISIBLE("Unsichtbar"); - public static int length = 5; + public static int length = 4; private String name; Profile(String profile){ @@ -38,14 +37,12 @@ public enum Profile { } public static Profile getProfile(String profile) { - if (SIGNATURBLOCK.getName().equals(profile)) { - return SIGNATURBLOCK; - } else if (SIGNATURBLOCK_SMALL.getName().equals(profile)) { + if (SIGNATURBLOCK_SMALL.getName().equals(profile)) { return SIGNATURBLOCK_SMALL; } else if (AMTSSIGNATURBLOCK.getName().equals(profile)) { return AMTSSIGNATURBLOCK; - } else if (LOGO_ONLY.getName().equals(profile)) { - return LOGO_ONLY; + } else if (BASE_LOGO.getName().equals(profile)) { + return BASE_LOGO; } else if (INVISIBLE.getName().equals(profile)){ return INVISIBLE; } -- cgit v1.2.3 From ebade6f73b9e3c1f5c93bb0e1c7b48c47061d104 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 10:44:50 +0100 Subject: Added English and German values for Signature Profile description --- pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'pdf-over-commons/src/main/java/at/asit/pdfover') diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java index d9694f18..ef2eccd8 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Profile.java @@ -50,6 +50,4 @@ public enum Profile { } - - } -- cgit v1.2.3