package org.apache.fop.fo;
// Java
+import java.util.List;
import java.util.ListIterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
// ignore
}
- /**
- *
- */
- protected void start() {
- // do nothing by default
- }
-
/**
*
*/
}
}
+ /**
+ * Return a LayoutManager responsible for laying out this FObj's content.
+ * Must override in subclasses if their content can be laid out.
+ * @param list the list to which the layout manager(s) should be added
+ */
+ public void addLayoutManager(List list) {
+ }
+
/**
* Returns the name of the node
* @return the name of this node
* @return true if this will create an area in the output
*/
public boolean willCreateArea() {
- if (textInfo.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE
+ if (textInfo.whiteSpaceCollapse == Constants.WhiteSpaceCollapse.FALSE
&& endIndex - startIndex > 0) {
return true;
}
* text-transform property.
*/
private void textTransform() {
- if (textInfo.textTransform == TextTransform.NONE) {
+ if (textInfo.textTransform == Constants.TextTransform.NONE) {
return;
}
for (int i = 0; i < endIndex; i++) {
private char charTransform(int i) {
switch (textInfo.textTransform) {
/* put NONE first, as this is probably the common case */
- case TextTransform.NONE:
+ case Constants.TextTransform.NONE:
return ca[i];
- case TextTransform.UPPERCASE:
+ case Constants.TextTransform.UPPERCASE:
return Character.toUpperCase(ca[i]);
- case TextTransform.LOWERCASE:
+ case Constants.TextTransform.LOWERCASE:
return Character.toLowerCase(ca[i]);
- case TextTransform.CAPITALIZE:
+ case Constants.TextTransform.CAPITALIZE:
if (isStartOfWord(i)) {
/*
Use toTitleCase here. Apparently, some languages use
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
if (endIndex - startIndex > 0) {
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
return markers;
}
- /**
- * Return a LayoutManager responsible for laying out this FObj's content.
- * Must override in subclasses if their content can be laid out.
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- }
-
/*
* Return a string representation of the fo element.
* Deactivated in order to see precise ID of each fo element created
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
if (getChildNodes() != null) {
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
BasicLinkLayoutManager lm = new BasicLinkLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
* @todo see if can/should move the child iteration logic
* to BidiLayoutManager
*/
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
BlockLayoutManager blm = new BlockLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
BlockContainerLayoutManager blm = new BlockContainerLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
String str = getPropString(PR_CHARACTER);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
if (getPropString(PR_SRC) != null) {
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
if (getInlineFO() == null) {
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
ArrayList childList = new ArrayList();
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
InstreamForeignObjectLM lm = new InstreamForeignObjectLM(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
setup();
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
ListBlockLayoutManager lm = new ListBlockLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
ListItemLayoutManager blm = new ListItemLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
PageNumberLayoutManager lm = new PageNumberLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
PageNumberCitationLayoutManager lm =
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
RetrieveMarkerLayoutManager lm = new RetrieveMarkerLayoutManager(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
* @todo see if can/should move much of this logic into TableLayoutManager
* and/or TableBody and TableColumn FO subclasses.
*/
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
Body blm = new Body(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
Cell clm = new Cell(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
Row rlm = new Row(this);
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
* @todo remove null check when vCN() & endOfNode() implemented
*/
public void addLayoutManager(List list) {
}
/**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
+ * @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
FlowLayoutManager lm = new FlowLayoutManager(this);
package org.apache.fop.layoutmgr;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FONode;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.area.Area;
import org.apache.fop.area.Resolveable;
List newLMs = new ArrayList(size);
while (fobjIter.hasNext() && newLMs.size() < size ) {
Object theobj = fobjIter.next();
- if (theobj instanceof FObj) {
- FObj fobj = (FObj) theobj;
- fobj.addLayoutManager(newLMs);
+ if (theobj instanceof FONode) {
+ FONode foNode = (FONode) theobj;
+ foNode.addLayoutManager(newLMs);
}
}
return newLMs;
* @param node The FOText object to be rendered
*/
public TextLayoutManager(FOText node) {
- super(node);
+ super();
+
foText = node;
textArray = new char[node.endIndex - node.startIndex];
System.arraycopy(node.ca, node.startIndex, textArray, 0,
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FONode;
import org.apache.fop.fo.flow.BasicLink;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
bDefer = false;
bDeferredExecution=true;
- recurseFObj(bl);
+ recurseFONode(bl);
bDeferredExecution=false;
//exit function, because the code has already beed executed while
/**
* Calls the appropriate event handler for the passed FObj.
*
- * @param fobj FO-object whose event is to be called
+ * @param foNode FO node whose event is to be called
* @param bStart TRUE calls the start handler, FALSE the end handler
*/
- private void invokeDeferredEvent(FObj fobj, boolean bStart) {
- if (fobj instanceof Block) {
+ private void invokeDeferredEvent(FONode foNode, boolean bStart) {
+ if (foNode instanceof Block) {
if (bStart) {
- startBlock( (Block) fobj);
+ startBlock( (Block) foNode);
} else {
- endBlock( (Block) fobj);
+ endBlock( (Block) foNode);
}
- } else if (fobj instanceof Inline) {
+ } else if (foNode instanceof Inline) {
if (bStart) {
- startInline( (Inline) fobj);
+ startInline( (Inline) foNode);
} else {
- endInline( (Inline) fobj);
+ endInline( (Inline) foNode);
}
- } else if (fobj instanceof FOText) {
+ } else if (foNode instanceof FOText) {
if (bStart) {
- FOText text = (FOText) fobj;
+ FOText text = (FOText) foNode;
characters(text.ca, text.startIndex, text.endIndex);
}
- } else if (fobj instanceof Character) {
+ } else if (foNode instanceof Character) {
if (bStart) {
- Character c = (Character) fobj;
+ Character c = (Character) foNode;
character(c);
}
- } else if (fobj instanceof BasicLink) {
+ } else if (foNode instanceof BasicLink) {
if (bStart) {
- startLink( (BasicLink) fobj);
+ startLink( (BasicLink) foNode);
} else {
endLink();
}
- } else if (fobj instanceof PageNumber) {
+ } else if (foNode instanceof PageNumber) {
if (bStart) {
- startPageNumber( (PageNumber) fobj);
+ startPageNumber( (PageNumber) foNode);
} else {
- endPageNumber( (PageNumber) fobj);
+ endPageNumber( (PageNumber) foNode);
}
- } else if (fobj instanceof Footnote) {
+ } else if (foNode instanceof Footnote) {
if (bStart) {
- startFootnote( (Footnote) fobj);
+ startFootnote( (Footnote) foNode);
} else {
- endFootnote( (Footnote) fobj);
+ endFootnote( (Footnote) foNode);
}
- } else if (fobj instanceof FootnoteBody) {
+ } else if (foNode instanceof FootnoteBody) {
if (bStart) {
- startFootnoteBody( (FootnoteBody) fobj);
+ startFootnoteBody( (FootnoteBody) foNode);
} else {
- endFootnoteBody( (FootnoteBody) fobj);
+ endFootnoteBody( (FootnoteBody) foNode);
}
- } else if (fobj instanceof ListBlock) {
+ } else if (foNode instanceof ListBlock) {
if (bStart) {
- startList( (ListBlock) fobj);
+ startList( (ListBlock) foNode);
} else {
- endList( (ListBlock) fobj);
+ endList( (ListBlock) foNode);
}
- } else if (fobj instanceof ListItem) {
+ } else if (foNode instanceof ListItem) {
if (bStart) {
- startListItem( (ListItem) fobj);
+ startListItem( (ListItem) foNode);
} else {
- endListItem( (ListItem) fobj);
+ endListItem( (ListItem) foNode);
}
- } else if (fobj instanceof ListItemLabel) {
+ } else if (foNode instanceof ListItemLabel) {
if (bStart) {
startListLabel();
} else {
endListLabel();
}
- } else if (fobj instanceof Table) {
+ } else if (foNode instanceof Table) {
if (bStart) {
- startTable( (Table) fobj);
+ startTable( (Table) foNode);
} else {
- endTable( (Table) fobj);
+ endTable( (Table) foNode);
}
- } else if (fobj instanceof TableColumn) {
+ } else if (foNode instanceof TableColumn) {
if (bStart) {
- startColumn( (TableColumn) fobj);
+ startColumn( (TableColumn) foNode);
} else {
- endColumn( (TableColumn) fobj);
+ endColumn( (TableColumn) foNode);
}
- } else if (fobj instanceof TableRow) {
+ } else if (foNode instanceof TableRow) {
if (bStart) {
- startRow( (TableRow) fobj);
+ startRow( (TableRow) foNode);
} else {
- endRow( (TableRow) fobj);
+ endRow( (TableRow) foNode);
}
- } else if (fobj instanceof TableCell) {
+ } else if (foNode instanceof TableCell) {
if (bStart) {
- startCell( (TableCell) fobj);
+ startCell( (TableCell) foNode);
} else {
- endCell( (TableCell) fobj);
+ endCell( (TableCell) foNode);
}
}
}
/**
- * Calls the event handlers for the passed FObj and all its elements.
+ * Calls the event handlers for the passed FONode and all its elements.
*
- * @param fobj FO-object which shall be recursed
+ * @param foNode FONode object which shall be recursed
*/
- private void recurseFObj(FObj fobj) {
- invokeDeferredEvent(fobj, true);
+ private void recurseFONode(FONode foNode) {
+ invokeDeferredEvent(foNode, true);
- if (fobj.childNodes != null) {
- for(Iterator it=fobj.childNodes.iterator();it.hasNext();) {
- recurseFObj( (FObj) it.next() );
+ if (foNode.getChildNodes() != null) {
+ for(Iterator it = foNode.getChildNodes(); it.hasNext() ; ) {
+ recurseFONode( (FONode) it.next() );
}
}
- invokeDeferredEvent(fobj, false);
+ invokeDeferredEvent(foNode, false);
}
}