diff options
Diffstat (limited to 'src/org/apache/fop/fo/flow')
-rw-r--r-- | src/org/apache/fop/fo/flow/ListBlock.java | 7 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/ListItem.java | 77 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/ListItemBody.java | 6 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/ListItemLabel.java | 8 |
4 files changed, 71 insertions, 27 deletions
diff --git a/src/org/apache/fop/fo/flow/ListBlock.java b/src/org/apache/fop/fo/flow/ListBlock.java index 56fb2f49d..5bb9e7fed 100644 --- a/src/org/apache/fop/fo/flow/ListBlock.java +++ b/src/org/apache/fop/fo/flow/ListBlock.java @@ -14,9 +14,11 @@ import org.apache.fop.datatypes.*; import org.apache.fop.layout.*; import org.apache.fop.layout.FontState; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.list.ListBlockLayoutManager; // Java import java.util.Iterator; +import java.util.List; public class ListBlock extends FObj { @@ -36,6 +38,11 @@ public class ListBlock extends FObj { super(parent); } + public void addLayoutManager(List list) { + ListBlockLayoutManager blm = new ListBlockLayoutManager(this); + list.add(blm); + } + public void setup() throws FOPException { // Common Accessibility Properties diff --git a/src/org/apache/fop/fo/flow/ListItem.java b/src/org/apache/fop/fo/flow/ListItem.java index 01304bced..9c258c79e 100644 --- a/src/org/apache/fop/fo/flow/ListItem.java +++ b/src/org/apache/fop/fo/flow/ListItem.java @@ -13,11 +13,15 @@ import org.apache.fop.fo.properties.*; import org.apache.fop.layout.*; import org.apache.fop.layout.FontState; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.list.ListItemLayoutManager; // Java import java.util.Iterator; +import java.util.List; public class ListItem extends FObj { + ListItemLabel label = null; + ListItemBody body = null; int align; int alignLast; @@ -33,43 +37,64 @@ public class ListItem extends FObj { super(parent); } + public void addLayoutManager(List list) { + if(label != null && body != null) { + ListItemLayoutManager blm = new ListItemLayoutManager(this); + blm.setLabel(label.getItemLayoutManager()); + blm.setBody(body.getItemLayoutManager()); + list.add(blm); + } + } + public void setup() { - // Common Accessibility Properties - AccessibilityProps mAccProps = propMgr.getAccessibilityProps(); + // Common Accessibility Properties + AccessibilityProps mAccProps = propMgr.getAccessibilityProps(); - // Common Aural Properties - AuralProps mAurProps = propMgr.getAuralProps(); + // Common Aural Properties + AuralProps mAurProps = propMgr.getAuralProps(); - // Common Border, Padding, and Background Properties - BorderAndPadding bap = propMgr.getBorderAndPadding(); - BackgroundProps bProps = propMgr.getBackgroundProps(); + // Common Border, Padding, and Background Properties + BorderAndPadding bap = propMgr.getBorderAndPadding(); + BackgroundProps bProps = propMgr.getBackgroundProps(); - // Common Margin Properties-Block - MarginProps mProps = propMgr.getMarginProps(); + // Common Margin Properties-Block + MarginProps mProps = propMgr.getMarginProps(); - // Common Relative Position Properties - RelativePositionProps mRelProps = propMgr.getRelativePositionProps(); + // Common Relative Position Properties + RelativePositionProps mRelProps = propMgr.getRelativePositionProps(); - // this.properties.get("break-after"); - // this.properties.get("break-before"); - setupID(); - // this.properties.get("keep-together"); - // this.properties.get("keep-with-next"); - // this.properties.get("keep-with-previous"); - // this.properties.get("relative-align"); + // this.properties.get("break-after"); + // this.properties.get("break-before"); + setupID(); + // this.properties.get("keep-together"); + // this.properties.get("keep-with-next"); + // this.properties.get("keep-with-previous"); + // this.properties.get("relative-align"); - this.align = this.properties.get("text-align").getEnum(); - this.alignLast = this.properties.get("text-align-last").getEnum(); - this.lineHeight = - this.properties.get("line-height").getLength().mvalue(); - this.spaceBefore = - this.properties.get("space-before.optimum").getLength().mvalue(); - this.spaceAfter = - this.properties.get("space-after.optimum").getLength().mvalue(); + this.align = this.properties.get("text-align").getEnum(); + this.alignLast = this.properties.get("text-align-last").getEnum(); + this.lineHeight = + this.properties.get("line-height").getLength().mvalue(); + this.spaceBefore = + this.properties.get("space-before.optimum").getLength().mvalue(); + this.spaceAfter = + this.properties.get("space-after.optimum").getLength().mvalue(); } + public void addChild(FONode child) { + if ("fo:list-item-label".equals(child.getName())) { + label = (ListItemLabel)child; + } else if ("fo:list-item-body".equals(child.getName())) { + body = (ListItemBody)child; + } else if("fo:marker".equals(child.getName())) { + // marker + } else { + // error + } + } + public boolean generatesInlineAreas() { return false; } diff --git a/src/org/apache/fop/fo/flow/ListItemBody.java b/src/org/apache/fop/fo/flow/ListItemBody.java index d27046e0b..f201aa9b3 100644 --- a/src/org/apache/fop/fo/flow/ListItemBody.java +++ b/src/org/apache/fop/fo/flow/ListItemBody.java @@ -13,6 +13,7 @@ import org.apache.fop.fo.properties.*; import org.apache.fop.layout.*; import org.apache.fop.layout.FontState; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.list.Item; // Java import java.util.Iterator; @@ -23,6 +24,11 @@ public class ListItemBody extends FObj { super(parent); } + public Item getItemLayoutManager() { + Item item = new Item(this); + return item; + } + public void setup() { // Common Accessibility Properties diff --git a/src/org/apache/fop/fo/flow/ListItemLabel.java b/src/org/apache/fop/fo/flow/ListItemLabel.java index da2ef5d30..3115b3406 100644 --- a/src/org/apache/fop/fo/flow/ListItemLabel.java +++ b/src/org/apache/fop/fo/flow/ListItemLabel.java @@ -13,6 +13,7 @@ import org.apache.fop.fo.properties.*; import org.apache.fop.layout.*; import org.apache.fop.layout.FontState; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.list.Item; // Java import java.util.Enumeration; @@ -23,7 +24,12 @@ public class ListItemLabel extends FObj { super(parent); } - public void setup() throws FOPException { + public Item getItemLayoutManager() { + Item itemLabel = new Item(this); + return itemLabel; + } + + public void setup() { // Common Accessibility Properties AccessibilityProps mAccProps = propMgr.getAccessibilityProps(); |