Browse Source

1. Remove fo/FOTreeExternal and layoutmgr/LMFOTreeExternal (in favor of Visitor concept, see item 2)

2. Add fo/FOTreeVisitor and layoutmgr/AddLMVisitor
3. Remove all occurrences of addLayoutManager in fo/FObj subclasses, replacing them with equivalent methods in AddLMVisitor


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196809 13f79535-47bb-0310-9956-ffa450edef68
pull/30/head
William Victor Mote 21 years ago
parent
commit
4a4027028e
88 changed files with 2238 additions and 888 deletions
  1. 1
    1
      src/java/org/apache/fop/apps/Driver.java
  2. 103
    0
      src/java/org/apache/fop/area/LinkResolver.java
  3. 6
    0
      src/java/org/apache/fop/extensions/Bookmarks.java
  4. 15
    10
      src/java/org/apache/fop/extensions/ExtensionObj.java
  5. 15
    10
      src/java/org/apache/fop/extensions/Label.java
  6. 15
    10
      src/java/org/apache/fop/extensions/Outline.java
  7. 17
    2
      src/java/org/apache/fop/fo/FONode.java
  8. 6
    19
      src/java/org/apache/fop/fo/FOText.java
  9. 8
    0
      src/java/org/apache/fop/fo/FOTreeExternal.java
  10. 673
    0
      src/java/org/apache/fop/fo/FOTreeVisitor.java
  11. 4
    9
      src/java/org/apache/fop/fo/FObj.java
  12. 3
    14
      src/java/org/apache/fop/fo/FObjMixed.java
  13. 4
    0
      src/java/org/apache/fop/fo/ToBeImplementedElement.java
  14. 5
    0
      src/java/org/apache/fop/fo/Unknown.java
  15. 4
    0
      src/java/org/apache/fop/fo/UnknownXMLObj.java
  16. 15
    10
      src/java/org/apache/fop/fo/XMLElement.java
  17. 4
    0
      src/java/org/apache/fop/fo/XMLObj.java
  18. 10
    78
      src/java/org/apache/fop/fo/flow/BasicLink.java
  19. 4
    52
      src/java/org/apache/fop/fo/flow/BidiOverride.java
  20. 6
    13
      src/java/org/apache/fop/fo/flow/Block.java
  21. 5
    11
      src/java/org/apache/fop/fo/flow/BlockContainer.java
  22. 5
    15
      src/java/org/apache/fop/fo/flow/Character.java
  23. 10
    22
      src/java/org/apache/fop/fo/flow/ExternalGraphic.java
  24. 6
    0
      src/java/org/apache/fop/fo/flow/Float.java
  25. 14
    12
      src/java/org/apache/fop/fo/flow/Footnote.java
  26. 5
    0
      src/java/org/apache/fop/fo/flow/FootnoteBody.java
  27. 6
    0
      src/java/org/apache/fop/fo/flow/InitialPropertySet.java
  28. 5
    0
      src/java/org/apache/fop/fo/flow/Inline.java
  29. 4
    28
      src/java/org/apache/fop/fo/flow/InlineContainer.java
  30. 8
    19
      src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
  31. 28
    109
      src/java/org/apache/fop/fo/flow/Leader.java
  32. 5
    11
      src/java/org/apache/fop/fo/flow/ListBlock.java
  33. 13
    16
      src/java/org/apache/fop/fo/flow/ListItem.java
  34. 5
    0
      src/java/org/apache/fop/fo/flow/ListItemBody.java
  35. 5
    0
      src/java/org/apache/fop/fo/flow/ListItemLabel.java
  36. 14
    10
      src/java/org/apache/fop/fo/flow/Marker.java
  37. 6
    0
      src/java/org/apache/fop/fo/flow/MultiCase.java
  38. 6
    0
      src/java/org/apache/fop/fo/flow/MultiProperties.java
  39. 6
    0
      src/java/org/apache/fop/fo/flow/MultiPropertySet.java
  40. 6
    0
      src/java/org/apache/fop/fo/flow/MultiSwitch.java
  41. 6
    0
      src/java/org/apache/fop/fo/flow/MultiToggle.java
  42. 10
    41
      src/java/org/apache/fop/fo/flow/PageNumber.java
  43. 19
    33
      src/java/org/apache/fop/fo/flow/PageNumberCitation.java
  44. 26
    21
      src/java/org/apache/fop/fo/flow/RetrieveMarker.java
  45. 17
    19
      src/java/org/apache/fop/fo/flow/Table.java
  46. 5
    0
      src/java/org/apache/fop/fo/flow/TableAndCaption.java
  47. 5
    16
      src/java/org/apache/fop/fo/flow/TableBody.java
  48. 5
    0
      src/java/org/apache/fop/fo/flow/TableCaption.java
  49. 5
    11
      src/java/org/apache/fop/fo/flow/TableCell.java
  50. 5
    0
      src/java/org/apache/fop/fo/flow/TableColumn.java
  51. 5
    0
      src/java/org/apache/fop/fo/flow/TableFooter.java
  52. 5
    0
      src/java/org/apache/fop/fo/flow/TableHeader.java
  53. 6
    10
      src/java/org/apache/fop/fo/flow/TableRow.java
  54. 5
    0
      src/java/org/apache/fop/fo/flow/Wrapper.java
  55. 6
    0
      src/java/org/apache/fop/fo/pagination/ColorProfile.java
  56. 16
    11
      src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
  57. 6
    0
      src/java/org/apache/fop/fo/pagination/Declarations.java
  58. 3
    9
      src/java/org/apache/fop/fo/pagination/Flow.java
  59. 18
    12
      src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
  60. 15
    10
      src/java/org/apache/fop/fo/pagination/PageMasterReference.java
  61. 5
    0
      src/java/org/apache/fop/fo/pagination/PageSequence.java
  62. 17
    12
      src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
  63. 16
    10
      src/java/org/apache/fop/fo/pagination/Region.java
  64. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionAfter.java
  65. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionBA.java
  66. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionBASE.java
  67. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionBefore.java
  68. 17
    12
      src/java/org/apache/fop/fo/pagination/RegionBody.java
  69. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionEnd.java
  70. 16
    10
      src/java/org/apache/fop/fo/pagination/RegionSE.java
  71. 6
    0
      src/java/org/apache/fop/fo/pagination/RegionStart.java
  72. 15
    10
      src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
  73. 15
    10
      src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
  74. 5
    0
      src/java/org/apache/fop/fo/pagination/Root.java
  75. 18
    13
      src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
  76. 16
    10
      src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
  77. 5
    0
      src/java/org/apache/fop/fo/pagination/StaticContent.java
  78. 6
    0
      src/java/org/apache/fop/fo/pagination/Title.java
  79. 13
    13
      src/java/org/apache/fop/fonts/type1/PFMFile.java
  80. 0
    13
      src/java/org/apache/fop/layout/LayoutStrategy.java
  81. 553
    0
      src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
  82. 100
    0
      src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java
  83. 19
    7
      src/java/org/apache/fop/layoutmgr/ICLayoutManager.java
  84. 12
    11
      src/java/org/apache/fop/layoutmgr/LMiter.java
  85. 0
    9
      src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java
  86. 2
    1
      src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java
  87. 19
    13
      src/java/org/apache/fop/svg/SVGElement.java
  88. 15
    10
      src/java/org/apache/fop/svg/SVGObj.java

