Revision: 7086
Author: victormote
Date: 2006-04-27 16:11:06 -0700 (Thu, 27 Apr 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7086&view=rev
Log Message:
-----------
Rename some classes with excessively long names.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/AbstractObjectReader.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
Added Paths:
-----------
trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyContentHandlerProxy.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvDistanceBetween.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvLabelSeparation.java
Removed Paths:
-------------
trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyGenerationContentHandlerProxy.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePageMasterAlternatives.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePageMasterReference.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvisionalDistanceBetweenStarts.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ProvisionalLabelSeparation.java
Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/AbstractObjectReader.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/AbstractObjectReader.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/AbstractObjectReader.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -51,7 +51,7 @@
private ContentHandler orgHandler;
/** Proxy for easy SAX event generation */
- protected EasyGenerationContentHandlerProxy handler;
+ protected EasyContentHandlerProxy handler;
/** Error handler */
protected ErrorHandler errorHandler;
@@ -78,7 +78,7 @@
*/
public void setContentHandler(ContentHandler handler) {
this.orgHandler = handler;
- this.handler = new EasyGenerationContentHandlerProxy(handler);
+ this.handler = new EasyContentHandlerProxy(handler);
}
/**
Copied: trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyContentHandlerProxy.java (from rev 7085, trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyGenerationContentHandlerProxy.java)
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyContentHandlerProxy.java (rev 0)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyContentHandlerProxy.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * 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.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+$Id$
+*/
+
+package org.foray.demo.embed.tools;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * This class is an implementation of ContentHandler which acts as a proxy to
+ * another ContentHandler and has the purpose to provide a few handy methods
+ * that make life easier when generating SAX events.
+ * <br>
+ * Note: This class is only useful for simple cases with no namespaces.
+ */
+
+public class EasyContentHandlerProxy implements ContentHandler {
+
+ /** An empty Attributes object used when no attributes are needed. */
+ public static final Attributes EMPTY_ATTS = new AttributesImpl();
+
+ private ContentHandler target;
+
+
+ /**
+ * Main constructor.
+ * @param forwardTo ContentHandler to forward the SAX event to.
+ */
+ public EasyContentHandlerProxy(ContentHandler forwardTo) {
+ this.target = forwardTo;
+ }
+
+
+ /**
+ * Sends the notification of the beginning of an element.
+ * @param name Name for the element.
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void startElement(String name) throws SAXException {
+ startElement(name, EMPTY_ATTS);
+ }
+
+
+ /**
+ * Sends the notification of the beginning of an element.
+ * @param name Name for the element.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void startElement(String name, Attributes atts) throws SAXException {
+ startElement(null, name, name, atts);
+ }
+
+
+ /**
+ * Send a String of character data.
+ * @param s The content String
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void characters(String s) throws SAXException {
+ target.characters(s.toCharArray(), 0, s.length());
+ }
+
+
+ /**
+ * Send the notification of the end of an element.
+ * @param name Name for the element.
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void endElement(String name) throws SAXException {
+ endElement(null, name, name);
+ }
+
+
+ /**
+ * Sends notifications for a whole element with some String content.
+ * @param name Name for the element.
+ * @param value Content of the element.
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void element(String name, String value) throws SAXException {
+ element(name, value, EMPTY_ATTS);
+ }
+
+
+ /**
+ * Sends notifications for a whole element with some String content.
+ * @param name Name for the element.
+ * @param value Content of the element.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
+ * @throws SAXException Any SAX exception, possibly wrapping another
+ * exception.
+ */
+ public void element(String name, String value, Attributes atts)
+ throws SAXException {
+ startElement(name, atts);
+ if (value != null) {
+ characters(value.toCharArray(), 0, value.length());
+ }
+ endElement(name);
+ }
+
+ /* =========== ContentHandler interface =========== */
+
+ /**
+ * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
+ */
+ public void setDocumentLocator(Locator locator) {
+ target.setDocumentLocator(locator);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#startDocument()
+ */
+ public void startDocument() throws SAXException {
+ target.startDocument();
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#endDocument()
+ */
+ public void endDocument() throws SAXException {
+ target.endDocument();
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
+ */
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
+ target.startPrefixMapping(prefix, uri);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
+ */
+ public void endPrefixMapping(String prefix) throws SAXException {
+ target.endPrefixMapping(prefix);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#startElement(String, String, String,
+ * Attributes)
+ */
+ public void startElement(String namespaceURI, String localName,
+ String qName, Attributes atts) throws SAXException {
+ target.startElement(namespaceURI, localName, qName, atts);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#endElement(String, String, String)
+ */
+ public void endElement(String namespaceURI, String localName, String qName)
+ throws SAXException {
+ target.endElement(namespaceURI, localName, qName);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#characters(char[], int, int)
+ */
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
+ target.characters(ch, start, length);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
+ */
+ public void ignorableWhitespace(char[] ch, int start, int length)
+ throws SAXException {
+ target.ignorableWhitespace(ch, start, length);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
+ */
+ public void processingInstruction(String target, String data)
+ throws SAXException {
+ this.target.processingInstruction(target, data);
+ }
+
+
+ /**
+ * @see org.xml.sax.ContentHandler#skippedEntity(String)
+ */
+ public void skippedEntity(String name) throws SAXException {
+ target.skippedEntity(name);
+ }
+
+}
\ No newline at end of file
Deleted: trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyGenerationContentHandlerProxy.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyGenerationContentHandlerProxy.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-app/src/java/org/foray/demo/embed/tools/EasyGenerationContentHandlerProxy.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -1,232 +0,0 @@
-/*
- * Copyright 2004 The FOray Project.
- * http://www.foray.org
- *
- * 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.
- *
- * This work is in part derived from the following work(s), used with the
- * permission of the licensor:
- * Apache FOP, licensed by the Apache Software Foundation
- *
- */
-
-/*
-$Id$
-*/
-
-package org.foray.demo.embed.tools;
-
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * This class is an implementation of ContentHandler which acts as a proxy to
- * another ContentHandler and has the purpose to provide a few handy methods
- * that make life easier when generating SAX events.
- * <br>
- * Note: This class is only useful for simple cases with no namespaces.
- */
-
-public class EasyGenerationContentHandlerProxy implements ContentHandler {
-
- /** An empty Attributes object used when no attributes are needed. */
- public static final Attributes EMPTY_ATTS = new AttributesImpl();
-
- private ContentHandler target;
-
-
- /**
- * Main constructor.
- * @param forwardTo ContentHandler to forward the SAX event to.
- */
- public EasyGenerationContentHandlerProxy(ContentHandler forwardTo) {
- this.target = forwardTo;
- }
-
-
- /**
- * Sends the notification of the beginning of an element.
- * @param name Name for the element.
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void startElement(String name) throws SAXException {
- startElement(name, EMPTY_ATTS);
- }
-
-
- /**
- * Sends the notification of the beginning of an element.
- * @param name Name for the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void startElement(String name, Attributes atts) throws SAXException {
- startElement(null, name, name, atts);
- }
-
-
- /**
- * Send a String of character data.
- * @param s The content String
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void characters(String s) throws SAXException {
- target.characters(s.toCharArray(), 0, s.length());
- }
-
-
- /**
- * Send the notification of the end of an element.
- * @param name Name for the element.
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void endElement(String name) throws SAXException {
- endElement(null, name, name);
- }
-
-
- /**
- * Sends notifications for a whole element with some String content.
- * @param name Name for the element.
- * @param value Content of the element.
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void element(String name, String value) throws SAXException {
- element(name, value, EMPTY_ATTS);
- }
-
-
- /**
- * Sends notifications for a whole element with some String content.
- * @param name Name for the element.
- * @param value Content of the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
- * @throws SAXException Any SAX exception, possibly wrapping another
- * exception.
- */
- public void element(String name, String value, Attributes atts)
- throws SAXException {
- startElement(name, atts);
- if (value != null) {
- characters(value.toCharArray(), 0, value.length());
- }
- endElement(name);
- }
-
- /* =========== ContentHandler interface =========== */
-
- /**
- * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
- */
- public void setDocumentLocator(Locator locator) {
- target.setDocumentLocator(locator);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#startDocument()
- */
- public void startDocument() throws SAXException {
- target.startDocument();
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#endDocument()
- */
- public void endDocument() throws SAXException {
- target.endDocument();
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
- */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- target.startPrefixMapping(prefix, uri);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
- */
- public void endPrefixMapping(String prefix) throws SAXException {
- target.endPrefixMapping(prefix);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#startElement(String, String, String,
- * Attributes)
- */
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts) throws SAXException {
- target.startElement(namespaceURI, localName, qName, atts);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#endElement(String, String, String)
- */
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException {
- target.endElement(namespaceURI, localName, qName);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#characters(char[], int, int)
- */
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- target.characters(ch, start, length);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
- */
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
- target.ignorableWhitespace(ch, start, length);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
- */
- public void processingInstruction(String target, String data)
- throws SAXException {
- this.target.processingInstruction(target, data);
- }
-
-
- /**
- * @see org.xml.sax.ContentHandler#skippedEntity(String)
- */
- public void skippedEntity(String name) throws SAXException {
- target.skippedEntity(name);
- }
-
-}
\ No newline at end of file
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -102,8 +102,8 @@
import org.foray.fotree.fo.prop.Pause;
import org.foray.fotree.fo.prop.Pitch;
import org.foray.fotree.fo.prop.PlayDuring;
-import org.foray.fotree.fo.prop.ProvisionalDistanceBetweenStarts;
-import org.foray.fotree.fo.prop.ProvisionalLabelSeparation;
+import org.foray.fotree.fo.prop.ProvDistanceBetween;
+import org.foray.fotree.fo.prop.ProvLabelSeparation;
import org.foray.fotree.fo.prop.RefId;
import org.foray.fotree.fo.prop.RegionName;
import org.foray.fotree.fo.prop.RelativeDimension;
@@ -1730,12 +1730,12 @@
public int getProvisionalDistanceBetweenStarts(
int ipdNearestBlockAreaNotLineArea) {
- ProvisionalDistanceBetweenStarts property
- = (ProvisionalDistanceBetweenStarts)
+ ProvDistanceBetween property
+ = (ProvDistanceBetween)
getProperty(Constants
.FOPROP_PROVISIONAL_DISTANCE_BETWEEN_STARTS);
if (property == null) {
- return ProvisionalDistanceBetweenStarts.traitValueNoInstance(fobj,
+ return ProvDistanceBetween.traitValueNoInstance(fobj,
ipdNearestBlockAreaNotLineArea);
}
return property.traitValue(fobj, ipdNearestBlockAreaNotLineArea);
@@ -1743,11 +1743,11 @@
public int getProvisionalLabelSeparation(int ipdNearestBlockAreaNotLineArea)
{
- ProvisionalLabelSeparation property
- = (ProvisionalLabelSeparation)
+ ProvLabelSeparation property
+ = (ProvLabelSeparation)
getProperty(Constants.FOPROP_PROVISIONAL_LABEL_SEPARATION);
if (property == null) {
- return ProvisionalLabelSeparation.traitValueNoInstance(fobj,
+ return ProvLabelSeparation.traitValueNoInstance(fobj,
ipdNearestBlockAreaNotLineArea);
}
return property.traitValue(fobj, ipdNearestBlockAreaNotLineArea);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/ObjectMakerFO.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -67,8 +67,8 @@
import org.foray.fotree.fo.obj.RegionBody;
import org.foray.fotree.fo.obj.RegionEnd;
import org.foray.fotree.fo.obj.RegionStart;
-import org.foray.fotree.fo.obj.RepeatablePageMasterAlternatives;
-import org.foray.fotree.fo.obj.RepeatablePageMasterReference;
+import org.foray.fotree.fo.obj.RepeatablePMAlternatives;
+import org.foray.fotree.fo.obj.RepeatablePMReference;
import org.foray.fotree.fo.obj.RetrieveMarker;
import org.foray.fotree.fo.obj.Root;
import org.foray.fotree.fo.obj.SimplePageMaster;
@@ -267,11 +267,11 @@
column);
}
case Constants.FO_REPEATABLE_PAGE_MASTER_ALTERNATIVES: {
- return new RepeatablePageMasterAlternatives(parent, propertyList,
+ return new RepeatablePMAlternatives(parent, propertyList,
systemId, line, column);
}
case Constants.FO_REPEATABLE_PAGE_MASTER_REFERENCE: {
- return new RepeatablePageMasterReference(parent, propertyList,
+ return new RepeatablePMReference(parent, propertyList,
systemId, line, column);
}
case Constants.FO_RETRIEVE_MARKER: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/PropertyMakerFO.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -103,8 +103,8 @@
import org.foray.fotree.fo.prop.Pause;
import org.foray.fotree.fo.prop.Pitch;
import org.foray.fotree.fo.prop.PlayDuring;
-import org.foray.fotree.fo.prop.ProvisionalDistanceBetweenStarts;
-import org.foray.fotree.fo.prop.ProvisionalLabelSeparation;
+import org.foray.fotree.fo.prop.ProvDistanceBetween;
+import org.foray.fotree.fo.prop.ProvLabelSeparation;
import org.foray.fotree.fo.prop.RefId;
import org.foray.fotree.fo.prop.RegionName;
import org.foray.fotree.fo.prop.RelativeDimension;
@@ -826,11 +826,11 @@
attributeValue);
}
case Constants.FOPROP_PROVISIONAL_DISTANCE_BETWEEN_STARTS: {
- return new ProvisionalDistanceBetweenStarts(propertyList,
+ return new ProvDistanceBetween(propertyList,
enumeration, propertyFullName, attributeValue);
}
case Constants.FOPROP_PROVISIONAL_LABEL_SEPARATION: {
- return new ProvisionalLabelSeparation(propertyList,
+ return new ProvLabelSeparation(propertyList,
enumeration, propertyFullName, attributeValue);
}
case Constants.FOPROP_REF_ID: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-04-27 22:50:20 UTC (rev 7085)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/ConditionalPageMasterReference.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -40,16 +40,16 @@
*/
public class ConditionalPageMasterReference extends FObj {
- private RepeatablePageMasterAlternatives repeatablePageMasterAlternatives;
+ private RepeatablePMAlternatives repeatablePageMasterAlternatives;
public ConditionalPageMasterReference(FObj parent,
PropertyList propertyList, String systemId, int line, int column)
throws FOTreeException {
super(parent, propertyList, systemId, line, column);
- if (parent instanceof RepeatablePageMasterAlternatives) {
+ if (parent instanceof RepeatablePMAlternatives) {
this.repeatablePageMasterAlternatives =
- (RepeatablePageMasterAlternatives)parent;
+ (RepeatablePMAlternatives)parent;
if (traitMasterReference() == null) {
logWarning(getFullName() + " has no master-reference, and "
+ "will be ignored.");
Copied: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java (from rev 7085, trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePageMasterAlternatives.java)
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java (rev 0)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMAlternatives.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * 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.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+$Id$
+*/
+
+package org.foray.fotree.fo.obj;
+
+import org.foray.fotree.FONode;
+import org.foray.fotree.FObj;
+import org.foray.fotree.Namespace;
+import org.foray.fotree.PropertyList;
+
+import org.axsl.fotree.FOTreeException;
+
+import java.util.ArrayList;
+
+/**
+ * The XSL-FO "repeatable-page-master-alternatives" object.
+ */
+public class RepeatablePMAlternatives extends FObj
+ implements SubSequenceSpecifier {
+
+ private PageSequenceMaster pageSequenceMaster;
+
+ /**
+ * Max times this page master can be repeated.
+ * INFINITE is used for the unbounded case
+ */
+ private int numberConsumed = 0;
+
+ private ArrayList conditionalPageMasterRefs;
+
+ public RepeatablePMAlternatives(FObj parent,
+ PropertyList propertyList, String systemId, int line, int column)
+ throws FOTreeException {
+ super(parent, propertyList, systemId, line, column);
+
+ if (parent instanceof PageSequenceMaster) {
+ this.pageSequenceMaster = (PageSequenceMaster)parent;
+ this.pageSequenceMaster.addSubsequenceSpecifier(this);
+ } else {
+ throwException(getFullName() + " must be child of "
+ + "fo:page-sequence-master.");
+ }
+ conditionalPageMasterRefs = new ArrayList();
+ }
+
+ public String getName() {
+ return "repeatable-page-master-alternatives";
+ }
+
+ public void addConditionalPageMasterReference(
+ ConditionalPageMasterReference cpmr) {
+ this.conditionalPageMasterRefs.add(cpmr);
+ }
+
+ public String getNextPageMasterName(boolean isOddPage,
+ boolean isFirstPage,
+ boolean isEmptyPage) {
+ if (numberConsumed < traitMaximumRepeats()) {
+ numberConsumed++;
+ } else {
+ return null;
+ }
+
+ for (int i = 0; i < conditionalPageMasterRefs.size(); i++) {
+ ConditionalPageMasterReference cpmr =
+ (ConditionalPageMasterReference)conditionalPageMasterRefs
+ .get(i);
+ if (cpmr.isValid(isOddPage, isFirstPage, isEmptyPage)) {
+ return cpmr.traitMasterReference();
+ }
+ }
+ return null;
+ }
+
+ public void reset() {
+ this.numberConsumed = 0;
+ }
+
+ public byte getNodeType() {
+ return FONode.NODE_REPEAT_PAGE_MASTER_ALTERN;
+ }
+
+ public Namespace getNamespace() {
+ return this.getFOTreeBuilder().getFONamespace();
+ }
+
+}
Copied: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java (from rev 7085, trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePageMasterReference.java)
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java (rev 0)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/RepeatablePMReference.java 2006-04-27 23:11:06 UTC (rev 7086)
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The FOray Project.
+ * http://www.foray.org
+ *
+ * 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.
+ *
+ * This work is in part derived from the following work(s), used with the
+ * permission of the licensor:
+ * Apache FOP, licensed by the Apache Software Foundation
+ *
+ */
+
+/*
+$Id$
+*/
+
+package org.foray.fotree.fo.obj;
+
+import org.foray.fotree.FONode;
+import org.foray.fotree.FObj;
+import org.foray.fotree.Namespace;
+import org.foray.fotree.PropertyList;
+
+import org.axsl.fotree.FOTreeException;
+
+
+/**
+ * The XSL-FO "repeatable-page-master-reference" object.
+ */
+public class RepeatablePMReference extends PageMasterReference
+ im...
[truncated message content] |