blob: eb5d9da0ef63b27252be32ed5e14a0384fe12c59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
/*
* $Id$
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.extensions;
import org.apache.fop.fo.*;
import org.apache.fop.pdf.PDFGoTo;
import org.apache.fop.pdf.PDFAction;
import org.apache.fop.datatypes.IDReferences;
import org.apache.fop.apps.FOPException;
import java.util.*;
import org.xml.sax.Attributes;
public class Outline extends ExtensionObj {
private Label _label;
private Vector _outlines = new Vector();
private String _internalDestination;
private String _externalDestination;
/**
* The parent outline object if it exists
*/
private Outline _parentOutline;
/**
* an opaque renderer context object, e.g. PDFOutline for PDFRenderer
*/
private Object _rendererObject;
public Outline(FObj parent) {
super(parent);
}
public void handleAttrs(Attributes attlist) throws FOPException {
super.handleAttrs(attlist);
_internalDestination =
this.properties.get("internal-destination").getString();
_externalDestination =
this.properties.get("external-destination").getString();
if (_externalDestination != null &&!_externalDestination.equals("")) {
log.warn("fox:outline external-destination not supported currently.");
}
if (_internalDestination == null || _internalDestination.equals("")) {
log.warn("fox:outline requires an internal-destination.");
}
for (FONode node = getParent(); node != null;
node = node.getParent()) {
if (node instanceof Outline) {
_parentOutline = (Outline)node;
break;
}
}
}
protected void addChild(FONode obj) {
if (obj instanceof Label) {
_label = (Label)obj;
} else if (obj instanceof Outline) {
_outlines.addElement(obj);
}
super.addChild(obj);
}
public void setRendererObject(Object o) {
_rendererObject = o;
}
public Object getRendererObject() {
return _rendererObject;
}
public Outline getParentOutline() {
return _parentOutline;
}
public Label getLabel() {
return _label == null ? new Label(this) : _label;
}
public Vector getOutlines() {
return _outlines;
}
public String getInternalDestination() {
return _internalDestination;
}
}
|