You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ar...@apache.org on 2001/07/16 12:36:48 UTC
cvs commit: xml-fop/src/org/apache/fop/fo FONode.java FObj.java
arved 01/07/16 03:36:48
Modified: src/org/apache/fop/fo FONode.java FObj.java
Log:
AHS: initial marker support
Revision Changes Path
1.16 +36 -2 xml-fop/src/org/apache/fop/fo/FONode.java
Index: FONode.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- FONode.java 2001/05/19 00:59:06 1.15
+++ FONode.java 2001/07/16 10:36:48 1.16
@@ -1,4 +1,4 @@
-/*-- $Id: FONode.java,v 1.15 2001/05/19 00:59:06 arved Exp $ --
+/*-- $Id: FONode.java,v 1.16 2001/07/16 10:36:48 arved Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources."
@@ -10,11 +10,14 @@
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.layout.Area;
+import org.apache.fop.layout.AreaClass;
import org.apache.fop.layout.LinkSet;
import org.apache.fop.system.BufferManager;
+import org.apache.fop.fo.flow.Marker;
// Java
import java.util.Vector;
+import java.util.Hashtable;
/**
* base class for nodes in the formatting object tree
@@ -23,6 +26,8 @@
protected FObj parent;
+ protected String areaClass = AreaClass.UNASSIGNED;
+
public BufferManager bufferManager;
public Vector children = new Vector(); // made public for searching for id's
@@ -50,11 +55,22 @@
protected LinkSet linkSet;
+ // count of areas generated-by/returned-by
+ public int areasGenerated = 0;
+
+ // markers
+ protected Hashtable markers;
+
protected FONode(FObj parent) {
- this.parent = parent;
+ this.parent = parent;
if (parent != null) {
this.bufferManager = parent.bufferManager;
}
+
+ markers = new Hashtable();
+
+ if (null != parent)
+ this.areaClass = parent.areaClass;
}
public void setIsInTableCell() {
@@ -202,4 +218,22 @@
}
((FONode) children.elementAt(this.marker)).rollback(snapshot);
}
+
+
+ public void addMarker(Marker marker) throws FOPException {
+ String mcname = marker.getMarkerClassName();
+ if (!markers.containsKey(mcname) && children.isEmpty())
+ markers.put(mcname, marker);
+ else
+ throw new FOPException("fo:marker must be an initial child," +
+ "and 'marker-class-name' must be unique for same parent");
+ }
+
+ public boolean hasMarkers() {
+ return !markers.isEmpty();
+ }
+
+ public Vector getMarkers() {
+ return new Vector(markers.values());
+ }
}
1.18 +1 -3 xml-fop/src/org/apache/fop/fo/FObj.java
Index: FObj.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- FObj.java 2001/06/07 06:47:59 1.17
+++ FObj.java 2001/07/16 10:36:48 1.18
@@ -1,4 +1,4 @@
-/* $Id: FObj.java,v 1.17 2001/06/07 06:47:59 keiron Exp $
+/* $Id: FObj.java,v 1.18 2001/07/16 10:36:48 arved Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -158,7 +158,5 @@
p=parent);
this.properties.setWritingMode(p.getProperty("writing-mode").getEnum());
}
-
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org