From: William Victor Mote Date: Tue, 16 Sep 2003 18:11:52 +0000 (+0000) Subject: trigger event handling for start and end of table, cell, column, and row, primarily... X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1089 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f5356cde3e9027e32a7b3ca42945152da6f2d2b8;p=xmlgraphics-fop.git trigger event handling for start and end of table, cell, column, and row, primarily for the benefit of the structure handlers (mif/rtf) -- submitted by Peter Herweg, see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23103 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196917 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/flow/Table.java b/src/java/org/apache/fop/fo/flow/Table.java index 26c82f540..13f5eb3b8 100644 --- a/src/java/org/apache/fop/fo/flow/Table.java +++ b/src/java/org/apache/fop/fo/flow/Table.java @@ -53,7 +53,11 @@ package org.apache.fop.fo.flow; // Java import java.util.ArrayList; +// XML +import org.xml.sax.Attributes; + // FOP +import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.LengthRange; import org.apache.fop.fo.FONode; @@ -224,5 +228,19 @@ public class Table extends FObj { fotv.serveTable(this); } -} + /** + * @see org.apache.fop.fo.FObj#handleAttrs + */ + public void handleAttrs(Attributes attlist) throws FOPException { + super.handleAttrs(attlist); + + setupID(); + getFOTreeControl().getFOInputHandler().startTable(this); + } + + protected void end() { + getFOTreeControl().getFOInputHandler().endTable(this); + } + +} diff --git a/src/java/org/apache/fop/fo/flow/TableCell.java b/src/java/org/apache/fop/fo/flow/TableCell.java index f9961788f..c569c9683 100644 --- a/src/java/org/apache/fop/fo/flow/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/TableCell.java @@ -159,6 +159,8 @@ public class TableCell extends FObj { public void handleAttrs(Attributes attlist) throws FOPException { super.handleAttrs(attlist); doSetup(); // init some basic property values + + getFOTreeControl().getFOInputHandler().startCell(this); } /** @@ -386,4 +388,7 @@ public class TableCell extends FObj { fotv.serveTableCell(this); } + protected void end() { + getFOTreeControl().getFOInputHandler().endCell(this); + } } diff --git a/src/java/org/apache/fop/fo/flow/TableColumn.java b/src/java/org/apache/fop/fo/flow/TableColumn.java index 18a832e7e..f1d081d4e 100644 --- a/src/java/org/apache/fop/fo/flow/TableColumn.java +++ b/src/java/org/apache/fop/fo/flow/TableColumn.java @@ -50,7 +50,11 @@ */ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.Attributes; + // FOP +import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; @@ -168,5 +172,20 @@ public class TableColumn extends FObj { fotv.serveTableColumn(this); } + /** + * Overriden from FObj. + * @param attlist Collection of attributes passed to us from the parser. + * @throws FOPException for FO errors + */ + public void handleAttrs(Attributes attlist) throws FOPException { + super.handleAttrs(attlist); + doSetup(); // init some basic property values + + getFOTreeControl().getFOInputHandler().startColumn(this); + } + + protected void end() { + getFOTreeControl().getFOInputHandler().endColumn(this); + } } diff --git a/src/java/org/apache/fop/fo/flow/TableRow.java b/src/java/org/apache/fop/fo/flow/TableRow.java index f39b56c38..316d6c1b9 100644 --- a/src/java/org/apache/fop/fo/flow/TableRow.java +++ b/src/java/org/apache/fop/fo/flow/TableRow.java @@ -50,7 +50,11 @@ */ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.Attributes; + // FOP +import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.KeepValue; import org.apache.fop.fo.FONode; @@ -162,5 +166,19 @@ public class TableRow extends FObj { fotv.serveTableRow(this); } -} + /** + * @see org.apache.fop.fo.FObj#handleAttrs + */ + public void handleAttrs(Attributes attlist) throws FOPException { + super.handleAttrs(attlist); + + setupID(); + getFOTreeControl().getFOInputHandler().startRow(this); + } + + protected void end() { + getFOTreeControl().getFOInputHandler().endRow(this); + } + +}