From b232a5f78c786d3769096aebc9c13679ce35c169 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:01:23 +0000 Subject: + fixed Warnings git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@85 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../at/asit/pdfover/signer/pdfas/PDFASHelper.java | 4 ++++ .../at/asit/pdfover/signer/pdfas/PDFASSigner.java | 14 +++++--------- .../signer/pdfas/PdfAsSignatureParameter.java | 20 +++++++++++++------- 3 files changed, 22 insertions(+), 16 deletions(-) (limited to 'pdf-over-signer/pdf-over-sigpdfas/src/main/java/at') diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java index 2553eaad..d16b7532 100644 --- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java +++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASHelper.java @@ -50,6 +50,10 @@ public class PDFASHelper { return new at.gv.egiz.pdfas.impl.api.PdfAsObject(); } + /** + * Provides the working directory + * @return the working directory + */ public static String getWorkDir() { return System.getProperty("user.home")+"/.pdfover"; } diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java index 91581a17..516a54ad 100644 --- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java +++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PDFASSigner.java @@ -1,31 +1,27 @@ package at.asit.pdfover.signer.pdfas; -import java.util.Iterator; -import java.util.List; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.ByteArrayDocumentSource; import at.asit.pdfover.signator.SLResponse; -import at.asit.pdfover.signator.SignatureException; -import at.asit.pdfover.signator.Signer; import at.asit.pdfover.signator.SignResult; import at.asit.pdfover.signator.SignResultImpl; +import at.asit.pdfover.signator.SignatureException; import at.asit.pdfover.signator.SignatureParameter; import at.asit.pdfover.signator.SignaturePosition; +import at.asit.pdfover.signator.Signer; import at.asit.pdfover.signator.SigningState; import at.asit.pdfover.signer.pdfas.exceptions.PDFASSLRequestException; import at.gv.egiz.pdfas.api.PdfAs; -import at.gv.egiz.pdfas.api.sign.SignParameters; -import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation; -import at.gv.egiz.pdfas.io.ByteArrayDataSink; import at.gv.egiz.pdfas.api.commons.Constants; import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.internal.LocalBKUParams; import at.gv.egiz.pdfas.api.internal.PdfAsInternal; -import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; +import at.gv.egiz.pdfas.api.sign.SignParameters; +import at.gv.egiz.pdfas.api.sign.SignatureDetailInformation; +import at.gv.egiz.pdfas.io.ByteArrayDataSink; /** * PDF AS Signer Implementation diff --git a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java index eb598f07..ab44d1b4 100644 --- a/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java +++ b/pdf-over-signer/pdf-over-sigpdfas/src/main/java/at/asit/pdfover/signer/pdfas/PdfAsSignatureParameter.java @@ -20,7 +20,6 @@ import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Image; -import java.awt.ImageCapabilities; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; @@ -36,7 +35,6 @@ import at.asit.pdfover.signator.SignatureDimension; import at.asit.pdfover.signator.SignatureException; import at.asit.pdfover.signator.SignatureParameter; import at.asit.pdfover.signator.SignaturePosition; -import at.asit.pdfover.signer.pdfas.exceptions.PDFASSLRequestException; import at.gv.egiz.pdfas.api.io.DataSource; import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning; import at.gv.egiz.pdfas.impl.signator.binary.BinarySignator_1_1_0; @@ -174,7 +172,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { } } - private Font getFont(Style style) { + private static Font getFont(Style style) { String def = "COURIER-NORMAL-8"; String fontString = style.getFont(); String[] font_arr = fontString.split(","); @@ -186,7 +184,13 @@ public class PdfAsSignatureParameter extends SignatureParameter { } - private Font getValueFont(Style style) { + /** + * extracts the value font + * @param style the table style + * @return the value font + */ + @SuppressWarnings("unused") + private static Font getValueFont(Style style) { String def = "COURIER-NORMAL-8"; String fontString = style.getValueFont(); String[] font_arr = fontString.split(","); @@ -197,6 +201,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { font_arr[1])); } + @SuppressWarnings("rawtypes") private int drawTable(int xoff, int yoff, int width, int height, Table table, Style parentstyle, Graphics graphic, float[] heights) { Style style = parentstyle; @@ -207,8 +212,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { log.debug(String.format("Table@ %dx%d", xoff, yoff)); Font oldFont = graphic.getFont(); - Font font = this.getFont(style); - Font valuefont = this.getValueFont(style); + Font font = PdfAsSignatureParameter.getFont(style); // draw background // graphic.setColor(style.getBgColor()); @@ -285,7 +289,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { float[] cheights = this.getTableHeights( (Table) entry.getValue(), style, rsize); - int tsize = this.drawTable( + this.drawTable( (int) (xoff + offset), (int) (yoff + roffset), (int) (colWidths[j] * perUnit), @@ -308,6 +312,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { private float perUnitHeight = 0; + @SuppressWarnings("rawtypes") private float[] getTableHeights(Table table, Style parentstyle, float height) { ArrayList rows = table.getRows(); float[] sizes = new float[rows.size()]; @@ -356,6 +361,7 @@ public class PdfAsSignatureParameter extends SignatureParameter { return sizes; } + @SuppressWarnings("rawtypes") private float getTableHeight(Table table, Style parentstyle) { ArrayList rows = table.getRows(); Style style = parentstyle; -- cgit v1.2.3