aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/pdf/PDFAction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/apache/fop/pdf/PDFAction.java')
-rw-r--r--src/org/apache/fop/pdf/PDFAction.java63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/org/apache/fop/pdf/PDFAction.java b/src/org/apache/fop/pdf/PDFAction.java
index 2fa668599..238f936d8 100644
--- a/src/org/apache/fop/pdf/PDFAction.java
+++ b/src/org/apache/fop/pdf/PDFAction.java
@@ -52,49 +52,50 @@
package org.apache.fop.pdf;
/**
- * class representing a /Action object.
+ * class representing an action object.
*/
-public class PDFAction extends PDFObject {
-
- /** the file specification */
- protected PDFFileSpec fileSpec;
+public abstract class PDFAction extends PDFObject {
+
/**
- * create an /Action object.
+ * create an Action object.
+ * this constructor is used for passing on the object number to the PDFObject
*
- * @param number the object's number
- * @param fileSpec the fileSpec associated with the action
+ * @param number the object's number
*/
- public PDFAction(int number, PDFFileSpec fileSpec) {
+ public PDFAction(int number) {
/* generic creation of object */
- super(number);
-
- this.fileSpec = fileSpec;
+ super(number);
+ }
+
+ /**
+ * empty constructor for PDFAction.
+ * this constructor is used when there is no additional object being created
+ *
+ */
+ public PDFAction()
+ {
}
/**
+ * represent the action to call
+ * this method should be implemented to return the action which gets
+ * called by the Link Object. This could be a reference to another object
+ * or the specific destination of the link
+ *
+ * @return the action to place next to /A within a Link
+ */
+ abstract public String getAction();
+
+
+ /**
* represent the object in PDF
+ * this method should be implemented to return the PDF which is to be
+ * generated by the Action object
*
* @return the PDF string
*/
- public String toPDF() {
- String p = new String(this.number + " " + this.generation +
- " obj\n" +
- "<<\n/S /GoToR\n" +
- "/F " + fileSpec.referencePDF() + "\n" +
- "/D [ 0 /XYZ null null null ]" +
- " \n>>\nendobj\n");
- return p;
- }
+ abstract public String toPDF();
- /* example
- 28 0 obj
- <<
- /S /GoToR
- /F 29 0 R
- /D [ 0 /XYZ -6 797 null ]
- >>
- endobj
- */
-}
+ }