From da00a8026f29f724fadbc294e595c06292c2fe17 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sun, 2 May 2004 17:28:13 +0000 Subject: [PATCH] Renamed from Span git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197559 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/area/SpanReferenceArea.java | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 src/java/org/apache/fop/area/SpanReferenceArea.java diff --git a/src/java/org/apache/fop/area/SpanReferenceArea.java b/src/java/org/apache/fop/area/SpanReferenceArea.java new file mode 100644 index 000000000..137083bd6 --- /dev/null +++ b/src/java/org/apache/fop/area/SpanReferenceArea.java @@ -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 span + * 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; + } +} + -- 2.39.5