]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Renamed from Span
authorPeter Bernard West <pbwest@apache.org>
Sun, 2 May 2004 17:28:13 +0000 (17:28 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 2 May 2004 17:28:13 +0000 (17:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197559 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/SpanReferenceArea.java [new file with mode: 0644]

diff --git a/src/java/org/apache/fop/area/SpanReferenceArea.java b/src/java/org/apache/fop/area/SpanReferenceArea.java
new file mode 100644 (file)
index 0000000..137083b
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+   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.area;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datastructs.Node;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.flow.FoPageSequence;
+
+/**
+ * The span reference areas are children of the main-reference-area
+ * of a region-body.
+ * This is a reference area block area with 0 border and padding
+ */
+public class SpanReferenceArea
+extends AbstractReferenceArea
+implements ReferenceArea, Serializable {
+    // the list of normal-flow-reference-areas in this span area
+    private List flowAreas;
+    
+    private NormalFlowRefArea currentFlowArea = null;
+    
+    /**
+     * Number of columns in this span.  Derived from the <code>span</code>
+     * property on the fo:flow and the column-count prooperty on the
+     * region-body-reference-area.  Defaults to 1.
+     */
+    private int columnCount = 1;
+
+    /**
+     * Create a span area with the number of columns for .
+     * SpanReferenceArea-reference-areas are children of main-reference-areas.
+     */
+    public SpanReferenceArea(
+            FoPageSequence pageSeq,
+            FONode generatedBy,
+            Node parent,
+            Object sync) {
+        super(pageSeq, generatedBy, parent, sync);
+    }
+
+    /**
+     * Create a span area with the number of columns for .
+     * SpanReferenceArea-reference-areas are children of main-reference-areas.
+     */
+    public SpanReferenceArea(
+            int columnCount,
+            FoPageSequence pageSeq,
+            FONode generatedBy,
+            Node parent,
+            Object sync) {
+        super(pageSeq, generatedBy, parent, sync);
+        this.columnCount =  columnCount;
+    }
+
+    /**
+     * @return the column count
+     */
+    public int getColumnCount() {
+        synchronized (sync) {
+            return columnCount;
+        }
+    }
+    /**
+     * Set spanning condition, only if no main-reference-area exists
+     */
+    public void setColumnCount(int columnCount) throws FOPException {
+        if (flowAreas == null) {
+            this.columnCount = columnCount;
+        }
+        else {
+            throw new FOPException("normal-flow-reference-areas exist");
+        }
+    }
+    
+    public boolean activeFlowRefAreas() {
+        if (flowAreas == null && currentFlowArea == null) {
+            return false;
+        }
+        return true;
+    }
+}
+