View | Details | Raw Unified | Return to bug 50852
Collapse All | Expand All

(-)a/src/java/org/apache/fop/fo/FONode.java (+8 lines)
Lines 32-37 import org.apache.commons.logging.LogFactory; Link Here
32
32
33
import org.apache.xmlgraphics.util.QName;
33
import org.apache.xmlgraphics.util.QName;
34
34
35
import org.apache.fop.accessibility.StructureElement;
35
import org.apache.fop.apps.FOPException;
36
import org.apache.fop.apps.FOPException;
36
import org.apache.fop.apps.FOUserAgent;
37
import org.apache.fop.apps.FOUserAgent;
37
import org.apache.fop.fo.extensions.ExtensionAttachment;
38
import org.apache.fop.fo.extensions.ExtensionAttachment;
Lines 401-406 public abstract class FONode implements Cloneable { Link Here
401
    }
402
    }
402
403
403
    /**
404
    /**
405
     * Add structure tree of this elements and all childs to parent.
406
     * @param parent Parent Element of the structure tree
407
     */
408
    public void addStructureElements(StructureElement parent) {
409
    }
410
411
    /**
404
     * Helper function to standardize the names of all namespace URI - local
412
     * Helper function to standardize the names of all namespace URI - local
405
     * name pairs in text messages.
413
     * name pairs in text messages.
406
     * For readability, using fo:, fox:, svg:, for those namespaces even
414
     * For readability, using fo:, fox:, svg:, for those namespaces even
(-)a/src/java/org/apache/fop/fo/FObj.java (-1 / +45 lines)
Lines 32-37 import org.xml.sax.Locator; Link Here
32
32
33
import org.apache.xmlgraphics.util.QName;
33
import org.apache.xmlgraphics.util.QName;
34
34
35
import org.apache.fop.accessibility.StructureElement;
35
import org.apache.fop.apps.FOPException;
36
import org.apache.fop.apps.FOPException;
36
import org.apache.fop.fo.extensions.ExtensionAttachment;
37
import org.apache.fop.fo.extensions.ExtensionAttachment;
37
import org.apache.fop.fo.flow.Marker;
38
import org.apache.fop.fo.flow.Marker;
Lines 70-75 public abstract class FObj extends FONode implements Constants { Link Here
70
    // The value of properties relevant for all fo objects
71
    // The value of properties relevant for all fo objects
71
    private String id = null;
72
    private String id = null;
72
    // End of property values
73
    // End of property values
74
    
75
    /** Counter for creating ptr Ids */
76
    private static long ptrNo = 0;
73
77
74
    /**
78
    /**
75
     * Create a new formatting object.
79
     * Create a new formatting object.
Lines 801-805 public abstract class FObj extends FONode implements Constants { Link Here
801
        public FONode previousNode() {
805
        public FONode previousNode() {
802
            return (FONode) previous();
806
            return (FONode) previous();
803
        }
807
        }
808
809
    }
810
811
    /**
812
     * Generates a new ID for the Ptr attribute
813
     *
814
     * @return new ID for Ptr attribute
815
     */
816
    protected String newPtrId() {
817
        return "N" + (ptrNo++);
818
    }
819
820
    /**
821
     * Creates structure element skelton for the current element
822
     *
823
     * @return structure element
824
     */
825
    protected StructureElement createStructureElement() {
826
        StructureElement e = new StructureElement(getLocalName());
827
        return e;
828
    }
829
830
    /**
831
     * Helper function to iteratate over all child elements and 
832
     * call {@link #addStructureElements()} on them.
833
     * @param parent Parent Element of the structure tree
834
     */
835
    public final void addChildStructureElements(StructureElement parent) {
836
        FONode current = firstChild;
837
        while (current != null) {
838
            current.addStructureElements(parent);
839
            if (current.siblings != null)
840
                current = current.siblings[1];
841
            else
842
                current = null;
843
        }
844
    }
845
846
    /** {@inheritDoc} */
847
    public void addStructureElements(StructureElement parent) {
848
        addChildStructureElements(parent);
804
    }
849
    }
805
}
850
}
806
- 

Return to bug 50852