+ 1
- 1
src/java/org/apache/fop/apps/Driver.java View File

@@ -321,7 +321,7 @@ public class Driver implements LogEnabled, FOTreeListener {
* @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);

+ 103
- 0
src/java/org/apache/fop/area/LinkResolver.java View File

@@ -0,0 +1,103 @@
/*
* $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());
}
}
}

+ 6
- 0
src/java/org/apache/fop/extensions/Bookmarks.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.extensions;

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;
@@ -114,5 +115,10 @@ public class Bookmarks extends ExtensionObj {
data.setAreaTree(at);
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/extensions/ExtensionObj.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,16 +42,17 @@
* (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.
@@ -67,5 +68,9 @@ public abstract class ExtensionObj extends FObj {
super(parent);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/extensions/Label.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,15 +42,16 @@
* (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.
@@ -89,4 +90,8 @@ public class Label extends ExtensionObj {
return label;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 15
- 10
src/java/org/apache/fop/extensions/Outline.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,15 +42,16 @@
* (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;
@@ -140,5 +141,9 @@ public class Outline extends ExtensionObj {
return label == null ? "" : label.toString();
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 17
- 2
src/java/org/apache/fop/fo/FONode.java View File

@@ -97,7 +97,7 @@ public abstract class FONode {
* Returns the logger for the node.
* @return the logger
*/
protected Logger getLogger() {
public Logger getLogger() {
return userAgent.getLogger();
}

@@ -113,7 +113,7 @@ public abstract class FONode {
* Returns the user agent for the node.
* @return FOUserAgent
*/
protected FOUserAgent getUserAgent() {
public FOUserAgent getUserAgent() {
return userAgent;
}

@@ -211,9 +211,24 @@ public abstract class FONode {
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);
}

}


+ 6
- 19
src/java/org/apache/fop/fo/FOText.java View File

@@ -76,10 +76,10 @@ import org.apache.fop.fo.properties.TextTransform;
*/
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;

/**
@@ -165,22 +165,6 @@ public class FOText extends FObj {
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
*/
@@ -503,4 +487,7 @@ public class FOText extends FObj {
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}
}

