/** Holds the writing mode */
protected int wm;
+ protected int extent = 0;
+
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
}
public int getExtent() {
- return 0;
- }
-
- /**
- * This is a hook for the AddLMVisitor class to be able to access
- * this object.
- * @param aLMV the AddLMVisitor object that can access this object.
- */
- public void acceptVisitor(AddLMVisitor aLMV) {
- aLMV.serveRegion(this);
+ return extent;
}
-
}
import java.awt.Rectangle;
// XML
+import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
/**
* Abstract base class for fo:region-before and fo:region-after.
*/
-public abstract class RegionBA extends RegionBASE {
+public abstract class RegionBA extends Region {
private boolean bPrecedence;
super(parent, regionId);
}
+ protected void addProperties(Attributes attlist) throws SAXParseException {
+ super.addProperties(attlist);
+
+ bPrecedence =
+ (this.propertyList.get(PR_PRECEDENCE).getEnum() == Precedence.TRUE);
+
+ this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue();
+ }
+
/**
* @see org.apache.fop.fo.pagination.Region#getPrecedence()
*/
return bPrecedence;
}
- /**
- * @see org.apache.fop.fo.FONode#endOfNode()
- */
- protected void endOfNode() throws SAXParseException {
- super.endOfNode();
- bPrecedence =
- (this.propertyList.get(PR_PRECEDENCE).getEnum() == Precedence.TRUE);
- }
-
/**
* Adjust the viewport reference rectangle for a region as a function
* of precedence.
}
}
}
-
- public void acceptVisitor(AddLMVisitor aLMV) {
- aLMV.serveRegionBA(this);
- }
-
}
+++ /dev/null
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.fo.pagination;
-
-// XML
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-// FOP
-import org.apache.fop.fo.FONode;
-import org.apache.fop.layoutmgr.AddLMVisitor;
-
-
-/**
- * Base class for Before, After, Start and End regions (BASE).
- */
-public abstract class RegionBASE extends Region {
-
- private int extent;
-
- /**
- * @see org.apache.fop.fo.FONode#FONode(FONode)
- */
- protected RegionBASE(FONode parent, int regionId) {
- super(parent, regionId);
- }
-
- /**
- * @see org.apache.fop.fo.FONode#endOfNode()
- */
- protected void endOfNode() throws SAXParseException {
- // The problem with this is that it might not be known yet....
- // Supposing extent is calculated in terms of percentage
- this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue();
- }
-
- /**
- * @see org.apache.fop.fo.pagination.Region#getExtent()
- */
- public int getExtent() {
- return this.extent;
- }
-
- public void acceptVisitor(AddLMVisitor aLMV) {
- aLMV.serveRegionBASE(this);
- }
-
-}
-
package org.apache.fop.fo.pagination;
+// Java
+import java.awt.Rectangle;
+
// FOP
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.FONode;
import org.apache.fop.layoutmgr.AddLMVisitor;
-// Java
-import java.awt.Rectangle;
-
/**
* The fo:region-before element.
*/
// Java
import java.awt.Rectangle;
+// XML
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXParseException;
+
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.layoutmgr.AddLMVisitor;
/**
* Abstract base class for fo:region-start and fo:region-end.
*/
-public abstract class RegionSE extends RegionBASE {
+public abstract class RegionSE extends Region {
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
super(parent, regionId);
}
+ protected void addProperties(Attributes attlist) throws SAXParseException {
+ super.addProperties(attlist);
+
+ this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue();
+ }
+
/**
* Adjust the viewport reference rectangle for a region as a function
* of precedence.
}
}
}
-
- public void acceptVisitor(AddLMVisitor aLMV) {
- aLMV.serveRegionSE(this);
- }
-
}
import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.pagination.RegionAfter;
import org.apache.fop.fo.pagination.RegionBA;
-import org.apache.fop.fo.pagination.RegionBASE;
import org.apache.fop.fo.pagination.RegionBefore;
import org.apache.fop.fo.pagination.RegionBody;
import org.apache.fop.fo.pagination.RegionEnd;
serveFObj((FObj)node);
}
- /**
- * @param node RegionBASE object to process
- */
- public void serveRegionBASE(RegionBASE node) {
- serveRegion((Region)node);
- }
-
/**
* @param node RegionBA object to process
*/
public void serveRegionBA(RegionBA node) {
- serveRegionBASE((RegionBASE)node);
+ serveRegion((Region)node);
}
/**
* @param node RegionSE object to process
*/
public void serveRegionSE(RegionSE node) {
- serveRegionBASE((RegionBASE)node);
+ serveRegion((Region)node);
}
/**