vmote 2003/08/27 11:14:46
Modified: src/java/org/apache/fop/area BodyRegion.java Page.java
RegionReference.java
src/java/org/apache/fop/layoutmgr PageLayoutManager.java
src/java/org/apache/fop/render AbstractRenderer.java
src/java/org/apache/fop/render/xml XMLRenderer.java
src/java/org/apache/fop/tools AreaTreeBuilder.java
Log:
remove region code from /area/RegionReference in favor of those in
fo/pagination/Region
Revision Changes Path
1.2 +14 -12 xml-fop/src/java/org/apache/fop/area/BodyRegion.java
Index: BodyRegion.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/BodyRegion.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BodyRegion.java 11 Mar 2003 13:05:27 -0000 1.1
+++ BodyRegion.java 27 Aug 2003 18:14:45 -0000 1.2
@@ -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
* [EMAIL PROTECTED]
- *
+ *
* 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,14 +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 <[EMAIL PROTECTED]>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.area;
+import org.apache.fop.fo.pagination.Region;
+
/**
* The body region area.
* This area contains a main reference area and optionally a
@@ -70,7 +72,7 @@
* This sets the region reference area class to BODY.
*/
public BodyRegion() {
- super(BODY);
+ super(Region.BODY_CODE);
}
/**
@@ -161,7 +163,7 @@
* are assumed to be null and are not cloned.
*
* @return a shallow copy of this object
- */
+ */
public Object clone() {
BodyRegion br = new BodyRegion();
br.setCTM(getCTM());
1.2 +22 -20 xml-fop/src/java/org/apache/fop/area/Page.java
Index: Page.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Page.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Page.java 11 Mar 2003 13:05:27 -0000 1.1
+++ Page.java 27 Aug 2003 18:14:45 -0000 1.2
@@ -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
* [EMAIL PROTECTED]
- *
+ *
* 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,17 +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 <[EMAIL PROTECTED]>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.area;
import java.io.Serializable;
import java.util.Map;
+import org.apache.fop.fo.pagination.Region;
+
/**
* The page.
* This holds the contents of the page. Each region is added.
@@ -82,15 +84,15 @@
* @param port the region viewport to set
*/
public void setRegion(int areaclass, RegionViewport port) {
- if (areaclass == RegionReference.BEFORE) {
+ if (areaclass == Region.BEFORE_CODE) {
regionBefore = port;
- } else if (areaclass == RegionReference.START) {
+ } else if (areaclass == Region.START_CODE) {
regionStart = port;
- } else if (areaclass == RegionReference.BODY) {
+ } else if (areaclass == Region.BODY_CODE) {
regionBody = port;
- } else if (areaclass == RegionReference.END) {
+ } else if (areaclass == Region.END_CODE) {
regionEnd = port;
- } else if (areaclass == RegionReference.AFTER) {
+ } else if (areaclass == Region.AFTER_CODE) {
regionAfter = port;
}
}
@@ -102,15 +104,15 @@
* @return the region viewport or null if none
*/
public RegionViewport getRegion(int areaclass) {
- if (areaclass == RegionReference.BEFORE) {
+ if (areaclass == Region.BEFORE_CODE) {
return regionBefore;
- } else if (areaclass == RegionReference.START) {
+ } else if (areaclass == Region.START_CODE) {
return regionStart;
- } else if (areaclass == RegionReference.BODY) {
+ } else if (areaclass == Region.BODY_CODE) {
return regionBody;
- } else if (areaclass == RegionReference.END) {
+ } else if (areaclass == Region.END_CODE) {
return regionEnd;
- } else if (areaclass == RegionReference.AFTER) {
+ } else if (areaclass == Region.AFTER_CODE) {
return regionAfter;
}
return null;
1.2 +13 -36 xml-fop/src/java/org/apache/fop/area/RegionReference.java
Index: RegionReference.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/RegionReference.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegionReference.java 11 Mar 2003 13:05:27 -0000 1.1
+++ RegionReference.java 27 Aug 2003 18:14:45 -0000 1.2
@@ -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
* [EMAIL PROTECTED]
- *
+ *
* 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,49 +42,26 @@
* (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 <[EMAIL PROTECTED]>. For more information on the Apache
* Software Foundation, please see <http://www.apache.org/>.
- */
+ */
package org.apache.fop.area;
import java.util.ArrayList;
import java.util.List;
+import org.apache.fop.fo.pagination.Region;
+
/**
* This is a region reference area for the page regions.
* This area represents a region on the page. It is cloneable
* so the page master can make copies from the original page and regions.
*/
public class RegionReference extends Area implements Cloneable {
- /**
- * The before region.
- */
- public static final int BEFORE = 0;
-
- /**
- * The start region.
- */
- public static final int START = 1;
-
- /**
- * The body region.
- */
- public static final int BODY = 2;
-
- /**
- * The end region.
- */
- public static final int END = 3;
-
- /**
- * The after region.
- */
- public static final int AFTER = 4;
-
- private int regionClass = BEFORE;
+ private int regionClass = Region.BEFORE_CODE;
private CTM ctm;
// the list of block areas from the static flow
private List blocks = new ArrayList();
1.14 +7 -7 xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
Index: PageLayoutManager.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- PageLayoutManager.java 27 Aug 2003 17:51:16 -0000 1.13
+++ PageLayoutManager.java 27 Aug 2003 18:14:46 -0000 1.14
@@ -460,7 +460,7 @@
curPage.setPageNumber(getCurrentPageNumber());
RegionViewport reg = curPage.getPage().getRegion(
- RegionReference.BODY);
+ Region.BODY_CODE);
curBody = (BodyRegion) reg.getRegion();
flowBPD = (int)reg.getViewArea().getHeight();
return curPage;
@@ -508,13 +508,13 @@
// Layout static content into the regions
// Need help from pageseq for this
layoutStaticContent(currentSimplePageMaster.getRegion(Region.BEFORE),
- RegionReference.BEFORE);
+ Region.BEFORE_CODE);
layoutStaticContent(currentSimplePageMaster.getRegion(Region.AFTER),
- RegionReference.AFTER);
+ Region.AFTER_CODE);
layoutStaticContent(currentSimplePageMaster.getRegion(Region.START),
- RegionReference.START);
+ Region.START_CODE);
layoutStaticContent(currentSimplePageMaster.getRegion(Region.END),
- RegionReference.END);
+ Region.END_CODE);
// Queue for ID resolution and rendering
areaTree.addPage(curPage);
curPage = null;
@@ -699,7 +699,7 @@
curSpan = new Span(numCols);
// get Width or Height as IPD for span
curSpan.setIPD((int) curPage.getPage().getRegion(
- RegionReference.BODY).getViewArea().getWidth());
+ Region.BODY_CODE).getViewArea().getWidth());
//curSpan.setPosition(BPD, newpos);
curBody.getMainReference().addSpan(curSpan);
@@ -792,7 +792,7 @@
rvp.setRegion(makeRegionReferenceArea(r, rvp.getViewArea()));
}
page.setRegion(r.getRegionClassCode(), rvp);
- if (r.getRegionClassCode() == RegionReference.BODY) {
+ if (r.getRegionClassCode() == Region.BODY_CODE) {
bHasBody = true;
}
}
1.8 +7 -6 xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java
Index: AbstractRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/AbstractRenderer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AbstractRenderer.java 22 Aug 2003 17:42:42 -0000 1.7
+++ AbstractRenderer.java 27 Aug 2003 18:14:46 -0000 1.8
@@ -89,6 +89,7 @@
import org.apache.fop.area.inline.Character;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FOTreeControl;
+import org.apache.fop.fo.pagination.Region;
// Avalon
import org.apache.avalon.framework.logger.AbstractLogEnabled;
@@ -272,15 +273,15 @@
*/
protected void renderPageAreas(Page page) {
RegionViewport viewport;
- viewport = page.getRegion(RegionReference.BEFORE);
+ viewport = page.getRegion(Region.BEFORE_CODE);
renderRegionViewport(viewport);
- viewport = page.getRegion(RegionReference.START);
+ viewport = page.getRegion(Region.START_CODE);
renderRegionViewport(viewport);
- viewport = page.getRegion(RegionReference.BODY);
+ viewport = page.getRegion(Region.BODY_CODE);
renderRegionViewport(viewport);
- viewport = page.getRegion(RegionReference.END);
+ viewport = page.getRegion(Region.END_CODE);
renderRegionViewport(viewport);
- viewport = page.getRegion(RegionReference.AFTER);
+ viewport = page.getRegion(Region.AFTER_CODE);
renderRegionViewport(viewport);
}
@@ -308,7 +309,7 @@
// do after starting viewport area
handleViewportTraits(port);
- if (region.getRegionClass() == RegionReference.BODY) {
+ if (region.getRegionClass() == Region.BODY_CODE) {
renderBodyRegion((BodyRegion) region);
} else {
renderRegion(region);
1.7 +6 -5 xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java
Index: XMLRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLRenderer.java 22 Aug 2003 17:42:42 -0000 1.6
+++ XMLRenderer.java 27 Aug 2003 18:14:46 -0000 1.7
@@ -94,6 +94,7 @@
import org.apache.fop.area.inline.Word;
import org.apache.fop.fo.properties.RuleStyle;
import org.apache.fop.fo.FOTreeControl;
+import org.apache.fop.fo.pagination.Region;
/**
* Renderer that renders areas to XML for debugging purposes.
@@ -288,23 +289,23 @@
writeStartTag("<regionViewport rect=\""
+ createString(port.getViewArea()) + "\">");
RegionReference region = port.getRegion();
- if (region.getRegionClass() == RegionReference.BEFORE) {
+ if (region.getRegionClass() == Region.BEFORE_CODE) {
writeStartTag("<regionBefore>");
renderRegion(region);
writeEndTag("</regionBefore>");
- } else if (region.getRegionClass() == RegionReference.START) {
+ } else if (region.getRegionClass() == Region.START_CODE) {
writeStartTag("<regionStart>");
renderRegion(region);
writeEndTag("</regionStart>");
- } else if (region.getRegionClass() == RegionReference.BODY) {
+ } else if (region.getRegionClass() == Region.BODY_CODE) {
writeStartTag("<regionBody>");
renderBodyRegion((BodyRegion) region);
writeEndTag("</regionBody>");
- } else if (region.getRegionClass() == RegionReference.END) {
+ } else if (region.getRegionClass() == Region.END_CODE) {
writeStartTag("<regionEnd>");
renderRegion(region);
writeEndTag("</regionEnd>");
- } else if (region.getRegionClass() == RegionReference.AFTER) {
+ } else if (region.getRegionClass() == Region.AFTER_CODE) {
writeStartTag("<regionAfter>");
renderRegion(region);
writeEndTag("</regionAfter>");
1.8 +12 -11 xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java
Index: AreaTreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/tools/AreaTreeBuilder.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AreaTreeBuilder.java 22 Aug 2003 17:42:42 -0000 1.7
+++ AreaTreeBuilder.java 27 Aug 2003 18:14:46 -0000 1.8
@@ -107,6 +107,7 @@
import org.apache.fop.render.svg.SVGRenderer;
import org.apache.fop.render.xml.XMLRenderer;
import org.apache.fop.apps.FOUserAgent;
+import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.properties.RuleStyle;
import org.apache.fop.fonts.FontMetrics;
@@ -381,20 +382,20 @@
for (int i = 0; i < childs.getLength(); i++) {
Node obj = childs.item(i);
if (obj.getNodeName().equals("regionBefore")) {
- reg.setRegion(readRegion((Element) obj, RegionReference.BEFORE));
- page.setRegion(RegionReference.BEFORE, reg);
+ reg.setRegion(readRegion((Element) obj, Region.BEFORE_CODE));
+ page.setRegion(Region.BEFORE_CODE, reg);
} else if (obj.getNodeName().equals("regionStart")) {
- reg.setRegion(readRegion((Element) obj, RegionReference.START));
- page.setRegion(RegionReference.START, reg);
+ reg.setRegion(readRegion((Element) obj, Region.START_CODE));
+ page.setRegion(Region.START_CODE, reg);
} else if (obj.getNodeName().equals("regionBody")) {
- reg.setRegion(readRegion((Element) obj, RegionReference.BODY));
- page.setRegion(RegionReference.BODY, reg);
+ reg.setRegion(readRegion((Element) obj, Region.BODY_CODE));
+ page.setRegion(Region.BODY_CODE, reg);
} else if (obj.getNodeName().equals("regionEnd")) {
- reg.setRegion(readRegion((Element) obj, RegionReference.END));
- page.setRegion(RegionReference.END, reg);
+ reg.setRegion(readRegion((Element) obj, Region.END_CODE));
+ page.setRegion(Region.END_CODE, reg);
} else if (obj.getNodeName().equals("regionAfter")) {
- reg.setRegion(readRegion((Element) obj, RegionReference.AFTER));
- page.setRegion(RegionReference.AFTER, reg);
+ reg.setRegion(readRegion((Element) obj, Region.AFTER_CODE));
+ page.setRegion(Region.AFTER_CODE, reg);
}
}
@@ -403,7 +404,7 @@
public RegionReference readRegion(Element root, int type) {
RegionReference reg;
- if (type == RegionReference.BODY) {
+ if (type == Region.BODY_CODE) {
BodyRegion br = new BodyRegion();
NodeList childs = root.getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]