+ 8
- 0
src/java/org/apache/fop/fo/FOTreeExternal.java View File

@@ -50,6 +50,8 @@
*/
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
@@ -64,5 +66,11 @@ package org.apache.fop.fo;

public class FOTreeExternal {

public void extFONode(FONode foNode) {
}

public void extFObj(FObj fobj) {
}

}


+ 673
- 0
src/java/org/apache/fop/fo/FOTreeVisitor.java View File

@@ -0,0 +1,673 @@
/*
* $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);
}

}


+ 4
- 9
src/java/org/apache/fop/fo/FObj.java View File

@@ -276,7 +276,7 @@ public class FObj extends FONode {
* 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();
@@ -340,14 +340,6 @@ public class FObj extends FONode {
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.
@@ -436,5 +428,8 @@ public class FObj extends FONode {
return this.propMgr;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}
}


+ 3
- 14
src/java/org/apache/fop/fo/FObjMixed.java View File

@@ -81,20 +81,6 @@ public class FObjMixed extends FObj {
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
@@ -127,5 +113,8 @@ public class FObjMixed extends FObj {
return new RecursiveCharIterator(this);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}
}


+ 4
- 0
src/java/org/apache/fop/fo/ToBeImplementedElement.java View File

@@ -67,4 +67,8 @@ public class ToBeImplementedElement extends FObj {
+ "\" is not yet implemented.");
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/Unknown.java View File

@@ -83,4 +83,9 @@ public class Unknown extends FONode {
private void setup() {
getLogger().debug("Layout Unknown element");
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 4
- 0
src/java/org/apache/fop/fo/UnknownXMLObj.java View File

@@ -118,5 +118,9 @@ public class UnknownXMLObj extends XMLObj {
super.addCharacters(data, start, length);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/fo/XMLElement.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -85,4 +85,9 @@ public class XMLElement extends XMLObj {
public String getNameSpace() {
return namespace;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 4
- 0
src/java/org/apache/fop/fo/XMLObj.java View File

@@ -231,5 +231,9 @@ public abstract class XMLObj extends FONode {
element.appendChild(text);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 10
- 78
src/java/org/apache/fop/fo/flow/BasicLink.java View File

@@ -56,6 +56,7 @@ import java.io.Serializable;

// 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;
@@ -88,44 +89,7 @@ public class BasicLink extends Inline {
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;

@@ -181,48 +145,16 @@ public class BasicLink extends Inline {
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);
}

}


+ 4
- 52
src/java/org/apache/fop/fo/flow/BidiOverride.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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;

@@ -75,28 +76,6 @@ public class BidiOverride extends FObjMixed {
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
@@ -129,35 +108,8 @@ public class BidiOverride extends FObjMixed {
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);
}

}

+ 6
- 13
src/java/org/apache/fop/fo/flow/Block.java View File

@@ -65,6 +65,7 @@ import org.apache.fop.fo.FObj;
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;
@@ -243,18 +244,6 @@ public class Block extends FObjMixed {
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)
*/
@@ -408,5 +397,9 @@ public class Block extends FObjMixed {
bNextIsLF = false;
}
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 11
src/java/org/apache/fop/fo/flow/BlockContainer.java View File

