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 kl...@apache.org on 2001/01/02 22:35:50 UTC
cvs commit: xml-fop/src/org/apache/fop/fo KeepProperty.java ColorTypeProperty.java CondLengthProperty.java EnumProperty.java FObj.java LengthProperty.java LengthRangeProperty.java NumberProperty.java Property.java PropertyList.java PropertyListBuilder.java SpaceProperty.java
klease 01/01/02 13:35:50
Modified: src/org/apache/fop/fo ColorTypeProperty.java
CondLengthProperty.java EnumProperty.java FObj.java
LengthProperty.java LengthRangeProperty.java
NumberProperty.java Property.java PropertyList.java
PropertyListBuilder.java SpaceProperty.java
Added: src/org/apache/fop/fo KeepProperty.java
Log:
Modify compound property handling; add support for corresponding properties and mixed property types
Revision Changes Path
1.2 +2 -2 xml-fop/src/org/apache/fop/fo/ColorTypeProperty.java
Index: ColorTypeProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/ColorTypeProperty.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ColorTypeProperty.java 2000/11/10 22:02:13 1.1
+++ ColorTypeProperty.java 2001/01/02 21:35:37 1.2
@@ -1,4 +1,4 @@
-/*-- $Id: ColorTypeProperty.java,v 1.1 2000/11/10 22:02:13 klease Exp $ --
+/*-- $Id: ColorTypeProperty.java,v 1.2 2001/01/02 21:35:37 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -60,7 +60,7 @@
super(propName);
}
- protected Property convertProperty(Property p, PropertyList propertyList,
+ public Property convertProperty(Property p, PropertyList propertyList,
FObj fo) {
if (p instanceof ColorTypeProperty)
return p;
1.3 +14 -8 xml-fop/src/org/apache/fop/fo/CondLengthProperty.java
Index: CondLengthProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/CondLengthProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CondLengthProperty.java 2000/12/16 21:59:46 1.2
+++ CondLengthProperty.java 2001/01/02 21:35:37 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: CondLengthProperty.java,v 1.2 2000/12/16 21:59:46 klease Exp $ --
+/*-- $Id: CondLengthProperty.java,v 1.3 2001/01/02 21:35:37 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -53,22 +53,28 @@
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.CondLength;
-public class CondLengthProperty extends LengthProperty {
+public class CondLengthProperty extends Property {
- public static class Maker extends LengthProperty.Maker {
+ public static class Maker extends Property.Maker {
- public /* protected*/ Maker(String name) {
+ public Maker(String name) {
super(name);
}
}
- public CondLengthProperty(CondLength length) {
- super(length);
- }
+ private CondLength condLength= null;
+ public CondLengthProperty(CondLength condLength) {
+ this.condLength = condLength;
+ }
public CondLength getCondLength() {
- return (CondLength)super.getLength();
+ return this.condLength;
}
+
+ /* Question, should we allow this? */
+ public Length getLength() { return this.condLength.getLength().getLength(); }
+
+ public Object getObject() { return this.condLength; }
}
1.2 +8 -18 xml-fop/src/org/apache/fop/fo/EnumProperty.java
Index: EnumProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/EnumProperty.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EnumProperty.java 2000/11/10 22:02:13 1.1
+++ EnumProperty.java 2001/01/02 21:35:38 1.2
@@ -1,4 +1,4 @@
-/*-- $Id: EnumProperty.java,v 1.1 2000/11/10 22:02:13 klease Exp $ --
+/*-- $Id: EnumProperty.java,v 1.2 2001/01/02 21:35:38 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -61,30 +61,20 @@
super(propName);
}
- // set the Property from the String value
- public Property make(PropertyList propertyList, String value, FObj fo)
- throws FOPException
- {
- Property p = findConstant(value);
- if (p == null) {
- MessageHandler.errorln("WARNING: Unknown value for property '" +
+
+ /**
+ * Called by subclass if no match found.
+ */
+ public Property checkEnumValues(String value) {
+ MessageHandler.errorln("WARNING: Unknown enumerated value for property '" +
getPropName() + "': " + value);
- return make(propertyList); // return the default value
- }
- else {
- return p; //makeProperty(v);
- }
+ return null;
}
protected Property findConstant(String value) {
return null;
}
- /***
- protected Property makeProperty(int v) {
- return new EnumProperty(v);
- }
- ***/
}
private int value;
1.14 +203 -184 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- FObj.java 2000/12/16 21:53:18 1.13
+++ FObj.java 2001/01/02 21:35:39 1.14
@@ -1,184 +1,203 @@
-/*-- $Id: FObj.java,v 1.13 2000/12/16 21:53:18 klease Exp $ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "FOP" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jt...@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
- */
-
-package org.apache.fop.fo;
-
-// FOP
-import org.apache.fop.layout.Area;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.IDReferences;
-
-// Java
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-/**
- * base class for representation of formatting objects and their processing
- */
-public class FObj extends FONode {
-
- public static class Maker {
- public FObj make(FObj parent, PropertyList propertyList)
- throws FOPException {
- return new FObj(parent, propertyList);
- }
- }
-
- public static Maker maker() {
- return new Maker();
- }
-
-// protected PropertyList properties;
- public PropertyList properties;
-
- protected String name;
-
- protected FObj(FObj parent, PropertyList propertyList) {
- super(parent);
- this.properties = propertyList;
- propertyList.setFObj(this);
- this.name = "default FO";
- }
-
- /**
- * adds characters (does nothing here)
- * @param data text
- * @param start start position
- * @param length length of the text
- */
- protected void addCharacters(char data[], int start, int length) {
- // ignore
- }
-
- /**
- * generates the area or areas for this formatting object
- * and adds these to the area. This method should always be
- * overridden by all sub classes
- *
- * @param area
- */
- public Status layout(Area area) throws FOPException {
- // should always be overridden
- return new Status(Status.OK);
- }
-
- /**
- * returns the name of the formatting object
- * @return the name of this formatting objects
- */
- public String getName() {
- return this.name;
- }
-
- /**
- *
- */
- protected void start() {
- // do nothing by default
- }
-
- /**
- *
- */
- protected void end() {
- // do nothing by default
- }
-
- /**
- * lets outside sources access the property list
- * first used by PageNumberCitation to find the "id" property
- * @param name - the name of the desired property to obtain
- * @return the property
- */
- public Property getProperty(String name)
- {
- return(properties.get(name));
- }
-
-
- /**
- * Return the "content width" of the areas generated by this FO.
- * This is used by percent-based properties to get the dimension of
- * the containing block.
- * If an FO has a property with a percentage value, that value
- * is usually calculated on the basis of the corresponding dimension
- * of the area which contains areas generated by the FO.
- * NOTE: subclasses of FObj should implement this to return a reasonable
- * value!
- */
- public int getContentWidth() {
- return 0;
- }
-
- /**
- * removes property id
- * @param idReferences the id to remove
- */
- public void removeID(IDReferences idReferences)
- {
- idReferences.removeID( ((FObj)this).properties.get("id").getString());
- int numChildren = this.children.size();
- for (int i = 0; i < numChildren; i++)
- {
- FONode child= (FONode)children.elementAt(i);
- if ((child instanceof FObj))
- {
- ((FObj)child).removeID(idReferences);
- }
- }
- }
-
- public boolean generatesReferenceAreas() {
- return false;
- }
-
-}
-
+/*-- $Id: FObj.java,v 1.14 2001/01/02 21:35:39 klease Exp $ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jt...@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+
+package org.apache.fop.fo;
+
+// FOP
+import org.apache.fop.layout.Area;
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.IDReferences;
+
+// Java
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+/**
+ * base class for representation of formatting objects and their processing
+ */
+public class FObj extends FONode {
+
+ public static class Maker {
+ public FObj make(FObj parent, PropertyList propertyList)
+ throws FOPException {
+ return new FObj(parent, propertyList);
+ }
+ }
+
+ public static Maker maker() {
+ return new Maker();
+ }
+
+// protected PropertyList properties;
+ public PropertyList properties;
+
+ protected String name;
+
+ protected FObj(FObj parent, PropertyList propertyList) {
+ super(parent);
+ this.properties = propertyList;
+ propertyList.setFObj(this);
+ this.name = "default FO";
+ setWritingMode();
+ }
+
+ /**
+ * adds characters (does nothing here)
+ * @param data text
+ * @param start start position
+ * @param length length of the text
+ */
+ protected void addCharacters(char data[], int start, int length) {
+ // ignore
+ }
+
+ /**
+ * generates the area or areas for this formatting object
+ * and adds these to the area. This method should always be
+ * overridden by all sub classes
+ *
+ * @param area
+ */
+ public Status layout(Area area) throws FOPException {
+ // should always be overridden
+ return new Status(Status.OK);
+ }
+
+ /**
+ * returns the name of the formatting object
+ * @return the name of this formatting objects
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ *
+ */
+ protected void start() {
+ // do nothing by default
+ }
+
+ /**
+ *
+ */
+ protected void end() {
+ // do nothing by default
+ }
+
+ /**
+ * lets outside sources access the property list
+ * first used by PageNumberCitation to find the "id" property
+ * @param name - the name of the desired property to obtain
+ * @return the property
+ */
+ public Property getProperty(String name)
+ {
+ return(properties.get(name));
+ }
+
+
+ /**
+ * Return the "content width" of the areas generated by this FO.
+ * This is used by percent-based properties to get the dimension of
+ * the containing block.
+ * If an FO has a property with a percentage value, that value
+ * is usually calculated on the basis of the corresponding dimension
+ * of the area which contains areas generated by the FO.
+ * NOTE: subclasses of FObj should implement this to return a reasonable
+ * value!
+ */
+ public int getContentWidth() {
+ return 0;
+ }
+
+ /**
+ * removes property id
+ * @param idReferences the id to remove
+ */
+ public void removeID(IDReferences idReferences)
+ {
+ idReferences.removeID( ((FObj)this).properties.get("id").getString());
+ int numChildren = this.children.size();
+ for (int i = 0; i < numChildren; i++)
+ {
+ FONode child= (FONode)children.elementAt(i);
+ if ((child instanceof FObj))
+ {
+ ((FObj)child).removeID(idReferences);
+ }
+ }
+ }
+
+ public boolean generatesReferenceAreas() {
+ return false;
+ }
+
+ /**
+ * Set writing mode for this FO.
+ * Find nearest ancestor, including self, which generates
+ * reference areas and use the value of its writing-mode property.
+ */
+ private void setWritingMode() {
+ FObj p = this;
+ while (p!= null && !p.generatesReferenceAreas())
+ p = p.getParent();
+ if (p != null) {
+ this.properties.setWritingMode(p.getProperty("writing-mode").getEnum());
+ }
+ else {
+ // shouldn't happen!!!
+ }
+ }
+
+
+}
+
1.3 +2 -2 xml-fop/src/org/apache/fop/fo/LengthProperty.java
Index: LengthProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/LengthProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LengthProperty.java 2000/12/16 21:53:18 1.2
+++ LengthProperty.java 2001/01/02 21:35:40 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: LengthProperty.java,v 1.2 2000/12/16 21:53:18 klease Exp $ --
+/*-- $Id: LengthProperty.java,v 1.3 2001/01/02 21:35:40 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -77,7 +77,7 @@
return false;
}
- protected Property convertProperty(Property p, PropertyList propertyList,
+ public Property convertProperty(Property p, PropertyList propertyList,
FObj fo) throws FOPException {
if (isAutoLengthAllowed()) {
String pval = p.getString();
1.3 +1 -3 xml-fop/src/org/apache/fop/fo/LengthRangeProperty.java
Index: LengthRangeProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/LengthRangeProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- LengthRangeProperty.java 2000/12/16 21:53:18 1.2
+++ LengthRangeProperty.java 2001/01/02 21:35:40 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: LengthRangeProperty.java,v 1.2 2000/12/16 21:53:18 klease Exp $ --
+/*-- $Id: LengthRangeProperty.java,v 1.3 2001/01/02 21:35:40 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -70,8 +70,6 @@
public LengthRange getLengthRange() { return this.lengthRange; }
- /* Question, should we allow this? */
- public Length getLength() { return this.lengthRange.getOptimum(); }
public Object getObject() { return this.lengthRange ; }
}
1.3 +2 -2 xml-fop/src/org/apache/fop/fo/NumberProperty.java
Index: NumberProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/NumberProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NumberProperty.java 2000/12/04 20:10:28 1.2
+++ NumberProperty.java 2001/01/02 21:35:41 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: NumberProperty.java,v 1.2 2000/12/04 20:10:28 gears Exp $ --
+/*-- $Id: NumberProperty.java,v 1.3 2001/01/02 21:35:41 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -61,7 +61,7 @@
super(propName);
}
- protected Property convertProperty(Property p, PropertyList propertyList,
+ public Property convertProperty(Property p, PropertyList propertyList,
FObj fo) {
if (p instanceof NumberProperty)
return p;
1.12 +29 -11 xml-fop/src/org/apache/fop/fo/Property.java
Index: Property.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Property.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Property.java 2000/12/16 21:53:19 1.11
+++ Property.java 2001/01/02 21:35:41 1.12
@@ -1,4 +1,4 @@
-/*-- $Id: Property.java,v 1.11 2000/12/16 21:53:19 klease Exp $ --
+/*-- $Id: Property.java,v 1.12 2001/01/02 21:35:41 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -202,16 +202,22 @@
*/
public Property make(PropertyList propertyList, String value, FObj fo)
throws FOPException {
- // skeleton for all Makers except for Enum properties
try {
- /* Check for keyword shorthand values to be substituted. */
Property pret=null;
- String pvalue = checkValueKeywords(value);
- // Override parsePropertyValue in each subclass of Property.Maker
- Property p = PropertyParser.parse(pvalue,
- new PropertyInfo(this, propertyList, fo));
- pret = convertProperty(p, propertyList, fo);
+ String pvalue=value;
+ pret = checkEnumValues(value);
if (pret == null) {
+ /* Check for keyword shorthand values to be substituted. */
+ pvalue = checkValueKeywords(value);
+ // Override parsePropertyValue in each subclass of Property.Maker
+ Property p = PropertyParser.parse(pvalue,
+ new PropertyInfo(this, propertyList, fo));
+ pret = convertProperty(p, propertyList, fo);
+ }
+ else if (isCompoundMaker()) {
+ pret = convertProperty(pret, propertyList, fo);
+ }
+ if (pret == null) {
throw new org.apache.fop.fo.expr.PropertyException("No conversion defined");
}
else if (inheritsSpecified()) {
@@ -225,6 +231,14 @@
}
}
+ protected boolean isCompoundMaker() {
+ return false;
+ }
+
+ public Property checkEnumValues(String value) {
+ return null;
+ }
+
/**
* Return a String to be parsed if the passed value corresponds to
* a keyword which can be parsed and used to initialize the property.
@@ -254,7 +268,7 @@
* @return A Property of the correct type or null if the parsed value
* can't be converted to the correct type.
*/
- protected Property convertProperty(Property p,
+ public Property convertProperty(Property p,
PropertyList propertyList, FObj fo) throws FOPException {
return null;
}
@@ -292,7 +306,7 @@
* @return Property A computed Property value or null if no rules
* are specified (in foproperties.xml) to compute the value.
*/
- public Property compute(PropertyList propertyList) {
+ public Property compute(PropertyList propertyList) throws FOPException {
if (inheritsSpecified()) {
// recalculate based on last specified value
// Climb up propertylist and find last spec'd value
@@ -314,6 +328,10 @@
}
return null; // standard
}
+
+ public boolean isCorrespondingForced(PropertyList propertyList) {
+ return false;
+ }
} // end of nested Maker class
@@ -345,8 +363,8 @@
public CondLength getCondLength() { return null; }
public LengthRange getLengthRange() { return null; }
public Space getSpace() { return null; }
- /* KL: first decide which direction to go with this!
public Keep getKeep() { return null; }
+ /* KL: first decide which direction to go with this!
public KeepValue getKeepValue() { return null; }
public Precedence getPrecedence() { return null; }
*/
1.11 +86 -10 xml-fop/src/org/apache/fop/fo/PropertyList.java
Index: PropertyList.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyList.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- PropertyList.java 2000/12/16 21:53:19 1.10
+++ PropertyList.java 2001/01/02 21:35:42 1.11
@@ -1,4 +1,4 @@
-/*-- $Id: PropertyList.java,v 1.10 2000/12/16 21:53:19 klease Exp $ --
+/*-- $Id: PropertyList.java,v 1.11 2001/01/02 21:35:42 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -52,10 +52,43 @@
import java.util.Hashtable;
import org.apache.fop.messaging.MessageHandler;
-
+import org.apache.fop.fo.properties.WritingMode;
import org.apache.fop.apps.FOPException;
public class PropertyList extends Hashtable {
+
+ private byte[] wmtable=null; // writing-mode values
+ public static final int LEFT=0;
+ public static final int RIGHT=1;
+ public static final int TOP=2;
+ public static final int BOTTOM=3;
+ public static final int HEIGHT=4;
+ public static final int WIDTH=5;
+
+ public static final int START=0;
+ public static final int END=1;
+ public static final int BEFORE=2;
+ public static final int AFTER=3;
+ public static final int BLOCKPROGDIM=4;
+ public static final int INLINEPROGDIM=5;
+
+ private static final String[] sAbsNames= new String[]
+ {"left", "right", "top", "bottom", "height", "width"};
+
+ private static final String[] sRelNames= new String[]
+ {"start", "end", "before", "after",
+ "block-progression-dimension", "inline-progression-dimension"};
+
+ static private final Hashtable wmtables = new Hashtable(4);
+ {
+ wmtables.put(new Integer(WritingMode.LR_TB), /* lr-tb */
+ new byte[]{START, END, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM });
+ wmtables.put(new Integer(WritingMode.RL_TB), /* rl-tb */
+ new byte[]{END, START, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM });
+ wmtables.put(new Integer(WritingMode.TB_RL), /* tb-rl */
+ new byte[]{AFTER, BEFORE, START, END, INLINEPROGDIM, BLOCKPROGDIM });
+ }
+
private PropertyListBuilder builder;
private PropertyList parentPropertyList = null;
String namespace = "";
@@ -118,21 +151,34 @@
return null; // No builder or exception in makeProperty!
}
+ /* If the property is a relative property with a corresponding absolute
+ * value specified, the absolute value is used. This is also true of
+ * the inheritance priority (I think...)
+ * If the property is an "absolute" property and it isn't specified, then
+ * we try to compute it from the corresponding relative property: this
+ * happends in computeProperty.
+ */
private Property findProperty(String propertyName) {
- Property p = getExplicit(propertyName);
- if (p == null) {
- p = this.builder.computeProperty(this,namespace, element, propertyName);
+ Property p = null;
+ if (builder.isCorrespondingForced(this, namespace, element, propertyName)) {
+ p = builder.computeProperty(this,namespace, element, propertyName);
}
- if (p == null) { // else inherit (if has parent and is inheritable)
- if (this.parentPropertyList != null &&
- builder.isInherited(namespace, element, propertyName)) {
- p = parentPropertyList.findProperty(propertyName);
+ else {
+ p = getExplicit(propertyName);
+ if (p == null) {
+ p = this.builder.computeProperty(this,namespace, element, propertyName);
+ }
+ if (p == null) { // else inherit (if has parent and is inheritable)
+ if (this.parentPropertyList != null &&
+ builder.isInherited(namespace, element, propertyName)) {
+ p = parentPropertyList.findProperty(propertyName);
+ }
}
}
return p;
}
+
-
/**
* Return the property on the current FlowObject. If it isn't set explicitly,
* this will try to compute it based on other properties, or if it is
@@ -228,6 +274,36 @@
}
return null; // No builder or exception in makeProperty!
}
+
+ /** Given an absolute direction (top, bottom, left, right),
+ * return the corresponding writing model relative direction name
+ * for the flow object. Uses the stored writingMode.
+ */
+ public String wmAbsToRel(int absdir) {
+ if (wmtable != null) {
+ return sRelNames[wmtable[absdir]];
+ }
+ else return "";
+ }
+
+ /** Given a writing mode relative direction (start, end, before, after)
+ * return the corresponding absolute direction name
+ * for the flow object. Uses the stored writingMode.
+ */
+ public String wmRelToAbs(int reldir) {
+ if (wmtable != null) {
+ for (int i=0; i < wmtable.length; i++) {
+ if (wmtable[i]==reldir)
+ return sAbsNames[i];
+ }
+ }
+ return "";
+ }
+
+ /** Set the writing mode traits for the FO with this property list. */
+ public void setWritingMode(int writingMode) {
+ this.wmtable = (byte[])wmtables.get(new Integer(writingMode));
+ }
}
1.28 +269 -251 xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java
Index: PropertyListBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyListBuilder.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- PropertyListBuilder.java 2000/12/16 21:53:19 1.27
+++ PropertyListBuilder.java 2001/01/02 21:35:43 1.28
@@ -1,251 +1,269 @@
-/*-- $Id: PropertyListBuilder.java,v 1.27 2000/12/16 21:53:19 klease Exp $ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "FOP" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jt...@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
- */
-
-package org.apache.fop.fo;
-
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.messaging.MessageHandler;
-import org.apache.fop.svg.*;
-import org.apache.fop.datatypes.*;
-
-import org.apache.fop.apps.FOPException;
-
-import org.xml.sax.Attributes;
-
-import java.util.Hashtable;
-
-public class PropertyListBuilder {
-
- /** Name of font-size property attribute to set first. */
- private static final String FONTSIZEATTR = "font-size";
-
- private Hashtable propertyListTable;
- private Hashtable elementTable;
-
- public PropertyListBuilder() {
- this.propertyListTable = new Hashtable();
- this.elementTable = new Hashtable();
- }
-
- public void addList(Hashtable list)
- {
- propertyListTable = list; // should add all
- }
-
- public void addElementList(String element, Hashtable list)
- {
- elementTable.put(element, list);
- }
-
- public Property computeProperty(PropertyList propertyList, String space, String element, String propertyName) {
-
- Property p = null;
- Property.Maker propertyMaker = findMaker(space, element, propertyName);
- if (propertyMaker != null) {
- p = propertyMaker.compute(propertyList);
- } else {
- MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
- }
- return p;
- }
-
- public boolean isInherited(String space, String element, String propertyName) {
- boolean b;
-
- Property.Maker propertyMaker = findMaker(space, element, propertyName);
- if (propertyMaker != null) {
- b = propertyMaker.isInherited();
- } else {
- //MessageHandler.errorln("WARNING: Unknown property " + propertyName);
- b = true;
- }
- return b;
- }
-
- public PropertyList makeList(String elementName, Attributes attributes, PropertyList parentPropertyList, FObj parentFO) throws FOPException {
- int index = elementName.indexOf("^");
- String space = "http://www.w3.org/TR/1999/XSL/Format";
- if(index != -1) {
- space = elementName.substring(0, index);
- }
-
- PropertyList par = null;
- if(parentPropertyList != null && space.equals(parentPropertyList.getNameSpace())) {
- par = parentPropertyList;
- }
-// System.out.println(elementName.substring(index + 1));
- PropertyList p = new PropertyList(par, space, elementName.substring(index + 1));
- p.setBuilder(this);
- Hashtable table;
- table = (Hashtable)elementTable.get(elementName.substring(index + 1));
-
- /* Store names of properties already set. */
- StringBuffer propsDone = new StringBuffer(256);
- propsDone.append(' ');
-
- /* If font-size is set on this FO, must set it first, since
- * other attributes specified in terms of "ems" depend on it.
- * When we do "shorthand" properties, must handle the "font"
- * property as well to see if font-size is set.
- */
- String fontsizeval=attributes.getValue(FONTSIZEATTR);
- if (fontsizeval != null) {
- Property.Maker propertyMaker = findMaker(table, FONTSIZEATTR);
- if (propertyMaker != null) {
- try {
- p.put(FONTSIZEATTR, propertyMaker.make(p,fontsizeval,parentFO));
- } catch (FOPException e) { }
- }
- // Put in the "done" list even if error or no Maker.
- propsDone.append(FONTSIZEATTR + ' ');
- }
-
- for (int i = 0; i < attributes.getLength(); i++) {
- String attributeName = attributes.getQName(i);
- /* Handle "compound" properties, ex. space-before.minimum */
- int sepchar = attributeName.indexOf('.');
- String propName = attributeName;
- String subpropName = null;
- Property propVal = null;
- if (sepchar > -1) {
- propName = attributeName.substring(0,sepchar);
- subpropName = attributeName.substring(sepchar+1);
- }
- else if (propsDone.toString().indexOf(' '+propName+' ') != -1) {
- // Already processed this property (base property
- // for a property with sub-components or font-size)
- continue;
- }
-
- Property.Maker propertyMaker =findMaker(table, propName);
-
- if (propertyMaker != null) {
- try {
- if (subpropName != null) {
- Property baseProp = p.getExplicit(propName);
- if (baseProp == null) {
- // See if it is specified later in this list
- String baseValue = attributes.getValue(propName);
- if (baseValue != null) {
- baseProp = propertyMaker.make(p, baseValue, parentFO);
- propsDone.append(propName + ' ');
- }
- //else baseProp = propertyMaker.makeCompound(p, parentFO);
- }
- propVal = propertyMaker.make(baseProp, subpropName, p,
- attributes.getValue(i),parentFO);
- }
- else {
- propVal = propertyMaker.make(p,attributes.getValue(i),parentFO);
- }
- if (propVal != null) {
- p.put(propName,propVal);
- }
- } catch (FOPException e) { /* Do other props. */ }
- } else {
- if (! attributeName.startsWith("xmlns"))
- MessageHandler.errorln("WARNING: property '" +
- attributeName + "' ignored");
- }
- }
-
- return p;
- }
-
- public Property getSubpropValue(String space, String element,
- String propertyName, Property p,
- String subpropName) {
- Property.Maker maker = findMaker(space, element, propertyName);
- if (maker != null) {
- return maker.getSubpropValue(p, subpropName);
- }
- else return null;
- }
-
- public Property makeProperty(PropertyList propertyList, String space, String element, String propertyName) throws FOPException {
-
- Property p = null;
-
- Property.Maker propertyMaker = findMaker(space, element, propertyName);
- if (propertyMaker != null) {
- p = propertyMaker.make(propertyList);
- } else {
- MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
- }
- return p;
- }
-
- protected Property.Maker findMaker(String space, String elementName, String propertyName)
- {
- return findMaker((Hashtable)elementTable.get(elementName),
- propertyName);
- }
-
- /**
- * Convenience function to return the Maker for a given property
- * given the Hashtable containing properties specific to this element.
- * If table is non-null and
- * @param elemTable Element-specific properties or null if none.
- * @param propertyName Name of property.
- * @return A Maker for this property.
- */
- private Property.Maker findMaker(Hashtable elemTable, String propertyName) {
- Property.Maker propertyMaker = null;
- if (elemTable != null) {
- propertyMaker = (Property.Maker)elemTable.get(propertyName);
- }
- if (propertyMaker == null) {
- propertyMaker = (Property.Maker)propertyListTable.get(propertyName);
- }
- return propertyMaker;
- }
-
-}
+/*-- $Id: PropertyListBuilder.java,v 1.28 2001/01/02 21:35:43 klease Exp $ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jt...@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+
+package org.apache.fop.fo;
+
+import org.apache.fop.fo.properties.*;
+import org.apache.fop.messaging.MessageHandler;
+import org.apache.fop.svg.*;
+import org.apache.fop.datatypes.*;
+
+import org.apache.fop.apps.FOPException;
+
+import org.xml.sax.Attributes;
+
+import java.util.Hashtable;
+
+public class PropertyListBuilder {
+
+ /** Name of font-size property attribute to set first. */
+ private static final String FONTSIZEATTR = "font-size";
+
+ private Hashtable propertyListTable;
+ private Hashtable elementTable;
+
+ public PropertyListBuilder() {
+ this.propertyListTable = new Hashtable();
+ this.elementTable = new Hashtable();
+ }
+
+ public void addList(Hashtable list)
+ {
+ propertyListTable = list; // should add all
+ }
+
+ public void addElementList(String element, Hashtable list)
+ {
+ elementTable.put(element, list);
+ }
+
+ public Property computeProperty(PropertyList propertyList, String space, String element, String propertyName) {
+
+ Property p = null;
+ Property.Maker propertyMaker = findMaker(space, element, propertyName);
+ if (propertyMaker != null) {
+ try {
+ p = propertyMaker.compute(propertyList);
+ } catch (FOPException e) {
+ MessageHandler.errorln("ERROR: exception occurred while computing" +
+ " value of property '" + propertyName +"': " + e.getMessage());
+ }
+ } else {
+ MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
+ }
+ return p;
+ }
+
+ public boolean isInherited(String space, String element, String propertyName) {
+ boolean b;
+
+ Property.Maker propertyMaker = findMaker(space, element, propertyName);
+ if (propertyMaker != null) {
+ b = propertyMaker.isInherited();
+ } else {
+ //MessageHandler.errorln("WARNING: Unknown property " + propertyName);
+ b = true;
+ }
+ return b;
+ }
+
+ public PropertyList makeList(String elementName, Attributes attributes, PropertyList parentPropertyList, FObj parentFO) throws FOPException {
+ int index = elementName.indexOf("^");
+ String space = "http://www.w3.org/TR/1999/XSL/Format";
+ if(index != -1) {
+ space = elementName.substring(0, index);
+ }
+
+ PropertyList par = null;
+ if(parentPropertyList != null && space.equals(parentPropertyList.getNameSpace())) {
+ par = parentPropertyList;
+ }
+// System.out.println(elementName.substring(index + 1));
+ PropertyList p = new PropertyList(par, space, elementName.substring(index + 1));
+ p.setBuilder(this);
+ Hashtable table;
+ table = (Hashtable)elementTable.get(elementName.substring(index + 1));
+
+ /* Store names of properties already set. */
+ StringBuffer propsDone = new StringBuffer(256);
+ propsDone.append(' ');
+
+ /* If font-size is set on this FO, must set it first, since
+ * other attributes specified in terms of "ems" depend on it.
+ * When we do "shorthand" properties, must handle the "font"
+ * property as well to see if font-size is set.
+ */
+ String fontsizeval=attributes.getValue(FONTSIZEATTR);
+ if (fontsizeval != null) {
+ Property.Maker propertyMaker = findMaker(table, FONTSIZEATTR);
+ if (propertyMaker != null) {
+ try {
+ p.put(FONTSIZEATTR, propertyMaker.make(p,fontsizeval,parentFO));
+ } catch (FOPException e) { }
+ }
+ // Put in the "done" list even if error or no Maker.
+ propsDone.append(FONTSIZEATTR + ' ');
+ }
+
+ for (int i = 0; i < attributes.getLength(); i++) {
+ String attributeName = attributes.getQName(i);
+ /* Handle "compound" properties, ex. space-before.minimum */
+ int sepchar = attributeName.indexOf('.');
+ String propName = attributeName;
+ String subpropName = null;
+ Property propVal = null;
+ if (sepchar > -1) {
+ propName = attributeName.substring(0,sepchar);
+ subpropName = attributeName.substring(sepchar+1);
+ }
+ else if (propsDone.toString().indexOf(' '+propName+' ') != -1) {
+ // Already processed this property (base property
+ // for a property with sub-components or font-size)
+ continue;
+ }
+
+ Property.Maker propertyMaker =findMaker(table, propName);
+
+ if (propertyMaker != null) {
+ try {
+ if (subpropName != null) {
+ Property baseProp = p.getExplicit(propName);
+ if (baseProp == null) {
+ // See if it is specified later in this list
+ String baseValue = attributes.getValue(propName);
+ if (baseValue != null) {
+ baseProp = propertyMaker.make(p, baseValue, parentFO);
+ propsDone.append(propName + ' ');
+ }
+ //else baseProp = propertyMaker.makeCompound(p, parentFO);
+ }
+ propVal = propertyMaker.make(baseProp, subpropName, p,
+ attributes.getValue(i),parentFO);
+ }
+ else {
+ propVal = propertyMaker.make(p,attributes.getValue(i),parentFO);
+ }
+ if (propVal != null) {
+ p.put(propName,propVal);
+ }
+ } catch (FOPException e) { /* Do other props. */ }
+ } else {
+ if (! attributeName.startsWith("xmlns"))
+ MessageHandler.errorln("WARNING: property '" +
+ attributeName + "' ignored");
+ }
+ }
+
+ return p;
+ }
+
+ public Property getSubpropValue(String space, String element,
+ String propertyName, Property p,
+ String subpropName) {
+ Property.Maker maker = findMaker(space, element, propertyName);
+ if (maker != null) {
+ return maker.getSubpropValue(p, subpropName);
+ }
+ else return null;
+ }
+
+
+ public boolean isCorrespondingForced(PropertyList propertyList, String space,
+ String element, String propertyName) {
+ Property.Maker propertyMaker = findMaker(space, element, propertyName);
+ if (propertyMaker != null) {
+ return propertyMaker.isCorrespondingForced(propertyList);
+ } else {
+ MessageHandler.errorln("WARNING: no Maker for " + propertyName);
+ }
+ return false;
+ }
+
+
+ public Property makeProperty(PropertyList propertyList, String space, String element, String propertyName) throws FOPException {
+
+ Property p = null;
+
+ Property.Maker propertyMaker = findMaker(space, element, propertyName);
+ if (propertyMaker != null) {
+ p = propertyMaker.make(propertyList);
+ } else {
+ MessageHandler.errorln("WARNING: property " + propertyName + " ignored");
+ }
+ return p;
+ }
+
+ protected Property.Maker findMaker(String space, String elementName, String propertyName)
+ {
+ return findMaker((Hashtable)elementTable.get(elementName),
+ propertyName);
+ }
+
+ /**
+ * Convenience function to return the Maker for a given property
+ * given the Hashtable containing properties specific to this element.
+ * If table is non-null and
+ * @param elemTable Element-specific properties or null if none.
+ * @param propertyName Name of property.
+ * @return A Maker for this property.
+ */
+ private Property.Maker findMaker(Hashtable elemTable, String propertyName) {
+ Property.Maker propertyMaker = null;
+ if (elemTable != null) {
+ propertyMaker = (Property.Maker)elemTable.get(propertyName);
+ }
+ if (propertyMaker == null) {
+ propertyMaker = (Property.Maker)propertyListTable.get(propertyName);
+ }
+ return propertyMaker;
+ }
+
+}
1.3 +1 -3 xml-fop/src/org/apache/fop/fo/SpaceProperty.java
Index: SpaceProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/SpaceProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SpaceProperty.java 2000/12/16 21:53:18 1.2
+++ SpaceProperty.java 2001/01/02 21:35:44 1.3
@@ -1,4 +1,4 @@
-/*-- $Id: SpaceProperty.java,v 1.2 2000/12/16 21:53:18 klease Exp $ --
+/*-- $Id: SpaceProperty.java,v 1.3 2001/01/02 21:35:44 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -70,8 +70,6 @@
public Space getSpace() { return this.space; }
- /* Question, should we allow this? */
- public Length getLength() { return this.space.getOptimum(); }
/* Space extends LengthRange */
public LengthRange getLengthRange() { return this.space; }
public Object getObject() { return this.space; }
1.1 xml-fop/src/org/apache/fop/fo/KeepProperty.java
Index: KeepProperty.java
===================================================================
/*-- $Id: KeepProperty.java,v 1.1 2001/01/02 21:35:36 klease Exp $ --
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "FOP" and "Apache Software Foundation" must not be used to
endorse or promote products derived from this software without prior
written permission. For written permission, please contact
apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation and was originally created by
James Tauber <jt...@jtauber.com>. For more information on the Apache
Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.fop.fo;
import org.apache.fop.datatypes.Keep;
public class KeepProperty extends Property {
public static class Maker extends Property.Maker {
protected Maker(String name) {
super(name);
}
}
private Keep keep ;
public KeepProperty(Keep keep) {
this.keep = keep;
}
public Keep getKeep() { return this.keep; }
public Object getObject() { return this.keep; }
}