* @return the logger
* @see #enableLogging(Logger)
*/
- protected Logger getLogger() {
+ public Logger getLogger() {
if (this.log == null) {
// use ConsoleLogger as default when logger not explicitly set
this.log = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.area;
+
+// Java
+import java.util.List;
+import java.io.Serializable;
+
+// FOP
+import org.apache.fop.area.Trait;
+import org.apache.fop.area.Resolveable;
+import org.apache.fop.area.PageViewport;
+import org.apache.fop.area.Area;
+
+/**
+ * Link resolving for resolving internal links.
+ */
+public class LinkResolver implements Resolveable, Serializable {
+ private boolean resolved = false;
+ private String idRef;
+ private Area area;
+
+ /**
+ * Create a new link resolver.
+ *
+ * @param id the id to resolve
+ * @param a the area that will have the link attribute
+ */
+ public LinkResolver(String id, Area a) {
+ idRef = id;
+ area = a;
+ }
+
+ /**
+ * @return true if this link is resolved
+ */
+ public boolean isResolved() {
+ return resolved;
+ }
+
+ public String[] getIDs() {
+ return new String[] {idRef};
+ }
+
+ /**
+ * Resolve by adding an internal link.
+ */
+ public void resolve(String id, List pages) {
+ resolved = true;
+ if (idRef.equals(id) && pages != null) {
+ PageViewport page = (PageViewport)pages.get(0);
+ area.addTrait(Trait.INTERNAL_LINK, page.getKey());
+ }
+ }
+}
import org.apache.fop.fo.FOTreeHandler;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.area.AreaTree;
import java.util.ArrayList;
data.setAreaTree(at);
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.extensions;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Base class for pdf bookmark extension objects.
super(parent);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.extensions;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Labal for PDF bookmark extension.
return label;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.extensions;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
import java.util.ArrayList;
return label == null ? "" : label.toString();
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* Returns the logger for the node.
* @return the logger
*/
- protected Logger getLogger() {
+ public Logger getLogger() {
return userAgent.getLogger();
}
* Returns the user agent for the node.
* @return FOUserAgent
*/
- protected FOUserAgent getUserAgent() {
+ public FOUserAgent getUserAgent() {
return userAgent;
}
return false;
}
+ /**
+ * Recursively goes up the FOTree hierarchy until the FONode is found,
+ * which returns the parent Document.
+ * @return the Document object that is the parent of this node.
+ */
public Document getDocument() {
return parent.getDocument();
}
+ /**
+ * This is a hook for an FOTreeVisitor subclass to be able to access
+ * this object.
+ * @param fotv the FOTreeVisitor subclass that can access this object.
+ * @see org.apache.fop.fo.FOTreeVisitor
+ */
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
*/
public class FOText extends FObj {
- private char[] ca;
+ public char[] ca;
private int start;
- private int length;
- private TextInfo textInfo;
+ public int length;
+ public TextInfo textInfo;
private TextState ts;
/**
return false;
}
- public void addLayoutManager(List list) {
- // if nothing left (length=0)?
- if (length == 0) {
- return;
- }
-
- if (length < ca.length) {
- char[] tmp = ca;
- ca = new char[length];
- System.arraycopy(tmp, 0, ca, 0, length);
- }
- LayoutManager lm = new TextLayoutManager(ca, textInfo);
- lm.setFObj(this);
- list.add(lm);
- }
-
/**
* @return a new TextCharIterator
*/
}
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
}
*/
package org.apache.fop.fo;
+import org.apache.fop.fo.FONode;
+
/**
* Default class for handling external calls as an FO Tree is being built.
* "External calls" are processes that are not directly related to building
public class FOTreeExternal {
+ public void extFONode(FONode foNode) {
+ }
+
+ public void extFObj(FObj fobj) {
+ }
+
}
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.fo;
+
+import org.apache.fop.fo.flow.BlockContainer;
+import org.apache.fop.fo.flow.Character;
+import org.apache.fop.fo.pagination.ColorProfile;
+import org.apache.fop.fo.pagination.ConditionalPageMasterReference;
+import org.apache.fop.fo.pagination.Declarations;
+import org.apache.fop.extensions.ExtensionObj;
+import org.apache.fop.extensions.Bookmarks;
+import org.apache.fop.extensions.Label;
+import org.apache.fop.extensions.Outline;
+import org.apache.fop.fo.flow.ExternalGraphic;
+import org.apache.fop.fo.pagination.Flow;
+import org.apache.fop.fo.pagination.StaticContent;
+import org.apache.fop.fo.flow.BidiOverride;
+import org.apache.fop.fo.flow.Block;
+import org.apache.fop.fo.flow.Inline;
+import org.apache.fop.fo.flow.BasicLink;
+import org.apache.fop.fo.flow.Leader;
+import org.apache.fop.fo.flow.Marker;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.pagination.Title;
+import org.apache.fop.fo.flow.Wrapper;
+import org.apache.fop.fo.flow.Footnote;
+import org.apache.fop.fo.flow.FootnoteBody;
+import org.apache.fop.fo.flow.InlineContainer;
+import org.apache.fop.fo.flow.InstreamForeignObject;
+import org.apache.fop.fo.pagination.LayoutMasterSet;
+import org.apache.fop.fo.flow.ListBlock;
+import org.apache.fop.fo.flow.ListItem;
+import org.apache.fop.fo.flow.ListItemBody;
+import org.apache.fop.fo.flow.ListItemLabel;
+import org.apache.fop.fo.pagination.PageMasterReference;
+import org.apache.fop.fo.pagination.RepeatablePageMasterReference;
+import org.apache.fop.fo.pagination.SinglePageMasterReference;
+import org.apache.fop.fo.flow.PageNumber;
+import org.apache.fop.fo.flow.PageNumberCitation;
+import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.fo.pagination.PageSequenceMaster;
+import org.apache.fop.fo.pagination.Region;
+import org.apache.fop.fo.pagination.RegionBASE;
+import org.apache.fop.fo.pagination.RegionBA;
+import org.apache.fop.fo.pagination.RegionAfter;
+import org.apache.fop.fo.pagination.RegionBefore;
+import org.apache.fop.fo.pagination.RegionSE;
+import org.apache.fop.fo.pagination.RegionEnd;
+import org.apache.fop.fo.pagination.RegionStart;
+import org.apache.fop.fo.pagination.RegionBody;
+import org.apache.fop.fo.pagination.RepeatablePageMasterAlternatives;
+import org.apache.fop.fo.pagination.Root;
+import org.apache.fop.fo.pagination.SimplePageMaster;
+import org.apache.fop.fo.flow.Table;
+import org.apache.fop.fo.flow.TableBody;
+import org.apache.fop.fo.flow.TableFooter;
+import org.apache.fop.fo.flow.TableHeader;
+import org.apache.fop.fo.flow.TableCell;
+import org.apache.fop.fo.flow.TableColumn;
+import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.flow.Float;
+import org.apache.fop.fo.flow.InitialPropertySet;
+import org.apache.fop.fo.flow.MultiCase;
+import org.apache.fop.fo.flow.MultiProperties;
+import org.apache.fop.fo.flow.MultiPropertySet;
+import org.apache.fop.fo.flow.MultiSwitch;
+import org.apache.fop.fo.flow.MultiToggle;
+import org.apache.fop.fo.flow.TableAndCaption;
+import org.apache.fop.fo.flow.TableCaption;
+import org.apache.fop.svg.SVGObj;
+import org.apache.fop.svg.SVGElement;
+
+/**
+ * <p>Implements the GoF Visitor design pattern to allow access to the FOTree
+ * hierarchy without knowing what subclass of FONode is being accessed.
+ * To preserve inheritance, and simulate the polymorphism that would exist if
+ * the subclass methods were embedded in the visited hierarchy, the default for
+ * each method (except serveVisitor(FONode)) is to run the the visitXXXX method
+ * that corresponds to the superclass of the FOTree child element. Thus, any
+ * method that is overridden in a subclass of FOTreeVisitor will affect not only
+ * FOTree elements of the class that method was written for, but also all
+ * subclasses of that class.</p>
+ * <p>Caveat: Because there appears to be no way for one
+ * object to cast objects from another class to their superclass, this
+ * superclass logic has been hard-coded into FOTreeVisitor. So, for example,
+ * serveVisitor(FObj) runs the following:</p>
+ * <pre><code> serveVisitor((FONode)node);</code></pre>
+ * <p>If FObj ceases to be a direct subclass of FONode, then the above may cause
+ * problems.</p>
+ */
+public abstract class FOTreeVisitor {
+
+ /**
+ * @param node FONode object to process
+ */
+ public void serveVisitor(FONode node) {
+ }
+
+ /**
+ * @param node FObj object to process
+ */
+ public void serveVisitor(FObj node) {
+ serveVisitor((FONode)node);
+ }
+
+ /**
+ * @param node BlockContainer object to process
+ */
+ public void serveVisitor(BlockContainer node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Character object to process
+ */
+ public void serveVisitor(Character node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ColorProfile object to process
+ */
+ public void serveVisitor(ColorProfile node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ConditionalPageMasterReference object to process
+ */
+ public void serveVisitor(ConditionalPageMasterReference node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Declarations object to process
+ */
+ public void serveVisitor(Declarations node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ExtensionObj object to process
+ */
+ public void serveVisitor(ExtensionObj node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Bookmarks object to process
+ */
+ public void serveVisitor(Bookmarks node) {
+ serveVisitor((ExtensionObj)node);
+ }
+
+ /**
+ * @param node Label object to process
+ */
+ public void serveVisitor(Label node) {
+ serveVisitor((ExtensionObj)node);
+ }
+
+ /**
+ * @param node Outline object to process
+ */
+ public void serveVisitor(Outline node) {
+ serveVisitor((ExtensionObj)node);
+ }
+
+ /**
+ * @param node ExternalGraphic object to process
+ */
+ public void serveVisitor(ExternalGraphic node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Flow object to process
+ */
+ public void serveVisitor(Flow node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node StaticContent object to process
+ */
+ public void serveVisitor(StaticContent node) {
+ serveVisitor((Flow)node);
+ }
+
+ /**
+ * @param node FObjMixed object to process
+ */
+ public void serveVisitor(FObjMixed node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node BidiOverride object to process
+ */
+ public void serveVisitor(BidiOverride node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Block object to process
+ */
+ public void serveVisitor(Block node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Inline object to process
+ */
+ public void serveVisitor(Inline node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node BasicLink object to process
+ */
+ public void serveVisitor(BasicLink node) {
+ serveVisitor((Inline)node);
+ }
+
+ /**
+ * @param node Leader object to process
+ */
+ public void serveVisitor(Leader node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Marker object to process
+ */
+ public void serveVisitor(Marker node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node RetrieveMarker object to process
+ */
+ public void serveVisitor(RetrieveMarker node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Title object to process
+ */
+ public void serveVisitor(Title node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Wrapper object to process
+ */
+ public void serveVisitor(Wrapper node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ /**
+ * @param node Footnote object to process
+ */
+ public void serveVisitor(Footnote node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node FootnoteBody object to process
+ */
+ public void serveVisitor(FootnoteBody node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node FOText object to process
+ */
+ public void serveVisitor(FOText node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node InlineContainer object to process
+ */
+ public void serveVisitor(InlineContainer node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node InstreamForeignObject object to process
+ */
+ public void serveVisitor(InstreamForeignObject node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node LayoutMasterSet object to process
+ */
+ public void serveVisitor(LayoutMasterSet node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ListBlock object to process
+ */
+ public void serveVisitor(ListBlock node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ListItem object to process
+ */
+ public void serveVisitor(ListItem node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ListItemBody object to process
+ */
+ public void serveVisitor(ListItemBody node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ListItemLabel object to process
+ */
+ public void serveVisitor(ListItemLabel node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node PageMasterReference object to process
+ */
+ public void serveVisitor(PageMasterReference node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node RepeatablePageMasterReference object to process
+ */
+ public void serveVisitor(RepeatablePageMasterReference node) {
+ serveVisitor((PageMasterReference)node);
+ }
+
+ /**
+ * @param node SinglePageMasterReference object to process
+ */
+ public void serveVisitor(SinglePageMasterReference node) {
+ serveVisitor((PageMasterReference)node);
+ }
+
+ /**
+ * @param node PageNumber object to process
+ */
+ public void serveVisitor(PageNumber node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node PageNumberCitation object to process
+ */
+ public void serveVisitor(PageNumberCitation node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node PageSequence object to process
+ */
+ public void serveVisitor(PageSequence node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node PageSequenceMaster object to process
+ */
+ public void serveVisitor(PageSequenceMaster node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Region object to process
+ */
+ public void serveVisitor(Region node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node RegionBASE object to process
+ */
+ public void serveVisitor(RegionBASE node) {
+ serveVisitor((Region)node);
+ }
+
+ /**
+ * @param node RegionBA object to process
+ */
+ public void serveVisitor(RegionBA node) {
+ serveVisitor((RegionBASE)node);
+ }
+
+ /**
+ * @param node RegionAfter object to process
+ */
+ public void serveVisitor(RegionAfter node) {
+ serveVisitor((RegionBA)node);
+ }
+
+ /**
+ * @param node RegionBefore object to process
+ */
+ public void serveVisitor(RegionBefore node) {
+ serveVisitor((RegionBA)node);
+ }
+
+ /**
+ * @param node RegionSE object to process
+ */
+ public void serveVisitor(RegionSE node) {
+ serveVisitor((RegionBASE)node);
+ }
+
+ /**
+ * @param node RegionEnd object to process
+ */
+ public void serveVisitor(RegionEnd node) {
+ serveVisitor((RegionSE)node);
+ }
+
+ /**
+ * @param node RegionStart object to process
+ */
+ public void serveVisitor(RegionStart node) {
+ serveVisitor((RegionSE)node);
+ }
+
+ /**
+ * @param node RegionBody object to process
+ */
+ public void serveVisitor(RegionBody node) {
+ serveVisitor((Region)node);
+ }
+
+ /**
+ * @param node RepeatablePageMasterAlternatives object to process
+ */
+ public void serveVisitor(RepeatablePageMasterAlternatives node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Root object to process
+ */
+ public void serveVisitor(Root node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node SimplePageMaster object to process
+ */
+ public void serveVisitor(SimplePageMaster node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Table object to process
+ */
+ public void serveVisitor(Table node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node TableBody object to process
+ */
+ public void serveVisitor(TableBody node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node TableFooter object to process
+ */
+ public void serveVisitor(TableFooter node) {
+ serveVisitor((TableBody)node);
+ }
+
+ /**
+ * @param node TableHeader object to process
+ */
+ public void serveVisitor(TableHeader node) {
+ serveVisitor((TableBody)node);
+ }
+
+ /**
+ * @param node TableCell object to process
+ */
+ public void serveVisitor(TableCell node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node TableColumn object to process
+ */
+ public void serveVisitor(TableColumn node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node TableRow object to process
+ */
+ public void serveVisitor(TableRow node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node ToBeImplementedElement object to process
+ */
+ public void serveVisitor(ToBeImplementedElement node) {
+ serveVisitor((FObj)node);
+ }
+
+ /**
+ * @param node Float object to process
+ */
+ public void serveVisitor(Float node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node InitialPropertySet object to process
+ */
+ public void serveVisitor(InitialPropertySet node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node MultiCase object to process
+ */
+ public void serveVisitor(MultiCase node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node MultiProperties object to process
+ */
+ public void serveVisitor(MultiProperties node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node MultiPropertySet object to process
+ */
+ public void serveVisitor(MultiPropertySet node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node MultiSwitch object to process
+ */
+ public void serveVisitor(MultiSwitch node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node MultiToggle object to process
+ */
+ public void serveVisitor(MultiToggle node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node TableAndCaption object to process
+ */
+ public void serveVisitor(TableAndCaption node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node TableCaption object to process
+ */
+ public void serveVisitor(TableCaption node) {
+ serveVisitor((ToBeImplementedElement)node);
+ }
+
+ /**
+ * @param node Unknown object to process
+ */
+ public void serveVisitor(Unknown node) {
+ serveVisitor((FONode)node);
+ }
+
+ /**
+ * @param node XMLObj object to process
+ */
+ public void serveVisitor(XMLObj node) {
+ serveVisitor((FONode)node);
+ }
+
+ /**
+ * @param node SVGObj object to process
+ */
+ public void serveVisitor(SVGObj node) {
+ serveVisitor((XMLObj)node);
+ }
+
+ /**
+ * @param node SVGElement object to process
+ */
+ public void serveVisitor(SVGElement node) {
+ serveVisitor((SVGObj)node);
+ }
+
+ /**
+ * @param node UnknownXMLObj object to process
+ */
+ public void serveVisitor(UnknownXMLObj node) {
+ serveVisitor((XMLObj)node);
+ }
+
+ /**
+ * @param node XMLElement object to process
+ */
+ public void serveVisitor(XMLElement node) {
+ serveVisitor((XMLObj)node);
+ }
+
+}
+
* This methods checks that the id isn't already used by another
* fo and sets the id attribute of this object.
*/
- protected void setupID() {
+ public void setupID() {
Property prop = this.properties.get("id");
if (prop != null) {
String str = prop.getString();
p.getProperty("writing-mode").getEnum());
}
- /**
- * 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 an iterator over all the children of this FObj.
* @return A ListIterator.
return this.propMgr;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
}
fontInfo = foih.getFontInfo();
}
- /**
- * @param lms the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List lms) {
- if (children != null) {
- InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setLMiter(new LMiter(children.listIterator()));
- lms.add(lm);
- }
- }
-
/**
* @param data array of characters containing text to be added
* @param start starting array element to add
return new RecursiveCharIterator(this);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
}
+ "\" is not yet implemented.");
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
private void setup() {
getLogger().debug("Layout Unknown element");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
super.addCharacters(data, start, length);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo;
// XML
public String getNameSpace() {
return namespace;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
element.appendChild(text);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
super(parent);
}
- /**
- * Add start and end properties for the link
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List lms) {
- setup();
- InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager() {
- protected InlineParent createArea() {
- InlineParent area = super.createArea();
- setupLinkArea(parentLM, area);
- return area;
- }
- };
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setLMiter(new LMiter(children.listIterator()));
- lms.add(lm);
- }
-
- protected void setupLinkArea(LayoutProcessor parentLM, InlineParent area) {
- if (link == null) {
- return;
- }
- if (external) {
- area.addTrait(Trait.EXTERNAL_LINK, link);
- } else {
- PageViewport page = parentLM.resolveRefID(link);
- if (page != null) {
- area.addTrait(Trait.INTERNAL_LINK, page.getKey());
- } else {
- LinkResolver res = new LinkResolver(link, area);
- parentLM.addUnresolvedArea(link, res);
- }
- }
- }
-
- private void setup() {
+ public void setup() {
String destination;
int linkType;
return true;
}
- /**
- * Link resolving for resolving internal links.
- * This is static since it is independant of the link fo.
- */
- protected static class LinkResolver implements Resolveable, Serializable {
- private boolean resolved = false;
- private String idRef;
- private Area area;
-
- /**
- * Create a new link resolver.
- *
- * @param id the id to resolve
- * @param a the area that will have the link attribute
- */
- public LinkResolver(String id, Area a) {
- idRef = id;
- area = a;
- }
-
- /**
- * @return true if this link is resolved
- */
- public boolean isResolved() {
- return resolved;
- }
+ public String getLink() {
+ return link;
+ }
- public String[] getIDs() {
- return new String[] {idRef};
- }
+ public boolean getExternal() {
+ return external;
+ }
- /**
- * Resolve by adding an internal link.
- */
- public void resolve(String id, List pages) {
- resolved = true;
- if (idRef.equals(id) && pages != null) {
- PageViewport page = (PageViewport)pages.get(0);
- area.addTrait(Trait.INTERNAL_LINK, page.getKey());
- }
- }
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
}
}
-
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonRelativePosition;
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- if (false) {
- super.addLayoutManager(list);
- } else {
- ArrayList childList = new ArrayList();
- super.addLayoutManager(childList);
- for (int count = childList.size() - 1; count >= 0; count--) {
- LayoutProcessor lm = (LayoutProcessor) childList.get(count);
- if (lm.generatesInlineAreas()) {
- LayoutProcessor blm = new BidiLayoutManager((LeafNodeLayoutManager) lm);
- blm.setFObj(this);
- list.add(blm);
- } else {
- list.add(lm);
- }
- }
- }
- }
-
private void setup() {
// Common Aural Properties
return true;
}
- /**
- * If this bidi has a different writing mode direction
- * ltr or rtl than its parent writing mode then this
- * reverses the inline areas (at the character level).
- */
- class BidiLayoutManager extends LeafNodeLayoutManager {
-
- private List children;
-
- BidiLayoutManager(LeafNodeLayoutManager cLM) {
- children = new ArrayList();
-/* for (int count = cLM.size() - 1; count >= 0; count--) {
- InlineArea ia = cLM.get(count);
- if (ia instanceof Word) {
- // reverse word
- Word word = (Word) ia;
- StringBuffer sb = new StringBuffer(word.getWord());
- word.setWord(sb.reverse().toString());
- }
- children.add(ia);
- }
-*/ }
-
- public int size() {
- return children.size();
- }
-
- public InlineArea get(int index) {
- return (InlineArea) children.get(index);
- }
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
}
+
}
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.RecursiveCharIterator;
import org.apache.fop.fo.TextInfo;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.Constants;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
return this.span;
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- BlockLayoutManager blm = new BlockLayoutManager();
- blm.setUserAgent(getUserAgent());
- blm.setFObj(this);
- TextInfo ti = propMgr.getTextLayoutProps(fontInfo);
- blm.setBlockTextInfo(ti);
- list.add(blm);
- }
-
/**
* @return false (Block cannot generate inline areas)
*/
bNextIsLF = false;
}
}
-}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
+}
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
setupID();
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- BlockContainerLayoutManager blm = new BlockContainerLayoutManager();
- blm.setUserAgent(getUserAgent());
- blm.setFObj(this);
- blm.setOverflow(properties.get("overflow").getEnum());
- list.add(blm);
- }
-
private void setup() {
// Common Accessibility Properties
return this.span;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.OneCharIterator;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonBackground;
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- InlineArea inline = getInlineArea();
- if (inline != null) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setCurrentArea(inline);
- list.add(lm);
- }
- }
-
- protected InlineArea getInlineArea() {
+ public InlineArea getInlineArea() {
String str = this.properties.get("character").getString();
if (str.length() == 1) {
org.apache.fop.area.inline.Character ch =
// But what it the character is ignored due to white space handling?
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.TextAlign;
super(parent);
}
- /**
- * Add the layout manager for this to the list.
- * This adds a leafnode layout manager that deals with the
- * created viewport/image area.
- *
- * @param list the list to add the layout manager to
- */
- public void addLayoutManager(List list) {
- InlineArea area = getInlineArea();
- if (area != null) {
- setupID();
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setCurrentArea(area);
- lm.setAlignment(properties.get("vertical-align").getEnum());
- lm.setLead(viewHeight);
- list.add(lm);
- }
- }
-
/**
* Get the inline area for this external grpahic.
* This creates the image area and puts it inside a viewport.
*
* @return the viewport containing the image area
*/
- protected InlineArea getInlineArea() {
+ public InlineArea getInlineArea() {
setup();
if (url == null) {
return null;
placement = new Rectangle2D.Float(xoffset, yoffset, cwidth, cheight);
}
+ public int getViewHeight() {
+ return viewHeight;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* fo:float element.
// this.properties.get("clear");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Class modelling the fo:footnote object. See Sec. 6.10.3 of the XSL-FO
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List lms) {
- // add inlines layout manager
- if (inlineFO == null) {
- getLogger().error("inline required in footnote");
- return;
- }
- inlineFO.addLayoutManager(lms);
- }
-
/**
* @param child child FONode to be added to this object
*/
getLogger().error("invalid child of footnote: " + name);
}
}
+
+ /**
+ * Public accessor for inline FO
+ * @return the Inline object stored as inline FO
+ */
+ public Inline getInlineFO() {
+ return inlineFO;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Class modelling the fo:footnote-body object. See Sec. 6.10.4 of the XSL-FO
super(parent);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
// this.properties.get("word-spacing");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.InlineCharIterator;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.TextDecoration;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
return new InlineCharIterator(this, propMgr.getBorderAndPadding());
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List lms) {
- ArrayList childList = new ArrayList();
- super.addLayoutManager(childList);
- LayoutManager lm = new ICLayoutManager(childList);
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lms.add(lm);
- }
-
/**
* @see org.apache.fop.fo.FObj#handleAttrs
*/
return true;
}
- /**
- * This creates a single inline container area after
- * laying out the child block areas. All footnotes, floats
- * and id areas are maintained for later retrieval.
- */
- class ICLayoutManager extends LeafNodeLayoutManager {
-
- private List childrenLM;
-
- ICLayoutManager(List childLM) {
- childrenLM = childLM;
- }
-
- public InlineArea get(int index) {
- return null;
- }
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
}
+
}
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.XMLObj;
import org.apache.fop.fo.properties.DisplayAlign;
import org.apache.fop.fo.properties.Overflow;
*/
public class InstreamForeignObject extends FObj {
- private Viewport areaCurrent;
+ public Viewport areaCurrent;
/**
* constructs an instream-foreign-object object (called by Maker).
super(parent);
}
- /**
- * Add the layout manager for this into the list.
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
- */
- public void addLayoutManager(List list) {
- areaCurrent = getInlineArea();
- if (areaCurrent != null) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setCurrentArea(areaCurrent);
- lm.setAlignment(properties.get("vertical-align").getEnum());
- lm.setLead(areaCurrent.getHeight());
- list.add(lm);
- }
- }
-
/**
* Get the inline area created by this element.
*
* @return the viewport inline area
*/
- protected Viewport getInlineArea() {
+ public Viewport getInlineArea() {
if (children == null) {
return areaCurrent;
}
this.scaling = this.properties.get("scaling").getEnum();
*/
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.FOInputHandler;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.LeaderPattern;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
protected Document fontInfo = null;
/** FontState for this object */
protected Font fontState;
- protected InlineArea leaderArea = null;
+ public InlineArea leaderArea = null;
/**
* @param parent FONode that is the parent of this object
super(parent);
}
- /**
- *
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- LeafNodeLayoutManager lm = new LeafNodeLayoutManager() {
- public InlineArea get(LayoutContext context) {
- return getInlineArea();
- }
-
- protected MinOptMax getAllocationIPD(int refIPD) {
- return getAllocIPD(refIPD);
- }
-
- /*protected void offsetArea(LayoutContext context) {
- if(leaderPattern == LeaderPattern.DOTS) {
- curArea.setOffset(context.getBaseline());
- }
- }*/
- };
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setAlignment(properties.get("leader-alignment").getEnum());
- list.add(lm);
- }
-
- protected InlineArea getInlineArea() {
- if (leaderArea == null) {
- createLeaderArea();
- }
- return leaderArea;
- }
-
- protected void createLeaderArea() {
- setup();
-
- if (leaderPattern == LeaderPattern.RULE) {
- org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader();
-
- leader.setRuleStyle(ruleStyle);
- leader.setRuleThickness(ruleThickness);
-
- leaderArea = leader;
- } else if (leaderPattern == LeaderPattern.SPACE) {
- leaderArea = new Space();
- } else if (leaderPattern == LeaderPattern.DOTS) {
- Word w = new Word();
- char dot = '.'; // userAgent.getLeaderDotCharacter();
-
- w.setWord("" + dot);
- w.addTrait(Trait.FONT_NAME, fontState.getFontName());
- w.addTrait(Trait.FONT_SIZE,
- new Integer(fontState.getFontSize()));
- // set offset of dot within inline parent
- w.setOffset(fontState.getAscender());
- int width = CharUtilities.getCharWidth(dot, fontState);
- Space spacer = null;
- if (patternWidth > width) {
- spacer = new Space();
- spacer.setWidth(patternWidth - width);
- width = patternWidth;
- }
- FilledArea fa = new FilledArea();
- fa.setUnitWidth(width);
- fa.addChild(w);
- if (spacer != null) {
- fa.addChild(spacer);
- }
- fa.setHeight(fontState.getAscender());
-
- leaderArea = fa;
- } else if (leaderPattern == LeaderPattern.USECONTENT) {
- if (children == null) {
- getLogger().error("Leader use-content with no content");
- return;
- }
- InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setLMiter(new LMiter(children.listIterator()));
- lm.init();
-
- // get breaks then add areas to FilledArea
- FilledArea fa = new FilledArea();
-
- ContentLayoutManager clm = new ContentLayoutManager(fa);
- clm.setUserAgent(getUserAgent());
- lm.setParent(clm);
-
- clm.fillArea(lm);
- int width = clm.getStackingSize();
- Space spacer = null;
- if (patternWidth > width) {
- spacer = new Space();
- spacer.setWidth(patternWidth - width);
- width = patternWidth;
- }
- fa.setUnitWidth(width);
- if (spacer != null) {
- fa.addChild(spacer);
- }
- leaderArea = fa;
- }
- }
/**
* @param foih FOInputHandler to set
fontInfo = foih.getFontInfo();
}
- private void setup() {
+ public void setup() {
// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
}
- protected MinOptMax getAllocIPD(int ipd) {
+ public MinOptMax getAllocIPD(int ipd) {
// length of the leader
int opt = getLength("leader-length.optimum", ipd);
int min = getLength("leader-length.minimum", ipd);
}
return length;
}
-}
+ public int getRuleStyle() {
+ return ruleStyle;
+ }
+
+ public int getRuleThickness() {
+ return ruleThickness;
+ }
+
+ public int getLeaderPattern() {
+ return leaderPattern;
+ }
+
+ public Font getFontState() {
+ return fontState;
+ }
+
+ public int getPatternWidth() {
+ return patternWidth;
+ }
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
+}
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
super(parent);
}
- /**
- *
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- ListBlockLayoutManager blm = new ListBlockLayoutManager();
- blm.setUserAgent(getUserAgent());
- blm.setFObj(this);
- list.add(blm);
- }
-
private void setup() throws FOPException {
// Common Accessibility Properties
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
super(parent);
}
- /**
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- if (label != null && body != null) {
- ListItemLayoutManager blm = new ListItemLayoutManager();
- blm.setUserAgent(getUserAgent());
- blm.setFObj(this);
- blm.setLabel(label.getItemLayoutManager());
- blm.setBody(body.getItemLayoutManager());
- list.add(blm);
- } else {
- getLogger().error("list-item requires list-item-label and list-item-body");
- }
- }
-
private void setup() {
// Common Accessibility Properties
return true;
}
+ public ListItemLabel getLabel() {
+ return label;
+ }
+
+ public ListItemBody getBody() {
+ return body;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.layoutmgr.list.Item;
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.layoutmgr.list.Item;
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.flow;
// XML
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Marker formatting object.
return markerClassName;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
// this.properties.get("case-title");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
setupID();
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
/**
// this.properties.get("active-state");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
setupID();
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
// this.properties.get("switch-to");
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import java.util.List;
// FOP
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
fontInfo = foih.getFontInfo();
}
- /**
- * Overridden from FObj
- * @param lms the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List lms) {
- setup();
- LayoutManager lm;
- lm = new LeafNodeLayoutManager() {
- public InlineArea get(LayoutContext context) {
- // get page string from parent, build area
- Word inline = new Word();
- String str = parentLM.getCurrentPageNumber();
- int width = 0;
- for (int count = 0; count < str.length(); count++) {
- width += CharUtilities.getCharWidth(
- str.charAt(count), fontState);
- }
- inline.setWord(str);
- inline.setIPD(width);
- inline.setHeight(fontState.getAscender()
- - fontState.getDescender());
- inline.setOffset(fontState.getAscender());
-
- inline.addTrait(Trait.FONT_NAME,
- fontState.getFontName());
- inline.addTrait(Trait.FONT_SIZE,
- new Integer(fontState.getFontSize()));
-
- return inline;
- }
-
- protected void offsetArea(LayoutContext context) {
- curArea.setOffset(context.getBaseline());
- }
- };
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lms.add(lm);
- }
-
- private void setup() {
+ public void setup() {
// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
}
+ public Font getFontState() {
+ return fontState;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.area.inline.UnresolvedPageNumber;
import org.apache.fop.area.inline.Word;
import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOInputHandler;
fontInfo = foih.getFontInfo();
}
- /**
- * Overridden from FObj
- * @param lms the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List lms) {
- setup();
- LayoutManager lm;
- lm = new LeafNodeLayoutManager() {
- public InlineArea get(LayoutContext context) {
- return getInlineArea(parentLM);
- }
-
- public void addAreas(PositionIterator posIter,
- LayoutContext context) {
- super.addAreas(posIter, context);
- if (unresolved) {
- parentLM.addUnresolvedArea(refId,
- (Resolveable) inline);
- }
- }
-
- protected void offsetArea(LayoutContext context) {
- curArea.setOffset(context.getBaseline());
- }
- };
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lms.add(lm);
- }
-
// if id can be resolved then simply return a word, otherwise
// return a resolveable area
- private InlineArea getInlineArea(LayoutProcessor parentLM) {
+ public InlineArea getInlineArea(LayoutProcessor parentLM) {
if (refId.equals("")) {
getLogger().error("page-number-citation must contain \"ref-id\"");
return null;
return width;
}
- private void setup() {
+ public void setup() {
// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
}
-}
+ public String getRefId() {
+ return refId;
+ }
+ public InlineArea getInline() {
+ return inline;
+ }
+
+ public boolean getUnresolved() {
+ return unresolved;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
+}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.flow;
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager;
import org.xml.sax.Attributes;
this.properties.get("retrieve-boundary").getEnum();
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager(List)
- */
- public void addLayoutManager(List lms) {
- RetrieveMarkerLayoutManager rmlm;
- rmlm = new RetrieveMarkerLayoutManager(retrieveClassName,
- retrievePosition,
- retrieveBoundary);
- rmlm.setUserAgent(getUserAgent());
- rmlm.setFObj(this);
- lms.add(rmlm);
+ public String getRetrieveClassName() {
+ return retrieveClassName;
+ }
+
+ public int getRetrievePosition() {
+ return retrievePosition;
}
+
+ public int getRetrieveBoundary() {
+ return retrieveBoundary;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.datatypes.LengthRange;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.TableLayout;
import org.apache.fop.fo.properties.TableOmitFooterAtBreak;
import org.apache.fop.fo.properties.TableOmitHeaderAtBreak;
}
}
- /**
- * 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) {
- TableLayoutManager tlm = new TableLayoutManager();
- tlm.setUserAgent(getUserAgent());
- tlm.setFObj(this);
- tlm.setColumns(columns);
- if (tableHeader != null) {
- tlm.setTableHeader(tableHeader.getLayoutManager());
- }
- if (tableFooter != null) {
- tlm.setTableFooter(tableFooter.getLayoutManager());
- }
- list.add(tlm);
- }
-
private void setup() {
// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
return true;
}
+ public ArrayList getColumns() {
+ return columns;
+ }
+
+ public TableBody getTableHeader() {
+ return tableHeader;
+ }
+
+ public TableBody getTableFooter() {
+ return tableFooter;
+ }
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
super(parent);
}
- /**
- * 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) {
- list.add(getLayoutManager());
- }
-
- public Body getLayoutManager() {
- Body blm = new Body();
- blm.setUserAgent(getUserAgent());
- blm.setFObj(this);
- return blm;
- }
-
private void setup() throws FOPException {
// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.BorderCollapse;
import org.apache.fop.fo.properties.DisplayAlign;
doSetup(); // init some basic property values
}
- /**
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- Cell clm = new Cell();
- clm.setUserAgent(getUserAgent());
- clm.setFObj(this);
- list.add(clm);
- }
-
/**
* Set position relative to table (set by body?)
*/
return true;
}
-}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+}
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.Property;
import org.apache.fop.fo.properties.CommonBackground;
setup = true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Class modelling the fo:table-footer object. See Sec. 6.7.7 of the XSL-FO
super(parent);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Class modelling the fo:table-header object. See Sec. 6.7.6 of the XSL-FO
super(parent);
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.Constants;
import org.apache.fop.fo.properties.CommonAccessibility;
super(parent);
}
- /**
- * @param list the list to which the layout manager(s) should be added
- */
- public void addLayoutManager(List list) {
- Row rlm = new Row();
- rlm.setUserAgent(getUserAgent());
- rlm.setFObj(this);
- list.add(rlm);
- }
-
/**
* @return keepWithPrevious
*/
return new KeepValue(KeepValue.KEEP_WITH_AUTO, 0);
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Implementation for fo:wrapper formatting object.
return true;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* The fo:color-profile formatting object.
getLogger().error("Color Profile src not an ICC Profile", iae);
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// XML
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.BlankOrNotBlank;
import org.apache.fop.fo.properties.OddOrEven;
import org.apache.fop.fo.properties.PagePosition;
* @param isBlankPage True if page is blank
* @return True if the conditions for this reference are met
*/
- protected boolean isValid(boolean isOddPage,
+ protected boolean isValid(boolean isOddPage,
boolean isFirstPage,
boolean isBlankPage) {
// page-position
}
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.XMLObj;
}
children = null;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
import org.apache.fop.layoutmgr.FlowLayoutManager;
return true;
}
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- FlowLayoutManager lm = new FlowLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- list.add(lm);
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
}
-
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
/**
* information for a page sequence.
*/
public class LayoutMasterSet extends FObj {
-
+
private Map simplePageMasters;
private Map pageSequenceMasters;
* @param pageSequenceMaster PageSequenceMaster instance
* @throws FOPException if there's a problem with name uniqueness
*/
- protected void addPageSequenceMaster(String masterName,
+ protected void addPageSequenceMaster(String masterName,
PageSequenceMaster pageSequenceMaster)
throws FOPException {
// check against duplication of master-name
}
return false;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// SAX
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Base PageMasterReference class. Provides implementation for handling the
}
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.area.AreaTree;
import org.apache.fop.area.PageViewport;
return titleFO;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
/**
* which are simple or complex references to page-masters.
*/
public class PageSequenceMaster extends FObj {
-
+
private LayoutMasterSet layoutMasterSet;
private List subSequenceSpecifiers;
private SubSequenceSpecifier currentSubSequence;
// references to page-masters. So the methods use the former
// terminology ('sub-sequence-specifiers', or SSS),
// but the actual FO's are MasterReferences.
-
+
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
return pageMaster;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.apps.FOPException;
public int getExtent() {
return 0;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.area.RegionReference;
public String getRegionClass() {
return Region.AFTER;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.properties.Precedence;
import org.apache.fop.fo.properties.WritingMode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Abstract base class for fo:region-before and fo:region-after.
}
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Base class for Before, After, Start and End regions (BASE).
public int getExtent() {
return this.extent;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// FOP
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.area.RegionReference;
// Java
}
return vpRect;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.Property;
import org.apache.fop.fo.properties.Overflow;
} else {
vpRect = new Rectangle(start, mProps.spaceBefore,
reldims.bpd - mProps.spaceBefore - mProps.spaceAfter,
- reldims.ipd - start
+ reldims.ipd - start
- getRelMargin(PropertyList.END, "end-indent"));
}
return vpRect;
*/
private int getRelMargin(int reldir, String sRelPropName) {
FObj parent = (FObj) getParent();
- String sPropName = "margin-"
+ String sPropName = "margin-"
+ parent.properties.wmRelToAbs(reldir);
Property prop = properties.getExplicitBaseProp(sPropName);
if (prop == null) {
return body;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.area.RegionReference;
public int getRegionAreaClass() {
return RegionReference.END;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.WritingMode;
/**
}
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.area.RegionReference;
public int getRegionAreaClass() {
return RegionReference.START;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
/**
this.numberConsumed = 0;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// XML
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
/**
this.numberConsumed = 0;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.control.Document;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* The fo:root formatting object. Contains page masters, page-sequences.
return document;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
// Java
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Page;
import org.apache.fop.area.RegionViewport;
if (child instanceof Region) {
addRegion((Region)child);
} else {
- getLogger().error("SimplePageMaster cannot have child of type "
+ getLogger().error("SimplePageMaster cannot have child of type "
+ child.getName());
}
}
}
/**
- * Indicates if a region with a given name exists in this
+ * Indicates if a region with a given name exists in this
* simple-page-master.
* @param regionName name of the region to lookup
* @return True if a region with this name exists
}
return false;
}
-}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
+}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fo.pagination;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* A single-page-master-reference formatting object.
public void reset() {
this.state = FIRST;
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
import org.apache.fop.layoutmgr.StaticContentLayoutManager;
return lm;
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.LengthProperty;
import org.apache.fop.fo.Property;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAural;
import org.apache.fop.fo.properties.CommonBackground;
Length zIndex = this.properties.get("z-index").getLength();
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.fonts.type1;
// Java
private int[] extentTable;
private Map kerningTab = new java.util.HashMap();
-
+
/**
* Parses a PFM file
*
getLogger().warn("Size of extension block was expected to be "
+ "52 bytes, but was " + size + " bytes.");
}
- inStream.skip(12); //Skip etmPointSize, etmOrientation, etmMasterHeight,
+ inStream.skip(12); //Skip etmPointSize, etmOrientation, etmMasterHeight,
//etmMinScale, etmMaxScale, emtMasterUnits
etmCapHeight = inStream.readShort();
etmXHeight = inStream.readShort();
* Return the kerning table. The kerning table is a Map with
* strings with glyphnames as keys, containing Maps as value.
* The value map contains a glyph name string key and an Integer value
- *
+ *
* @return A Map containing the kerning table
*/
public Map getKerning() {
package org.apache.fop.layout;
-import org.apache.fop.fo.FOTreeExternal;
-
/**
* Abstract class defining the highest-level information for a layout strategy.
* Subclasses implement a layout strategy that converts an FO Tree into an
public abstract class LayoutStrategy {
private String name = "undefined";
- private FOTreeExternal fote = null;
/**
* Returns the name of this LayoutStrategy.
return name;
}
- /**
- *
- * @return the FOTreeExternal object for this LayoutStrategy
- */
- public FOTreeExternal getFOTreeExternal() {
- if (fote == null) {
- fote = new FOTreeExternal();
- }
- return fote;
- }
}
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+
+package org.apache.fop.layoutmgr;
+
+import org.apache.fop.area.LinkResolver;
+import org.apache.fop.area.PageViewport;
+import org.apache.fop.area.Resolveable;
+import org.apache.fop.area.Trait;
+import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.InlineParent;
+import org.apache.fop.area.inline.FilledArea;
+import org.apache.fop.area.inline.Space;
+import org.apache.fop.area.inline.Word;
+
+import org.apache.fop.fo.FOTreeVisitor;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FOText;
+import org.apache.fop.fo.TextInfo;
+import org.apache.fop.fo.flow.BidiOverride;
+import org.apache.fop.fo.flow.Inline;
+import org.apache.fop.fo.flow.BasicLink;
+import org.apache.fop.fo.flow.Block;
+import org.apache.fop.fo.flow.Leader;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.flow.Character;
+import org.apache.fop.fo.flow.ExternalGraphic;
+import org.apache.fop.fo.flow.BlockContainer;
+import org.apache.fop.fo.flow.Footnote;
+import org.apache.fop.fo.flow.ListBlock;
+import org.apache.fop.fo.flow.InstreamForeignObject;
+import org.apache.fop.fo.flow.InlineContainer;
+import org.apache.fop.fo.flow.ListItem;
+import org.apache.fop.fo.flow.PageNumber;
+import org.apache.fop.fo.flow.PageNumberCitation;
+import org.apache.fop.fo.flow.Table;
+import org.apache.fop.fo.flow.TableBody;
+import org.apache.fop.fo.flow.TableCell;
+import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.pagination.Flow;
+
+import org.apache.fop.fo.properties.LeaderPattern;
+
+import org.apache.fop.layoutmgr.BidiLayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
+import org.apache.fop.layoutmgr.LMiter;
+import org.apache.fop.layoutmgr.table.Cell;
+import org.apache.fop.layoutmgr.table.Body;
+import org.apache.fop.layoutmgr.table.Row;
+import org.apache.fop.layoutmgr.table.TableLayoutManager;
+import org.apache.fop.layoutmgr.list.ListBlockLayoutManager;
+import org.apache.fop.layoutmgr.list.ListItemLayoutManager;
+import org.apache.fop.util.CharUtilities;
+
+import java.util.List;
+import java.util.ListIterator;
+import java.util.ArrayList;
+
+/**
+ * Concrete implementation of FOTreeVisitor for the purpose of adding
+ * Layout Managers for nodes in the FOTree.
+ * Each method is responsible to return a LayoutManager responsible for laying
+ * out this FObj's content.
+ * @see org.apache.fop.fo.FOTreeVisitor
+ */
+
+public class AddLMVisitor extends FOTreeVisitor {
+
+ /** The List object to which methods in this class should add Layout
+ * Managers */
+ private List currentLMList;
+
+ /** A List object which can be used to save and restore the currentLMList if
+ * another List should temporarily be used */
+ private List saveLMList;
+
+ /**
+ *
+ * @param fobj the FObj object for which a layout manager should be created
+ * @param lmList the list to which the newly created layout manager(s)
+ * should be added
+ */
+ public void addLayoutManager(FObj fobj, List lmList) {
+ /* Store the List in a global variable so that it can be accessed by the
+ Visitor methods */
+ currentLMList = lmList;
+ fobj.acceptVisitor(this);
+ }
+
+ public void serveVisitor(FOText node) {
+ if (node.length == 0) {
+ return;
+ }
+ if (node.length < node.ca.length) {
+ char[] tmp = node.ca;
+ node.ca = new char[node.length];
+ System.arraycopy(tmp, 0, node.ca, 0, node.length);
+ }
+ LayoutManager lm = new TextLayoutManager(node.ca, node.textInfo);
+ lm.setFObj(node);
+ currentLMList.add(lm);
+ }
+
+ public void serveVisitor(FObjMixed node) {
+ if (node.getChildren() != null) {
+ InlineStackingLayoutManager lm;
+ lm = new InlineStackingLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setLMiter(new LMiter(node.getChildren()));
+ currentLMList.add(lm);
+ }
+ }
+
+ public void serveVisitor(BidiOverride node) {
+ if (false) {
+ serveVisitor((FObjMixed)node);
+ } else {
+ ArrayList childList = new ArrayList();
+ saveLMList = currentLMList;
+ currentLMList = childList;
+ serveVisitor((FObjMixed)node);
+ currentLMList = saveLMList;
+ for (int count = childList.size() - 1; count >= 0; count--) {
+ LayoutProcessor lm = (LayoutProcessor) childList.get(count);
+ if (lm.generatesInlineAreas()) {
+ LayoutProcessor blm = new BidiLayoutManager((LeafNodeLayoutManager) lm);
+ blm.setFObj(node);
+ currentLMList.add(blm);
+ } else {
+ currentLMList.add(lm);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param node Inline object to process
+ */
+ public void serveVisitor(Inline node) {
+ serveVisitor((FObjMixed)node);
+ }
+
+ public void serveVisitor(Footnote node) {
+ if (node.getInlineFO() == null) {
+ node.getLogger().error("inline required in footnote");
+ return;
+ }
+ serveVisitor(node.getInlineFO());
+ }
+
+ public void serveVisitor(InlineContainer node) {
+ ArrayList childList = new ArrayList();
+ saveLMList = currentLMList;
+ currentLMList = childList;
+ serveVisitor((FObj)node);
+ currentLMList = saveLMList;
+ LayoutManager lm = new ICLayoutManager(childList);
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ currentLMList.add(lm);
+ }
+
+ /**
+ * Add start and end properties for the link
+ */
+ public void serveVisitor(BasicLink node) {
+ node.setup();
+ InlineStackingLayoutManager lm;
+ lm = new InlineStackingLayoutManager() {
+ protected InlineParent createArea(BasicLink node) {
+ InlineParent area = super.createArea();
+ setupBasicLinkArea(node, parentLM, area);
+ return area;
+ }
+ };
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setLMiter(new LMiter(node.getChildren()));
+ currentLMList.add(lm);
+ }
+
+ protected void setupBasicLinkArea(BasicLink node, LayoutProcessor parentLM,
+ InlineParent area) {
+ if (node.getLink() == null) {
+ return;
+ }
+ if (node.getExternal()) {
+ area.addTrait(Trait.EXTERNAL_LINK, node.getLink());
+ } else {
+ PageViewport page = parentLM.resolveRefID(node.getLink());
+ if (page != null) {
+ area.addTrait(Trait.INTERNAL_LINK, page.getKey());
+ } else {
+ LinkResolver res = new LinkResolver(node.getLink(), area);
+ parentLM.addUnresolvedArea(node.getLink(), res);
+ }
+ }
+ }
+
+ public void serveVisitor(Block node) {
+ BlockLayoutManager blm = new BlockLayoutManager();
+ blm.setUserAgent(node.getUserAgent());
+ blm.setFObj(node);
+ TextInfo ti = node.getPropertyManager().getTextLayoutProps(node.getDocument());
+ blm.setBlockTextInfo(ti);
+ currentLMList.add(blm);
+ }
+
+ public void serveVisitor(final Leader node) {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager() {
+ public InlineArea get(LayoutContext context) {
+ return getLeaderInlineArea(node);
+ }
+
+ protected MinOptMax getAllocationIPD(int refIPD) {
+ return node.getAllocIPD(refIPD);
+ }
+
+ /*protected void offsetArea(LayoutContext context) {
+ if(leaderPattern == LeaderPattern.DOTS) {
+ curArea.setOffset(context.getBaseline());
+ }
+ }*/
+ };
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setAlignment(node.properties.get("leader-alignment").getEnum());
+ currentLMList.add(lm);
+ }
+
+ private InlineArea getLeaderInlineArea(Leader node) {
+ if (node.leaderArea == null) {
+ createLeaderArea(node);
+ }
+ return node.leaderArea;
+ }
+
+ protected void createLeaderArea(Leader node) {
+ node.setup();
+
+ if (node.getLeaderPattern() == LeaderPattern.RULE) {
+ org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader();
+
+ leader.setRuleStyle(node.getRuleStyle());
+ leader.setRuleThickness(node.getRuleThickness());
+
+ node.leaderArea = leader;
+ } else if (node.getLeaderPattern() == LeaderPattern.SPACE) {
+ node.leaderArea = new Space();
+ } else if (node.getLeaderPattern() == LeaderPattern.DOTS) {
+ Word w = new Word();
+ char dot = '.'; // userAgent.getLeaderDotCharacter();
+
+ w.setWord("" + dot);
+ w.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
+ w.addTrait(Trait.FONT_SIZE,
+ new Integer(node.getFontState().getFontSize()));
+ // set offset of dot within inline parent
+ w.setOffset(node.getFontState().getAscender());
+ int width = CharUtilities.getCharWidth(dot, node.getFontState());
+ Space spacer = null;
+ if (node.getPatternWidth() > width) {
+ spacer = new Space();
+ spacer.setWidth(node.getPatternWidth() - width);
+ width = node.getPatternWidth();
+ }
+ FilledArea fa = new FilledArea();
+ fa.setUnitWidth(width);
+ fa.addChild(w);
+ if (spacer != null) {
+ fa.addChild(spacer);
+ }
+ fa.setHeight(node.getFontState().getAscender());
+
+ node.leaderArea = fa;
+ } else if (node.getLeaderPattern() == LeaderPattern.USECONTENT) {
+ if (node.getChildren() == null) {
+ node.getLogger().error("Leader use-content with no content");
+ return;
+ }
+ InlineStackingLayoutManager lm;
+ lm = new InlineStackingLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setLMiter(new LMiter(node.getChildren()));
+ lm.init();
+
+ // get breaks then add areas to FilledArea
+ FilledArea fa = new FilledArea();
+
+ ContentLayoutManager clm = new ContentLayoutManager(fa);
+ clm.setUserAgent(node.getUserAgent());
+ lm.setParent(clm);
+
+ clm.fillArea(lm);
+ int width = clm.getStackingSize();
+ Space spacer = null;
+ if (node.getPatternWidth() > width) {
+ spacer = new Space();
+ spacer.setWidth(node.getPatternWidth() - width);
+ width = node.getPatternWidth();
+ }
+ fa.setUnitWidth(width);
+ if (spacer != null) {
+ fa.addChild(spacer);
+ }
+ node.leaderArea = fa;
+ }
+ }
+
+ public void serveVisitor(RetrieveMarker node) {
+ RetrieveMarkerLayoutManager rmlm;
+ rmlm = new RetrieveMarkerLayoutManager(node.getRetrieveClassName(),
+ node.getRetrievePosition(),
+ node.getRetrieveBoundary());
+ rmlm.setUserAgent(node.getUserAgent());
+ rmlm.setFObj(node);
+ currentLMList.add(rmlm);
+ }
+
+ public void serveVisitor(Character node) {
+ InlineArea inline = node.getInlineArea();
+ if (inline != null) {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setCurrentArea(inline);
+ currentLMList.add(lm);
+ }
+ }
+
+ /**
+ * This adds a leafnode layout manager that deals with the
+ * created viewport/image area.
+ */
+ public void serveVisitor(ExternalGraphic node) {
+ InlineArea area = node.getInlineArea();
+ if (area != null) {
+ node.setupID();
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setCurrentArea(area);
+ lm.setAlignment(node.properties.get("vertical-align").getEnum());
+ lm.setLead(node.getViewHeight());
+ currentLMList.add(lm);
+ }
+ }
+
+ public void serveVisitor(BlockContainer node) {
+ BlockContainerLayoutManager blm = new BlockContainerLayoutManager();
+ blm.setUserAgent(node.getUserAgent());
+ blm.setFObj(node);
+ blm.setOverflow(node.properties.get("overflow").getEnum());
+ currentLMList.add(blm);
+ }
+
+ public void serveVisitor(ListBlock node) {
+ ListBlockLayoutManager blm = new ListBlockLayoutManager();
+ blm.setUserAgent(node.getUserAgent());
+ blm.setFObj(node);
+ currentLMList.add(blm);
+ }
+
+ public void serveVisitor(InstreamForeignObject node) {
+ node.areaCurrent = node.getInlineArea();
+ if (node.areaCurrent != null) {
+ LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ lm.setCurrentArea(node.areaCurrent);
+ lm.setAlignment(node.properties.get("vertical-align").getEnum());
+ lm.setLead(node.areaCurrent.getHeight());
+ currentLMList.add(lm);
+ }
+ }
+
+ public void serveVisitor(ListItem node) {
+ if (node.getLabel() != null && node.getBody() != null) {
+ ListItemLayoutManager blm = new ListItemLayoutManager();
+ blm.setUserAgent(node.getUserAgent());
+ blm.setFObj(node);
+ blm.setLabel(node.getLabel().getItemLayoutManager());
+ blm.setBody(node.getBody().getItemLayoutManager());
+ currentLMList.add(blm);
+ } else {
+ node.getLogger().error("list-item requires list-item-label and list-item-body");
+ }
+ }
+
+ /**
+ * Overridden from FObj
+ * @param lms the list to which the layout manager(s) should be added
+ */
+ public void serveVisitor(final PageNumber node) {
+ node.setup();
+ LayoutManager lm;
+ lm = new LeafNodeLayoutManager() {
+ public InlineArea get(LayoutContext context) {
+ // get page string from parent, build area
+ Word inline = new Word();
+ String str = parentLM.getCurrentPageNumber();
+ int width = 0;
+ for (int count = 0; count < str.length(); count++) {
+ width += CharUtilities.getCharWidth(
+ str.charAt(count), node.getFontState());
+ }
+ inline.setWord(str);
+ inline.setIPD(width);
+ inline.setHeight(node.getFontState().getAscender()
+ - node.getFontState().getDescender());
+ inline.setOffset(node.getFontState().getAscender());
+
+ inline.addTrait(Trait.FONT_NAME,
+ node.getFontState().getFontName());
+ inline.addTrait(Trait.FONT_SIZE,
+ new Integer(node.getFontState().getFontSize()));
+
+ return inline;
+ }
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
+ };
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ currentLMList.add(lm);
+ }
+
+ public void serveVisitor(final PageNumberCitation node) {
+ node.setup();
+ LayoutManager lm;
+ lm = new LeafNodeLayoutManager() {
+ public InlineArea get(LayoutContext context) {
+ return node.getInlineArea(parentLM);
+ }
+
+ public void addAreas(PositionIterator posIter,
+ LayoutContext context) {
+ super.addAreas(posIter, context);
+ if (node.getUnresolved()) {
+ parentLM.addUnresolvedArea(node.getRefId(),
+ (Resolveable) node.getInline());
+ }
+ }
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
+ };
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ currentLMList.add(lm);
+ }
+
+ public void serveVisitor(Table node) {
+ TableLayoutManager tlm = new TableLayoutManager();
+ tlm.setUserAgent(node.getUserAgent());
+ tlm.setFObj(node);
+ tlm.setColumns(node.getColumns());
+ if (node.getTableHeader() != null) {
+ tlm.setTableHeader(getTableBodyLayoutManager(node.getTableHeader()));
+ }
+ if (node.getTableFooter() != null) {
+ tlm.setTableFooter(getTableBodyLayoutManager(node.getTableFooter()));
+ }
+ currentLMList.add(tlm);
+ }
+
+ public void serveVisitor(TableBody node) {
+ currentLMList.add(getTableBodyLayoutManager(node));
+ }
+
+ public Body getTableBodyLayoutManager(TableBody node) {
+ Body blm = new Body();
+ blm.setUserAgent(node.getUserAgent());
+ blm.setFObj(node);
+ return blm;
+ }
+
+ public void serveVisitor(TableCell node) {
+ Cell clm = new Cell();
+ clm.setUserAgent(node.getUserAgent());
+ clm.setFObj(node);
+ currentLMList.add(clm);
+ }
+
+ public void serveVisitor(TableRow node) {
+ Row rlm = new Row();
+ rlm.setUserAgent(node.getUserAgent());
+ rlm.setFObj(node);
+ currentLMList.add(rlm);
+ }
+
+ public void serveVisitor(Flow node) {
+ FlowLayoutManager lm = new FlowLayoutManager();
+ lm.setUserAgent(node.getUserAgent());
+ lm.setFObj(node);
+ currentLMList.add(lm);
+ }
+
+}
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.layoutmgr;
+
+// FOP
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.properties.CommonAural;
+import org.apache.fop.fo.properties.CommonRelativePosition;
+
+import org.apache.fop.layoutmgr.LeafNodeLayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
+import org.apache.fop.area.inline.InlineArea;
+
+import java.util.List;
+import java.util.ArrayList;
+
+
+/**
+ * If this bidi has a different writing mode direction
+ * ltr or rtl than its parent writing mode then this
+ * reverses the inline areas (at the character level).
+ */
+class BidiLayoutManager extends LeafNodeLayoutManager {
+
+ private List children;
+
+ BidiLayoutManager(LeafNodeLayoutManager cLM) {
+ children = new ArrayList();
+/*
+ for (int count = cLM.size() - 1; count >= 0; count--) {
+ InlineArea ia = cLM.get(count);
+ if (ia instanceof Word) {
+ // reverse word
+ Word word = (Word) ia;
+ StringBuffer sb = new StringBuffer(word.getWord());
+ word.setWord(sb.reverse().toString());
+ }
+ children.add(ia);
+ }
+*/
+ }
+
+ public int size() {
+ return children.size();
+ }
+
+ public InlineArea get(int index) {
+ return (InlineArea) children.get(index);
+ }
+
+}
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.layoutmgr;
+
+// Java
+import java.util.List;
+
+// FOP
+import org.apache.fop.area.inline.InlineArea;
+
+/**
+ * This creates a single inline container area after
+ * laying out the child block areas. All footnotes, floats
+ * and id areas are maintained for later retrieval.
+ */
+public class ICLayoutManager extends LeafNodeLayoutManager {
+
+ private List childrenLM;
+
+ ICLayoutManager(List childLM) {
+ childrenLM = childLM;
+ }
+
+ public InlineArea get(int index) {
+ return null;
+ }
+
+}
+++ /dev/null
-/*
- * $Id$
- * ============================================================================
- * The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by the Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- * endorse or promote products derived from this software without prior
- * written permission. For written permission, please contact
- * apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- * "Apache" appear in their name, without prior written permission of the
- * Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-
-package org.apache.fop.layoutmgr;
-
-import org.apache.fop.fo.FOTreeExternal;
-/**
- * Implementation of FOTreeExternal for LayoutStrategy-specific calls while the
- * FO Tree is being built.
- * @see org.apache.fop.fo.FOTreeExternal
- */
-
-public class LMFOTreeExternal extends FOTreeExternal {
-
-}
-
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.layoutmgr;
import org.apache.fop.fo.FObj;
private FObj curFO;
protected List listLMs;
protected int curPos = 0;
+ private AddLMVisitor addLMVisitor = new AddLMVisitor();
public LMiter(ListIterator bIter) {
baseIter = bIter;
if (theobj instanceof FObj) {
FObj fobj = (FObj) theobj;
//listLMs.add(fobj.getLayoutManager());
- fobj.addLayoutManager(listLMs);
+ addLMVisitor.addLayoutManager(fobj, listLMs);
if (curPos < listLMs.size()) {
return true;
}
*/
package org.apache.fop.layoutmgr;
-import org.apache.fop.fo.FOTreeExternal;
import org.apache.fop.layout.LayoutStrategy;
/**
public class LayoutManagerLS extends LayoutStrategy {
private static String name = "layoutmgr";
- private FOTreeExternal fote = null;
-
- public FOTreeExternal getFOTreeExternal() {
- if (fote == null) {
- fote = new LMFOTreeExternal();
- }
- return fote;
- }
}
private String name;
private int position;
private int boundary;
+ private AddLMVisitor addLMVisitor = new AddLMVisitor();
/**
* Create a new block container layout manager.
List list = new ArrayList();
Marker marker = retrieveMarker(name, position, boundary);
if (marker != null) {
- marker.addLayoutManager(list);
+ addLMVisitor.addLayoutManager(marker, list);
if (list.size() > 0) {
replaceLM = (LayoutProcessor)list.get(0);
replaceLM.setParent(this);
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.svg;
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
import org.apache.batik.dom.svg.SVGOMDocument;
public AffineTransform getScreenTransform() {
throw new UnsupportedOperationException("NYI");
}
-
+
/**
- * Sets the transform to be used from the global transform space
+ * Sets the transform to be used from the global transform space
* to pixels.
*/
public void setScreenTransform(AffineTransform at) {
throw new UnsupportedOperationException("NYI");
}
-
+
public AffineTransform getCTM() {
return new AffineTransform();
}
return 100;
}
}
+
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}
* ============================================================================
* The Apache Software License, Version 1.1
* ============================================================================
- *
+ *
* Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without modifica-
* tion, are permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment: "This product includes software
* developed by the Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "FOP" and "Apache Software Foundation" must not be used to
* endorse or promote products derived from this software without prior
* written permission. For written permission, please contact
* apache@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache", nor may
* "Apache" appear in their name, without prior written permission of the
* Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ============================================================================
- *
+ *
* This software consists of voluntary contributions made by many individuals
* on behalf of the Apache Software Foundation and was originally created by
* James Tauber <jtauber@jtauber.com>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.svg;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.XMLObj;
+import org.apache.fop.fo.FOTreeVisitor;
/**
* Class for SVG element objects.
return "http://www.w3.org/2000/svg";
}
+ public void acceptVisitor(FOTreeVisitor fotv) {
+ fotv.serveVisitor(this);
+ }
+
}