aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/FObjMixed.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-04-26 09:40:58 +0000
committerKeiron Liddle <keiron@apache.org>2002-04-26 09:40:58 +0000
commit0954beb3e9d49330fad81ea551aa738f0e987e49 (patch)
tree2ad3e65bd6b5642cc4a0c809fd1f8c553bab595d /src/org/apache/fop/fo/FObjMixed.java
parente05f8b6c0cfc6420fa2f0adca56a874b6486906d (diff)
downloadxmlgraphics-fop-0954beb3e9d49330fad81ea551aa738f0e987e49.tar.gz
xmlgraphics-fop-0954beb3e9d49330fad81ea551aa738f0e987e49.zip
initial implementation of line area layout processing
all inline area and their managers are managed by the LineLayoutManager. This class fills a line with inline areas and then does the alignment on all the inline areas. elements which create inline areas add their managers to the list that is used by the line layout. These managers have a retrievable index of inline areas. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/FObjMixed.java')
-rw-r--r--src/org/apache/fop/fo/FObjMixed.java46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/org/apache/fop/fo/FObjMixed.java b/src/org/apache/fop/fo/FObjMixed.java
index 75f736bd7..f2a180f65 100644
--- a/src/org/apache/fop/fo/FObjMixed.java
+++ b/src/org/apache/fop/fo/FObjMixed.java
@@ -14,6 +14,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.StreamRenderer;
import org.apache.fop.datatypes.ColorType;
+import java.util.List;
/**
* base class for representation of mixed content formatting objects
@@ -21,37 +22,48 @@ import org.apache.fop.datatypes.ColorType;
*/
public class FObjMixed extends FObj {
TextInfo textInfo = null;
- protected FontInfo fontInfo=null;
+ protected FontInfo fontInfo = null;
public FObjMixed(FONode parent) {
super(parent);
}
public void setStreamRenderer(StreamRenderer st) {
- fontInfo = st.getFontInfo();
+ fontInfo = st.getFontInfo();
}
- protected void addCharacters(char data[], int start, int length) {
- if(textInfo == null) {
- textInfo = new TextInfo();
+ public void addLayoutManager(List lms) {
+ // set start and end properties for this element, id, etc.
+ int numChildren = this.children.size();
+ for (int i = 0; i < numChildren; i++) {
+ Object o = children.get(i);
+ if (o instanceof FObj) {
+ FObj fo = (FObj) o;
+ fo.addLayoutManager(lms);
+ }
+ }
+ }
- try {
- textInfo.fs = propMgr.getFontState(fontInfo);
- } catch (FOPException fopex) {
- log.error("Error setting FontState for characters: " +
- fopex.getMessage());
- }
+ protected void addCharacters(char data[], int start, int length) {
+ if (textInfo == null) {
+ textInfo = new TextInfo();
+
+ try {
+ textInfo.fs = propMgr.getFontState(fontInfo);
+ } catch (FOPException fopex) {
+ log.error("Error setting FontState for characters: " +
+ fopex.getMessage());
+ }
ColorType c = getProperty("color").getColorType();
textInfo.color = c;
textInfo.verticalAlign =
- getProperty("vertical-align").getEnum();
+ getProperty("vertical-align").getEnum();
- textInfo.wrapOption =
- getProperty("wrap-option").getEnum();
+ textInfo.wrapOption = getProperty("wrap-option").getEnum();
textInfo.whiteSpaceCollapse =
- getProperty("white-space-collapse").getEnum();
+ getProperty("white-space-collapse").getEnum();
}
@@ -82,7 +94,7 @@ public class FObjMixed extends FObj {
int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
- FONode fo = (FONode)children.get(i);
+ FONode fo = (FONode) children.get(i);
Status status;
if ((status = fo.layout(area)).isIncomplete()) {
this.marker = i;
@@ -93,7 +105,7 @@ public class FObjMixed extends FObj {
}
public CharIterator charIterator() {
- return new RecursiveCharIterator(this);
+ return new RecursiveCharIterator(this);
}
}