1 51 package org.apache.fop.extensions; 52 53 import org.apache.fop.apps.FOPException; 54 import org.apache.fop.fo.*; 55 56 import java.util.*; 57 58 62 public class Outline extends ExtensionObj { 63 private Label _label; 64 private ArrayList _outlines = new ArrayList(); 65 66 private String _internalDestination; 67 private String _externalDestination; 68 69 72 private Outline _parentOutline; 73 74 77 private Object _rendererObject; 78 79 80 public static class Maker extends FObj.Maker { 81 public FObj make(FObj parent, PropertyList propertyList, 82 String systemId, int line, int column) 83 throws FOPException { 84 return new Outline(parent, propertyList, systemId, line, column); 85 } 86 87 } 88 89 public static FObj.Maker maker() { 90 return new Outline.Maker(); 91 } 92 93 public Outline(FObj parent, PropertyList propertyList, 94 String systemId, int line, int column) { 95 super(parent, propertyList, systemId, line, column); 96 97 _internalDestination = 98 this.properties.get("internal-destination").getString(); 99 _externalDestination = 100 this.properties.get("external-destination").getString(); 101 if (_externalDestination != null &&!_externalDestination.equals("")) { 102 log.warn("fox:outline external-destination not supported currently."); 103 } 104 105 if (_internalDestination == null || _internalDestination.equals("")) { 106 log.warn("fox:outline requires an internal-destination."); 107 } 108 109 for (FONode node = getParent(); node != null; 110 node = node.getParent()) { 111 if (node instanceof Outline) { 112 _parentOutline = (Outline)node; 113 break; 114 } 115 } 116 117 } 118 119 protected void addChild(FONode obj) { 120 if (obj instanceof Label) { 121 _label = (Label)obj; 122 } else if (obj instanceof Outline) { 123 _outlines.add(obj); 124 } 125 super.addChild(obj); 126 } 127 128 129 public void setRendererObject(Object o) { 130 _rendererObject = o; 131 } 132 133 public Object getRendererObject() { 134 return _rendererObject; 135 } 136 137 public Outline getParentOutline() { 138 return _parentOutline; 139 } 140 141 public Label getLabel() { 142 return _label == null ? new Label(this, this.properties, 143 systemId, line, column) 144 : _label; 145 } 146 147 public ArrayList getOutlines() { 148 return _outlines; 149 } 150 151 public String getInternalDestination() { 152 return _internalDestination; 153 } 154 155 public String getName() { 156 return "fop:outline"; 157 } 158 159 160 } 161 162 | Popular Tags |