aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
diff options
context:
space:
mode:
authornetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-29 12:00:22 +0000
committernetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-29 12:00:22 +0000
commit61a2d23ef72630934c603fe9ffb96ebebff6ee09 (patch)
treece05c4470d3a7a2743b4956f512288d6d0d62187 /src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
parent00809217ec7c890a844f9a7c667c71b550ad92a6 (diff)
downloadpdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.tar.gz
pdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.tar.bz2
pdf-as-3-61a2d23ef72630934c603fe9ffb96ebebff6ee09.zip
PDF-AS API
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@233 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java189
1 files changed, 189 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
new file mode 100644
index 0000000..b9e2c8a
--- /dev/null
+++ b/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java
@@ -0,0 +1,189 @@
+/**
+ *
+ */
+package at.gv.egiz.pdfas.api.sign.pos;
+
+import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.axis.AutoAxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.axis.AxisAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.AbsolutePageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.AutoPageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.NewPageAlgorithm;
+import at.gv.egiz.pdfas.api.sign.pos.page.PageAlgorithm;
+
+/**
+ * Defines how the signature positioning is to be performed.
+ *
+ * <p>
+ * This positioning allows to select the location where the signature block is
+ * placed in the document.
+ * </p>
+ *
+ * @author wprinz
+ */
+public class SignaturePositioning
+{
+ /**
+ * The x axis algorithm.
+ *
+ * <p>
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ * </p>
+ */
+ protected AxisAlgorithm xAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The y axis algorithm.
+ *
+ * <p>
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ * </p>
+ */
+ protected AxisAlgorithm yAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The width algorithm.
+ *
+ * <p>
+ * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
+ * </p>
+ */
+ protected AxisAlgorithm widthAlgorithm = new AutoAxisAlgorithm();
+
+ /**
+ * The page algorithm.
+ *
+ * <p>
+ * May be {@link AutoPageAlgorithm}, {@link AbsolutePageAlgorithm} or
+ * {@link NewPageAlgorithm}
+ * </p>
+ */
+ protected PageAlgorithm pageAlgorithm = new AutoPageAlgorithm();
+
+ /**
+ * Provides the position of the footline.
+ *
+ * <p>
+ * Only used if the pageAlgorithm is {@link AutoPageAlgorithm} and the
+ * yAlgorithm is {@link AutoAxisAlgorithm}
+ * </p>
+ */
+ protected float footerLine = 0.0f;
+
+ protected void checkAxisAlgorithm(AxisAlgorithm algorithm)
+ {
+ if (algorithm == null)
+ {
+ throw new IllegalArgumentException("The algorithm must not be null.");
+ }
+ if (!(algorithm instanceof AutoAxisAlgorithm) && !(algorithm instanceof AbsoluteAxisAlgorithm))
+ {
+ throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
+ }
+ }
+
+ protected void checkPageAlgorithm(PageAlgorithm algorithm)
+ {
+ if (algorithm == null)
+ {
+ throw new IllegalArgumentException("The algorithm must not be null.");
+ }
+ if (!(algorithm instanceof AutoPageAlgorithm) && !(algorithm instanceof AbsolutePageAlgorithm) && !(algorithm instanceof NewPageAlgorithm))
+ {
+ throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
+ }
+
+ }
+
+ /**
+ * @return the xAlgorithm
+ */
+ public AxisAlgorithm getXAlgorithm()
+ {
+ return this.xAlgorithm;
+ }
+
+ /**
+ * @param algorithm
+ * the xAlgorithm to set
+ */
+ public void setXAlgorithm(AxisAlgorithm algorithm)
+ {
+ checkAxisAlgorithm(algorithm);
+ xAlgorithm = algorithm;
+ }
+
+ /**
+ * @return the yAlgorithm
+ */
+ public AxisAlgorithm getYAlgorithm()
+ {
+ return this.yAlgorithm;
+ }
+
+ /**
+ * @param algorithm
+ * the yAlgorithm to set
+ */
+ public void setYAlgorithm(AxisAlgorithm algorithm)
+ {
+ checkAxisAlgorithm(algorithm);
+
+ yAlgorithm = algorithm;
+ }
+
+ /**
+ * @return the widthAlgorithm
+ */
+ public AxisAlgorithm getWidthAlgorithm()
+ {
+ return this.widthAlgorithm;
+ }
+
+ /**
+ * @param widthAlgorithm
+ * the widthAlgorithm to set
+ */
+ public void setWidthAlgorithm(AxisAlgorithm widthAlgorithm)
+ {
+ checkAxisAlgorithm(widthAlgorithm);
+
+ this.widthAlgorithm = widthAlgorithm;
+ }
+
+ /**
+ * @return the pageAlgorithm
+ */
+ public PageAlgorithm getPageAlgorithm()
+ {
+ return this.pageAlgorithm;
+ }
+
+ /**
+ * @param pageAlgorithm
+ * the pageAlgorithm to set
+ */
+ public void setPageAlgorithm(PageAlgorithm pageAlgorithm)
+ {
+ checkPageAlgorithm(pageAlgorithm);
+ this.pageAlgorithm = pageAlgorithm;
+ }
+
+ /**
+ * @return the footerLine
+ */
+ public float getFooterLine()
+ {
+ return this.footerLine;
+ }
+
+ /**
+ * @param footerLine
+ * the footerLine to set
+ */
+ public void setFooterLine(float footerLine)
+ {
+ this.footerLine = footerLine;
+ }
+
+}