@@ -55,6 +55,7 @@ import org.apache.fop.apps.FOPException;
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;
@@ -99,17 +100,6 @@ public class BlockContainer extends FObj {
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
@@ -175,5 +165,9 @@ public class BlockContainer extends FObj {
return this.span;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 15
src/java/org/apache/fop/fo/flow/Character.java View File

@@ -58,6 +58,7 @@ import org.apache.fop.fo.CharIterator;
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;
@@ -97,21 +98,7 @@ public class Character extends FObj {
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 =
@@ -177,5 +164,8 @@ public class Character extends FObj {
// But what it the character is ignored due to white space handling?
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 10
- 22
src/java/org/apache/fop/fo/flow/ExternalGraphic.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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;
@@ -100,34 +101,13 @@ public class ExternalGraphic extends FObj {
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;
@@ -290,5 +270,13 @@ public class ExternalGraphic extends FObj {
placement = new Rectangle2D.Float(xoffset, yoffset, cwidth, cheight);
}

public int getViewHeight() {
return viewHeight;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 6
- 0
src/java/org/apache/fop/fo/flow/Float.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
import org.apache.fop.fo.FOTreeVisitor;

/**
* fo:float element.
@@ -73,4 +74,9 @@ public class Float extends ToBeImplementedElement {
// this.properties.get("clear");

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 14
- 12
src/java/org/apache/fop/fo/flow/Footnote.java View File

@@ -56,6 +56,7 @@ import java.util.List;
// 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
@@ -73,18 +74,6 @@ public class Footnote extends FObj {
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
*/
@@ -98,5 +87,18 @@ public class Footnote extends FObj {
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);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/FootnoteBody.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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
@@ -74,4 +75,8 @@ public class FootnoteBody extends FObj {
super(parent);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/InitialPropertySet.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;
@@ -102,4 +103,9 @@ public class InitialPropertySet extends ToBeImplementedElement {
// this.properties.get("word-spacing");

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/flow/Inline.java View File

@@ -58,6 +58,7 @@ import org.apache.fop.fo.CharIterator;
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;
@@ -161,4 +162,8 @@ public class Inline extends FObjMixed {
return new InlineCharIterator(this, propMgr.getBorderAndPadding());
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 4
- 28
src/java/org/apache/fop/fo/flow/InlineContainer.java View File

@@ -60,6 +60,7 @@ import org.xml.sax.Attributes;
// 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;
@@ -82,18 +83,6 @@ public class InlineContainer extends FObj {
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
*/
@@ -138,21 +127,8 @@ public class InlineContainer extends FObj {
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);
}

}

+ 8
- 19
src/java/org/apache/fop/fo/flow/InstreamForeignObject.java View File

@@ -60,6 +60,7 @@ import org.apache.fop.area.inline.Viewport;
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;
@@ -75,7 +76,7 @@ import org.w3c.dom.Document;
*/
public class InstreamForeignObject extends FObj {

private Viewport areaCurrent;
public Viewport areaCurrent;

/**
* constructs an instream-foreign-object object (called by Maker).
@@ -86,29 +87,12 @@ public class InstreamForeignObject extends FObj {
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;
}
@@ -372,4 +356,9 @@ public class InstreamForeignObject extends FObj {
this.scaling = this.properties.get("scaling").getEnum();

*/

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 28
- 109
src/java/org/apache/fop/fo/flow/Leader.java View File

@@ -65,6 +65,7 @@ import org.apache.fop.datatypes.PercentLength;
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;
@@ -97,7 +98,7 @@ public class Leader extends FObjMixed {
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
@@ -106,111 +107,6 @@ public class Leader extends FObjMixed {
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
@@ -220,7 +116,7 @@ public class Leader extends FObjMixed {
fontInfo = foih.getFontInfo();
}

private void setup() {
public void setup() {

// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
@@ -297,7 +193,7 @@ public class Leader extends FObjMixed {

}

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);
@@ -317,5 +213,28 @@ public class Leader extends FObjMixed {
}
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);
}

}

+ 5
- 11
src/java/org/apache/fop/fo/flow/ListBlock.java View File

@@ -58,6 +58,7 @@ import org.apache.fop.apps.FOPException;
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;
@@ -91,17 +92,6 @@ public class ListBlock extends FObj {
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
@@ -161,5 +151,9 @@ public class ListBlock extends FObj {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 13
- 16
src/java/org/apache/fop/fo/flow/ListItem.java View File

@@ -56,6 +56,7 @@ import java.util.List;
// 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;
@@ -90,22 +91,6 @@ public class ListItem extends FObj {
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
@@ -173,5 +158,17 @@ public class ListItem extends FObj {
return true;
}

public ListItemLabel getLabel() {
return label;
}

public ListItemBody getBody() {
return body;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/ListItemBody.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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;

@@ -103,5 +104,9 @@ public class ListItemBody extends FObj {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/ListItemLabel.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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;

@@ -103,5 +104,9 @@ public class ListItemLabel extends FObj {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 14
- 10
src/java/org/apache/fop/fo/flow/Marker.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -57,6 +57,7 @@ import org.xml.sax.Attributes;
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.
@@ -107,5 +108,8 @@ public class Marker extends FObjMixed {
return markerClassName;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/MultiCase.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;

@@ -79,4 +80,9 @@ public class MultiCase extends ToBeImplementedElement {
// this.properties.get("case-title");

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/MultiProperties.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;

@@ -76,4 +77,9 @@ public class MultiProperties extends ToBeImplementedElement {
setupID();

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/MultiPropertySet.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.ToBeImplementedElement;

/**
@@ -73,4 +74,9 @@ public class MultiPropertySet extends ToBeImplementedElement {
// this.properties.get("active-state");

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/MultiSwitch.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;

@@ -77,4 +78,9 @@ public class MultiSwitch extends ToBeImplementedElement {
setupID();

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/flow/MultiToggle.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;

@@ -77,4 +78,9 @@ public class MultiToggle extends ToBeImplementedElement {
// this.properties.get("switch-to");

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 10
- 41
src/java/org/apache/fop/fo/flow/PageNumber.java View File

@@ -54,6 +54,7 @@ package org.apache.fop.fo.flow;
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;
@@ -107,47 +108,7 @@ public class PageNumber extends FObj {
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();
@@ -195,4 +156,12 @@ public class PageNumber extends FObj {

}

public Font getFontState() {
return fontState;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 19
- 33
src/java/org/apache/fop/fo/flow/PageNumberCitation.java View File

@@ -61,6 +61,7 @@ import org.apache.fop.area.inline.InlineArea;
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;
@@ -118,39 +119,9 @@ public class PageNumberCitation extends FObj {
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;
@@ -202,7 +173,7 @@ public class PageNumberCitation extends FObj {
return width;
}

private void setup() {
public void setup() {

// Common Accessibility Properties
CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
@@ -255,5 +226,20 @@ public class PageNumberCitation extends FObj {

}

}
public String getRefId() {
return refId;
}

public InlineArea getInline() {
return inline;
}

public boolean getUnresolved() {
return unresolved;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 26
- 21
src/java/org/apache/fop/fo/flow/RetrieveMarker.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,18 +42,19 @@
* (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;

@@ -94,16 +95,20 @@ public class RetrieveMarker extends FObjMixed {
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);
}

}

+ 17
- 19
src/java/org/apache/fop/fo/flow/Table.java View File

@@ -59,6 +59,7 @@ import org.apache.fop.datatypes.ColorType;
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;
@@ -127,25 +128,6 @@ public class Table extends FObj {
}
}

/**
* 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();
@@ -222,5 +204,21 @@ public class Table extends FObj {
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);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/TableAndCaption.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;
@@ -113,5 +114,9 @@ public class TableAndCaption extends ToBeImplementedElement {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 16
src/java/org/apache/fop/fo/flow/TableBody.java View File

@@ -58,6 +58,7 @@ import org.apache.fop.apps.FOPException;
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;
@@ -83,22 +84,6 @@ public class TableBody extends FObj {
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();
@@ -132,5 +117,9 @@ public class TableBody extends FObj {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/TableCaption.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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;
@@ -106,5 +107,9 @@ public class TableCaption extends ToBeImplementedElement {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 11
src/java/org/apache/fop/fo/flow/TableCell.java View File

@@ -61,6 +61,7 @@ import org.apache.fop.apps.FOPException;
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;

@@ -164,16 +165,6 @@ public class TableCell extends FObj {
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?)
*/
@@ -389,5 +380,8 @@ public class TableCell extends FObj {
return true;
}

}
public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/flow/TableColumn.java View File

@@ -55,6 +55,7 @@ import org.apache.fop.datatypes.ColorType;
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;
@@ -167,5 +168,9 @@ public class TableColumn extends FObj {
setup = true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/TableFooter.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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
@@ -66,4 +67,8 @@ public class TableFooter extends TableBody {
super(parent);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/flow/TableHeader.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.flow;

// 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
@@ -66,4 +67,8 @@ public class TableHeader extends TableBody {
super(parent);
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 10
src/java/org/apache/fop/fo/flow/TableRow.java View File

@@ -59,6 +59,7 @@ import org.apache.fop.datatypes.KeepValue;
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;
@@ -92,16 +93,6 @@ public class TableRow extends FObj {
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
*/
@@ -164,5 +155,10 @@ public class TableRow extends FObj {
return new KeepValue(KeepValue.KEEP_WITH_AUTO, 0);
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/flow/Wrapper.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.flow;
// 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.
@@ -78,5 +79,9 @@ public class Wrapper extends FObjMixed {
return true;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 6
- 0
src/java/org/apache/fop/fo/pagination/ColorProfile.java View File

@@ -61,6 +61,7 @@ import java.io.InputStream;
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.
@@ -129,4 +130,9 @@ public class ColorProfile extends FObj {
getLogger().error("Color Profile src not an ICC Profile", iae);
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 16
- 11
src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -56,6 +56,7 @@ import org.xml.sax.Attributes;
// 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;
@@ -127,7 +128,7 @@ public class ConditionalPageMasterReference extends FObj {
* @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
@@ -197,4 +198,8 @@ public class ConditionalPageMasterReference extends FObj {
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/pagination/Declarations.java View File

@@ -58,6 +58,7 @@ import java.util.Iterator;
// 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;


@@ -113,4 +114,9 @@ public class Declarations extends FObj {
}
children = null;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 3
- 9
src/java/org/apache/fop/fo/pagination/Flow.java View File

@@ -60,6 +60,7 @@ import org.xml.sax.Attributes;
// 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;

@@ -178,14 +179,7 @@ public class Flow extends FObj {
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);
}

}

+ 18
- 12
src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -60,6 +60,7 @@ import org.xml.sax.Attributes;
// 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;

/**
@@ -72,7 +73,7 @@ import org.apache.fop.apps.FOPException;
* information for a page sequence.
*/
public class LayoutMasterSet extends FObj {
private Map simplePageMasters;
private Map pageSequenceMasters;

@@ -138,7 +139,7 @@ public class LayoutMasterSet extends FObj {
* @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
@@ -218,5 +219,10 @@ public class LayoutMasterSet extends FObj {
}
return false;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/fo/pagination/PageMasterReference.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -57,6 +57,7 @@ import org.xml.sax.Attributes;
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
@@ -117,4 +118,8 @@ public abstract class PageMasterReference extends FObj
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/pagination/PageSequence.java View File

@@ -53,6 +53,7 @@ package org.apache.fop.fo.pagination;
// 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;
@@ -821,5 +822,9 @@ public class PageSequence extends FObj {
return titleFO;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 17
- 12
src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -59,6 +59,7 @@ import org.xml.sax.Attributes;
// 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;

/**
@@ -67,7 +68,7 @@ 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;
@@ -80,7 +81,7 @@ public class PageSequenceMaster extends FObj {
// 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)
*/
@@ -196,5 +197,9 @@ public class PageSequenceMaster extends FObj {
return pageMaster;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 16
- 10
src/java/org/apache/fop/fo/pagination/Region.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -58,6 +58,7 @@ import java.awt.geom.Rectangle2D;
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;
@@ -286,4 +287,9 @@ public abstract class Region extends FObj {
public int getExtent() {
return 0;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionAfter.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -55,6 +55,7 @@ import java.awt.Rectangle;

// 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;
@@ -108,5 +109,10 @@ public class RegionAfter extends RegionBA {
public String getRegionClass() {
return Region.AFTER;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionBA.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -57,6 +57,7 @@ import java.awt.Rectangle;
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.
@@ -116,5 +117,10 @@ public abstract class RegionBA extends RegionBASE {
}
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionBASE.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,16 +42,17 @@
* (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).
@@ -82,5 +83,10 @@ public abstract class RegionBASE extends Region {
public int getExtent() {
return this.extent;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionBefore.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,18 +42,19 @@
* (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
@@ -113,5 +114,10 @@ public class RegionBefore extends RegionBA {
}
return vpRect;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 17
- 12
src/java/org/apache/fop/fo/pagination/RegionBody.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -57,6 +57,7 @@ import java.awt.geom.Rectangle2D;
// 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;
@@ -103,7 +104,7 @@ public class RegionBody extends Region {
} 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;
@@ -115,7 +116,7 @@ public class RegionBody extends Region {
*/
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) {
@@ -170,4 +171,8 @@ public class RegionBody extends Region {
return body;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionEnd.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -55,6 +55,7 @@ import java.awt.Rectangle;

// 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;
@@ -109,5 +110,10 @@ public class RegionEnd extends RegionSE {
public int getRegionAreaClass() {
return RegionReference.END;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 16
- 10
src/java/org/apache/fop/fo/pagination/RegionSE.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -55,6 +55,7 @@ import java.awt.Rectangle;

// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.properties.WritingMode;

/**
@@ -98,5 +99,10 @@ public abstract class RegionSE extends RegionBASE {
}
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 6
- 0
src/java/org/apache/fop/fo/pagination/RegionStart.java View File

@@ -55,6 +55,7 @@ import java.awt.Rectangle;

// 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;
@@ -108,5 +109,10 @@ public class RegionStart extends RegionSE {
public int getRegionAreaClass() {
return RegionReference.START;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -59,6 +59,7 @@ import org.xml.sax.Attributes;
// 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;

/**
@@ -165,4 +166,8 @@ public class RepeatablePageMasterAlternatives extends FObj
this.numberConsumed = 0;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 15
- 10
src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -55,6 +55,7 @@ import org.xml.sax.Attributes;

// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;

/**
@@ -126,4 +127,8 @@ public class RepeatablePageMasterReference extends PageMasterReference
this.numberConsumed = 0;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 5
- 0
src/java/org/apache/fop/fo/pagination/Root.java View File

@@ -57,6 +57,7 @@ import java.util.List;
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.
@@ -161,4 +162,8 @@ public class Root extends FObj {
return document;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 18
- 13
src/java/org/apache/fop/fo/pagination/SimplePageMaster.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -64,6 +64,7 @@ import org.apache.fop.area.CTM;
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;
@@ -216,7 +217,7 @@ public class SimplePageMaster extends FObj {
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());
}
}
@@ -254,7 +255,7 @@ public class SimplePageMaster extends FObj {
}

/**
* 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
@@ -269,5 +270,9 @@ public class SimplePageMaster extends FObj {
}
return false;
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 16
- 10
src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,15 +42,16 @@
* (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.
@@ -93,5 +94,10 @@ public class SinglePageMasterReference extends PageMasterReference
public void reset() {
this.state = FIRST;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 5
- 0
src/java/org/apache/fop/fo/pagination/StaticContent.java View File

@@ -52,6 +52,7 @@ package org.apache.fop.fo.pagination;

// 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;

@@ -100,4 +101,8 @@ public class StaticContent extends Flow {
return lm;
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}

+ 6
- 0
src/java/org/apache/fop/fo/pagination/Title.java View File

@@ -58,6 +58,7 @@ import org.apache.fop.fo.FObjMixed;
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;
@@ -140,5 +141,10 @@ public class Title extends FObjMixed {
Length zIndex = this.properties.get("z-index").getLength();

}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 13
- 13
src/java/org/apache/fop/fonts/type1/PFMFile.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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
@@ -93,7 +93,7 @@ public class PFMFile extends AbstractLogEnabled {
private int[] extentTable;

private Map kerningTab = new java.util.HashMap();
/**
* Parses a PFM file
*
@@ -233,7 +233,7 @@ public class PFMFile extends AbstractLogEnabled {
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();
@@ -271,7 +271,7 @@ public class PFMFile extends AbstractLogEnabled {
* 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() {

+ 0
- 13
src/java/org/apache/fop/layout/LayoutStrategy.java View File

@@ -51,8 +51,6 @@

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
@@ -61,7 +59,6 @@ import org.apache.fop.fo.FOTreeExternal;
public abstract class LayoutStrategy {

private String name = "undefined";
private FOTreeExternal fote = null;

/**
* Returns the name of this LayoutStrategy.
@@ -71,14 +68,4 @@ public abstract class LayoutStrategy {
return name;
}

/**
*
* @return the FOTreeExternal object for this LayoutStrategy
*/
public FOTreeExternal getFOTreeExternal() {
if (fote == null) {
fote = new FOTreeExternal();
}
return fote;
}
}

+ 553
- 0
src/java/org/apache/fop/layoutmgr/AddLMVisitor.java View File

@@ -0,0 +1,553 @@
/*
* $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);
}

}

+ 100
- 0
src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java View File

@@ -0,0 +1,100 @@
/*
* $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);
}

}

src/java/org/apache/fop/layoutmgr/LMFOTreeExternal.java → src/java/org/apache/fop/layoutmgr/ICLayoutManager.java View File

@@ -48,17 +48,29 @@
* 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;
// Java
import java.util.List;

// FOP
import org.apache.fop.area.inline.InlineArea;

/**
* Implementation of FOTreeExternal for LayoutStrategy-specific calls while the
* FO Tree is being built.
* @see org.apache.fop.fo.FOTreeExternal
* 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 {

public class LMFOTreeExternal extends FOTreeExternal {
private List childrenLM;

}
ICLayoutManager(List childLM) {
childrenLM = childLM;
}

public InlineArea get(int index) {
return null;
}

}

+ 12
- 11
src/java/org/apache/fop/layoutmgr/LMiter.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,12 +42,12 @@
* (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;
@@ -64,6 +64,7 @@ public class LMiter implements ListIterator {
private FObj curFO;
protected List listLMs;
protected int curPos = 0;
private AddLMVisitor addLMVisitor = new AddLMVisitor();

public LMiter(ListIterator bIter) {
baseIter = bIter;
@@ -81,7 +82,7 @@ public class LMiter implements ListIterator {
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;
}

+ 0
- 9
src/java/org/apache/fop/layoutmgr/LayoutManagerLS.java View File

@@ -50,7 +50,6 @@
*/
package org.apache.fop.layoutmgr;

import org.apache.fop.fo.FOTreeExternal;
import org.apache.fop.layout.LayoutStrategy;

/**
@@ -60,13 +59,5 @@ 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;
}

}

+ 2
- 1
src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java View File

@@ -65,6 +65,7 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager {
private String name;
private int position;
private int boundary;
private AddLMVisitor addLMVisitor = new AddLMVisitor();

/**
* Create a new block container layout manager.
@@ -123,7 +124,7 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager {
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);

+ 19
- 13
src/java/org/apache/fop/svg/SVGElement.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,16 +42,17 @@
* (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;
@@ -140,15 +141,15 @@ public class SVGElement extends SVGObj {
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();
}
@@ -310,5 +311,10 @@ public class SVGElement extends SVGObj {
return 100;
}
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


+ 15
- 10
src/java/org/apache/fop/svg/SVGObj.java View File

@@ -3,34 +3,34 @@
* ============================================================================
* 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
@@ -42,16 +42,17 @@
* (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.
@@ -75,5 +76,9 @@ public class SVGObj extends XMLObj {
return "http://www.w3.org/2000/svg";
}

public void acceptVisitor(FOTreeVisitor fotv) {
fotv.serveVisitor(this);
}

}


Loading…
Cancel
Save