/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
-import org.apache.fop.fo.Property;
-
/**
- * a length quantity in XSL which is specified as "auto"
+ * A length quantity in XSL which is specified as "auto".
*/
public class AutoLength extends Length {
+ /**
+ * @see org.apache.fop.datatypes.Length#isAuto()
+ */
public boolean isAuto() {
return true;
}
// protected void computeValue() {
// }
+ /**
+ * @see java.lang.Object#toString()
+ */
public String toString() {
return "auto";
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
-import java.util.*;
import java.io.Serializable;
+import java.util.StringTokenizer;
/**
- * a colour quantity in XSL
+ * A colour quantity in XSL.
*/
public class ColorType implements Serializable {
*/
protected float alpha = 0;
+ /**
+ * Main constructor
+ * @param red red component
+ * @param green green component
+ * @param blue blue component
+ */
public ColorType(float red, float green, float blue) {
this.red = red;
this.green = green;
}
/**
- * set the colour given a particular String specifying either a
+ * Set the colour given a particular String specifying either a
* colour name or #RGB or #RRGGBB
+ * @param value RGB value as String to be parsed
*/
public ColorType(String value) {
if (value.startsWith("#")) {
this.alpha = 1;
} else {
boolean found = false;
- for (int count = 0; count < names.length; count++) {
- if (value.toLowerCase().equals(names[count])) {
- this.red = vals[count][0] / 255f;
- this.green = vals[count][1] / 255f;
- this.blue = vals[count][2] / 255f;
+ for (int count = 0; count < NAMES.length; count++) {
+ if (value.toLowerCase().equals(NAMES[count])) {
+ this.red = VALUES[count][0] / 255f;
+ this.green = VALUES[count][1] / 255f;
+ this.blue = VALUES[count][2] / 255f;
found = true;
break;
}
}
}
- public float blue() {
+ /**
+ * Returns the blue component of the color.
+ * @return float a value between 0.0 and 1.0
+ */
+ public float getBlue() {
return this.blue;
}
- public float green() {
+ /**
+ * Returns the green component of the color.
+ * @return float a value between 0.0 and 1.0
+ */
+ public float getGreen() {
return this.green;
}
- public float red() {
+ /**
+ * Returns the red component of the color.
+ * @return float a value between 0.0 and 1.0
+ */
+ public float getRed() {
return this.red;
}
+ /**
+ * Returns the alpha (transparency) component of the color.
+ * @return float a value between 0.0 and 1.0
+ */
public float alpha() {
return this.alpha;
}
+ /**
+ * @see java.lang.Object#toString()
+ */
public String toString() {
StringBuffer sbuf = new StringBuffer(8);
sbuf.append('#');
return sbuf.toString();
}
- protected static final String[] names = {
+ /** The names of the predefined colors */
+ protected static final String[] NAMES = {
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
"bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate", "coral",
"whitesmoke", "yellow", "yellowgreen"
};
- protected static final int[][] vals = {
+ /** The color values for the predefined colors */
+ protected static final int[][] VALUES = {
{
240, 248, 255
}, {
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
+
import org.apache.fop.fo.Property;
+/**
+ * This interface is used as a base for compound datatypes.
+ */
public interface CompoundDatatype {
- public void setComponent(String sCmpnName, Property cmpnValue,
- boolean bIsDefault);
+
+ /**
+ * Sets a component of the compound datatype.
+ * @param sCmpnName name of the component
+ * @param cmpnValue value of the component
+ * @param bIsDefault Indicates if it's the default value
+ */
+ void setComponent(String sCmpnName, Property cmpnValue, boolean bIsDefault);
- public Property getComponent(String sCmpnName);
+ /**
+ * Returns a component of the compound datatype.
+ * @param sCmpnName name of the component
+ * @return the value of the component
+ */
+ Property getComponent(String sCmpnName);
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
import org.apache.fop.fo.properties.Constants;
/**
- * a space quantity in XSL (space-before, space-after)
+ * A space quantity in XSL (space-before, space-after).
+ * See length-conditional datatype in the specs.
*/
public class CondLength implements CompoundDatatype {
private Property length;
private Property conditionality;
- // From CompoundDatatype
+ /**
+ * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(String, Property, boolean)
+ */
public void setComponent(String sCmpnName, Property cmpnValue,
boolean bIsDefault) {
if (sCmpnName.equals("length")) {
}
}
+ /**
+ * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(String)
+ */
public Property getComponent(String sCmpnName) {
if (sCmpnName.equals("length")) {
return length;
}
}
+ /**
+ * Returns the conditionality.
+ * @return the conditionality
+ */
public Property getConditionality() {
return this.conditionality;
}
+ /**
+ * Returns the length.
+ * @return the length
+ */
public Property getLength() {
return this.length;
}
+ /**
+ * Indicates if the length can be discarded on certain conditions.
+ * @return true if the length can be discarded.
+ */
public boolean isDiscard() {
return this.conditionality.getEnum() == Constants.DISCARD;
}
- public int mvalue() {
- return this.length.getLength().mvalue();
+ /**
+ * Returns the computed length value.
+ * @return the length in millipoints
+ */
+ public int getLengthValue() {
+ return this.length.getLength().getValue();
}
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
-
/**
* This datatype hold a pair of resolved lengths,
* specifiying the dimensions in
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
-import org.apache.fop.fo.Property;
import org.apache.fop.fo.expr.Numeric;
/**
*/
protected void convert(double dvalue, String unit) {
- int assumed_resolution = 1; // points/pixel
+ int assumedResolution = 1; // points/pixel
if (unit.equals("in")) {
dvalue = dvalue * 72;
* dvalue = dvalue * fontsize;
*/
} else if (unit.equals("px")) {
- dvalue = dvalue * assumed_resolution;
+ dvalue = dvalue * assumedResolution;
} else {
dvalue = 0;
//log.error("unknown length unit '" + unit
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
private Property withinColumn;
private Property withinPage;
- public Keep() {}
+ public Keep() {
+ }
// From CompoundDatatype
public void setComponent(String sCmpnName, Property cmpnValue,
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
/**
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.expr.Numeric;
-import org.apache.fop.fo.Property;
/**
- * a length quantity in XSL
+ * A length quantity in XSL
*/
public class Length {
+ /** Holds the length in millipoints. */
protected int millipoints = 0;
+ /** Indicates if the value has been computed, or not. */
protected boolean bIsComputed = false;
/**
- * return the length in 1/1000ths of a point
+ * Returns the length in 1/1000ths of a point (millipoints)
+ * @return the length in millipoints
*/
- public int mvalue() {
+ public int getValue() {
if (!bIsComputed) {
computeValue();
}
return millipoints;
}
+ /**
+ * Computes the value.
+ */
protected void computeValue() {
}
+ /**
+ * Sets the computed value.
+ * @param millipoints the length in millipoints
+ */
protected void setComputedValue(int millipoints) {
setComputedValue(millipoints, true);
}
+ /**
+ * Sets the computed value.
+ * @param millipoints the length in millipoints
+ * @param bSetComputed True if the isComputed flag should be set.
+ */
protected void setComputedValue(int millipoints, boolean bSetComputed) {
this.millipoints = millipoints;
this.bIsComputed = bSetComputed;
}
+ /**
+ * Indicates if the length has the "auto" value.
+ * @return True if the length is set to "auto"
+ */
public boolean isAuto() {
return false;
}
+ /**
+ * Indicates if the length has been computed.
+ * @return True if the length has been computed
+ */
public boolean isComputed() {
return this.bIsComputed;
}
return null;
}
+ /**
+ * @see java.lang.Object#toString()
+ */
public String toString() {
String s = millipoints + "mpt";
return s;
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
public class LengthBase implements PercentBase {
public int getBaseLength() {
switch (iBaseType) {
case FONTSIZE:
- return propertyList.get("font-size").getLength().mvalue();
+ return propertyList.get("font-size").getLength().getValue();
case INH_FONTSIZE:
- return propertyList.getInherited("font-size").getLength().mvalue();
+ return propertyList.getInherited("font-size").getLength().getValue();
//case CONTAINING_BOX:
// depends on property?? inline-progression vs block-progression
//return parentFO.getContentWidth();
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
/**
* Set minimum value to min.
- * @param min A Length value specifying the minimum value for this
+ * @param minimum A Length value specifying the minimum value for this
* LengthRange.
* @param bIsDefault If true, this is set as a "default" value
* and not a user-specified explicit value.
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import java.util.Vector;
for (int i = 0; i < numFactors; ++i) {
result +=
(int)(((Double)factors.elementAt(i)).doubleValue()
- * (double)((Length)lengths.elementAt(i)).mvalue());
+ * (double)((Length)lengths.elementAt(i)).getValue());
}
setComputedValue(result);
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import java.util.Vector;
Enumeration e = lengths.elements();
while (e.hasMoreElements()) {
Length l = (Length) e.nextElement();
- computedValue += l.mvalue();
- if (! l.isComputed()) {
+ computedValue += l.getValue();
+ if (!l.isComputed()) {
bAllComputed = false;
}
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
public interface PercentBase {
- public int getDimension();
- public double getBaseValue();
- public int getBaseLength();
+ int getDimension();
+ double getBaseValue();
+ int getBaseLength();
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.expr.Numeric;
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.Property;
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
import org.apache.fop.fo.expr.Numeric;
/**
* Number of table-column proportional units
*/
- double tcolUnits;
+ private double tcolUnits;
/**
* Construct an object with tcolUnits of proportional measure.
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
/**
*/
public class ToBeImplemented {
- public ToBeImplemented(String value) {}
+ public ToBeImplemented(String value) {
+ }
}
/*
- * $Id$ --
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.datatypes;
-import org.apache.fop.fo.*;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.Property;
+import org.apache.fop.fo.PropertyList;
public class ToBeImplementedProperty extends Property {
/*
* $Id$
- * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo;
// Java
// NOTE: this is incomplete. font-size may be specified with
// various kinds of keywords too
- int fontSize = properties.get("font-size").getLength().mvalue();
+ int fontSize = properties.get("font-size").getLength().getValue();
//int fontVariant = properties.get("font-variant").getEnum();
String fname = fontInfo.fontLookup(fontFamily, fontStyle,
fontWeight);
// Common Margin Properties-Block
props.marginTop =
- this.properties.get("margin-top").getLength().mvalue();
+ this.properties.get("margin-top").getLength().getValue();
props.marginBottom =
- this.properties.get("margin-bottom").getLength().mvalue();
+ this.properties.get("margin-bottom").getLength().getValue();
props.marginLeft =
- this.properties.get("margin-left").getLength().mvalue();
+ this.properties.get("margin-left").getLength().getValue();
props.marginRight =
- this.properties.get("margin-right").getLength().mvalue();
+ this.properties.get("margin-right").getLength().getValue();
// For now, we only get the optimum value for space-before and after
props.spaceBefore = this.properties.get("space-before").
- getSpace().getOptimum().getLength().mvalue();
+ getSpace().getOptimum().getLength().getValue();
props.spaceAfter = this.properties.get("space-after").
- getSpace().getOptimum().getLength().mvalue();
+ getSpace().getOptimum().getLength().getValue();
props.startIndent = this.properties.get("start-indent").
- getLength().mvalue();
+ getLength().getValue();
props.endIndent = this.properties.get("end-indent").
- getLength().mvalue();
+ getLength().getValue();
return props;
}
AbsolutePositionProps props = new AbsolutePositionProps();
props.absolutePosition =
this.properties.get("absolute-position").getEnum();
- props.top = this.properties.get("top").getLength().mvalue();
- props.bottom = this.properties.get("bottom").getLength().mvalue();
- props.left = this.properties.get("left").getLength().mvalue();
- props.right = this.properties.get("right").getLength().mvalue();
+ props.top = this.properties.get("top").getLength().getValue();
+ props.bottom = this.properties.get("bottom").getLength().getValue();
+ props.left = this.properties.get("left").getLength().getValue();
+ props.right = this.properties.get("right").getLength().getValue();
return props;
}
*/
public BlockProps getBlockProps() {
BlockProps props = new BlockProps();
- props.firstIndent = this.properties.get("text-indent").getLength().mvalue();
+ props.firstIndent = this.properties.get("text-indent").getLength().getValue();
props.lastIndent = 0;
/*this.properties.get("last-line-end-indent").getLength().mvalue(); */
props.textAlign = this.properties.get("text-align").getEnum();
properties.get("white-space-collapse").getEnum();
textInfo.lineHeight = this.properties.get(
- "line-height").getLength().mvalue();
+ "line-height").getLength().getValue();
}
return textInfo;
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.expr;
import java.util.Vector;
-import org.apache.fop.fo.Property;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.FixedLength;
import org.apache.fop.datatypes.PercentLength;
-import org.apache.fop.datatypes.LinearCombinationLength;
import org.apache.fop.datatypes.MixedLength;
import org.apache.fop.datatypes.TableColLength;
import org.apache.fop.datatypes.PercentBase;
* @param l The Length.
*/
public Numeric(FixedLength l) {
- this(ABS_LENGTH, (double)l.mvalue(), 0.0, 0.0, 1, null);
+ this(ABS_LENGTH, (double)l.getValue(), 0.0, 0.0, 1, null);
}
/**
double opval = op.absValue;
return new Numeric(valType, opval * absValue, opval * pcValue,
opval * tcolValue, dim, pcBase);
- } else if (valType == op.valType &&!isMixedType()) {
+ } else if (valType == op.valType && !isMixedType()) {
// Check same relbase and pcbase ???
PercentBase npcBase = ((valType & PC_LENGTH) != 0) ? pcBase
: op.pcBase;
double opval = op.absValue;
return new Numeric(valType, absValue / opval, pcValue / opval,
tcolValue / opval, dim, pcBase);
- } else if (valType == op.valType &&!isMixedType()) {
+ } else if (valType == op.valType && !isMixedType()) {
PercentBase npcBase = ((valType & PC_LENGTH) != 0) ? pcBase
: op.pcBase;
return new Numeric(valType,
public Numeric max(Numeric op) throws PropertyException {
double rslt = 0.0;
// Only compare if have same dimension and value type!
- if (dim == op.dim && valType == op.valType &&!isMixedType()) {
+ if (dim == op.dim && valType == op.valType && !isMixedType()) {
if (valType == ABS_LENGTH) {
rslt = absValue - op.absValue;
} else if (valType == PC_LENGTH) {
public Numeric min(Numeric op) throws PropertyException {
double rslt = 0.0;
// Only compare if have same dimension and value type!
- if (dim == op.dim && valType == op.valType &&!isMixedType()) {
+ if (dim == op.dim && valType == op.valType && !isMixedType()) {
if (valType == ABS_LENGTH) {
rslt = absValue - op.absValue;
} else if (valType == PC_LENGTH) {
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.expr;
import java.util.Stack;
* Return the current font-size value as base units (milli-points).
*/
public int currentFontSize() {
- return plist.get("font-size").getLength().mvalue();
+ return plist.get("font-size").getLength().getValue();
}
public FObj getFO() {
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.datatypes.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.CharIterator;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.RecursiveCharIterator;
+import org.apache.fop.fo.TextInfo;
+import org.apache.fop.fo.properties.Constants;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.HyphenationProps;
+import org.apache.fop.layout.MarginProps;
+import org.apache.fop.layout.RelativePositionProps;
import org.apache.fop.layoutmgr.BlockLayoutManager;
import org.apache.fop.util.CharUtilities;
this.properties.get("text-align-last").getEnum();
this.breakAfter = this.properties.get("break-after").getEnum();
this.lineHeight = this.properties.get(
- "line-height").getLength().mvalue();
+ "line-height").getLength().getValue();
this.startIndent = this.properties.get(
- "start-indent").getLength().mvalue();
+ "start-indent").getLength().getValue();
this.endIndent = this.properties.get(
- "end-indent").getLength().mvalue();
+ "end-indent").getLength().getValue();
this.spaceBefore = this.properties.get(
- "space-before.optimum").getLength().mvalue();
+ "space-before.optimum").getLength().getValue();
this.spaceAfter = this.properties.get(
- "space-after.optimum").getLength().mvalue();
+ "space-after.optimum").getLength().getValue();
this.textIndent = this.properties.get(
- "text-indent").getLength().mvalue();
+ "text-indent").getLength().getValue();
this.keepWithNext =
this.properties.get("keep-with-next").getEnum();
bIgnore = lfCheck.nextIsLF();
break;
case Constants.IGNORE_IF_SURROUNDING_LINEFEED:
- bIgnore = (bPrevWasLF ||
- lfCheck.nextIsLF());
+ bIgnore = (bPrevWasLF
+ || lfCheck.nextIsLF());
break;
case Constants.IGNORE_IF_AFTER_LINEFEED:
bIgnore = bPrevWasLF;
if (bIgnore) {
charIter.remove();
} else if (bWScollapse) {
- if (bInWS || (lfTreatment ==
- Constants.PRESERVE &&
- (bPrevWasLF || lfCheck.nextIsLF()))) {
+ if (bInWS || (lfTreatment == Constants.PRESERVE
+ && (bPrevWasLF || lfCheck.nextIsLF()))) {
charIter.remove();
} else {
bInWS = true;
if (c == '\n') {
bNextIsLF = true;
break;
- } else if (CharUtilities.classOf(c) !=
- CharUtilities.XMLWHITESPACE) {
+ } else if (CharUtilities.classOf(c)
+ != CharUtilities.XMLWHITESPACE) {
break;
}
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.layout.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.*;
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.layout.AbsolutePositionProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.MarginProps;
import org.apache.fop.layoutmgr.BlockContainerLayoutManager;
import org.xml.sax.Attributes;
this.backgroundColor =
this.properties.get("background-color").getColorType();
- this.width = this.properties.get("width").getLength().mvalue();
- this.height = this.properties.get("height").getLength().mvalue();
+ this.width = this.properties.get("width").getLength().getValue();
+ this.height = this.properties.get("height").getLength().getValue();
span = this.properties.get("span").getEnum();
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
// FOP
// assume lr-tb for now
Length ipd = properties.get("inline-progression-dimension.optimum").getLength();
if (!ipd.isAuto()) {
- viewWidth = ipd.mvalue();
+ viewWidth = ipd.getValue();
} else {
ipd = properties.get("width").getLength();
if (!ipd.isAuto()) {
- viewWidth = ipd.mvalue();
+ viewWidth = ipd.getValue();
}
}
Length bpd = properties.get("block-progression-dimension.optimum").getLength();
if (!bpd.isAuto()) {
- viewHeight = bpd.mvalue();
+ viewHeight = bpd.getValue();
} else {
bpd = properties.get("height").getLength();
if (!bpd.isAuto()) {
- viewHeight = bpd.mvalue();
+ viewHeight = bpd.getValue();
}
}
cheight = viewHeight;
}
} else {*/
- cheight = ch.mvalue();
+ cheight = ch.getValue();
}
Length cw = properties.get("content-width").getLength();
if (!cw.isAuto()) {
cwidth = viewWidth;
}
} else {*/
- cwidth = cw.mvalue();
+ cwidth = cw.getValue();
}
int scaling = properties.get("scaling").getEnum();
/*
* $Id$
- * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
// FOP
int ipd = -1;
boolean bpdauto = false;
if (hasLH) {
- bpd = properties.get("line-height").getLength().mvalue();
+ bpd = properties.get("line-height").getLength().getValue();
} else {
// this property does not apply when the line-height applies
// isn't the block-progression-dimension always in the same
// direction as the line height?
len = properties.get("block-progression-dimension.optimum").getLength();
if (!len.isAuto()) {
- bpd = len.mvalue();
+ bpd = len.getValue();
} else {
len = properties.get("height").getLength();
- if(!len.isAuto()) {
- bpd = len.mvalue();
+ if (!len.isAuto()) {
+ bpd = len.getValue();
}
}
}
len = properties.get("inline-progression-dimension.optimum").getLength();
if (!len.isAuto()) {
- ipd = len.mvalue();
+ ipd = len.getValue();
} else {
len = properties.get("width").getLength();
if (!len.isAuto()) {
- ipd = len.mvalue();
+ ipd = len.getValue();
}
}
cwidth = ipd;
}
} else {*/
- cwidth = len.mvalue();
+ cwidth = len.getValue();
}
len = properties.get("content-height").getLength();
if (!len.isAuto()) {
cwidth = bpd;
}
} else {*/
- cheight = len.mvalue();
+ cheight = len.getValue();
}
- Point2D csize = new Point2D.Float(cwidth == -1 ? -1 : cwidth / 1000f, cheight == -1 ? -1 : cheight / 1000f);
+ Point2D csize = new Point2D.Float(cwidth == -1 ? -1 : cwidth / 1000f,
+ cheight == -1 ? -1 : cheight / 1000f);
Point2D size = child.getDimension(csize);
if (size == null) {
// error
// adjust the larger
double rat1 = cwidth / (size.getX() * 1000f);
double rat2 = cheight / (size.getY() * 1000f);
- if(rat1 < rat2) {
+ if (rat1 < rat2) {
// reduce cheight
cheight = (int)(rat1 * size.getY() * 1000);
} else {
boolean clip = false;
if (cwidth > ipd || cheight > bpd) {
int overflow = properties.get("overflow").getEnum();
- if(overflow == Overflow.HIDDEN) {
+ if (overflow == Overflow.HIDDEN) {
clip = true;
- } else if(overflow == Overflow.ERROR_IF_OVERFLOW) {
+ } else if (overflow == Overflow.ERROR_IF_OVERFLOW) {
getLogger().error("Instream foreign object overflows the viewport: clipping");
clip = true;
}
int da = properties.get("display-align").getEnum();
switch (da) {
case DisplayAlign.BEFORE:
- break;
+ break;
case DisplayAlign.AFTER:
yoffset = bpd - cheight;
- break;
+ break;
case DisplayAlign.CENTER:
yoffset = (bpd - cheight) / 2;
- break;
+ break;
case DisplayAlign.AUTO:
default:
- break;
+ break;
}
int ta = properties.get("text-align").getEnum();
switch (ta) {
case TextAlign.CENTER:
xoffset = (ipd - cwidth) / 2;
- break;
+ break;
case TextAlign.END:
xoffset = ipd - cwidth;
- break;
+ break;
case TextAlign.START:
- break;
+ break;
case TextAlign.JUSTIFY:
default:
- break;
+ break;
}
Rectangle2D placement = new Rectangle2D.Float(xoffset, yoffset, cwidth, cheight);
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
-// FOP
+// Java
import java.util.List;
+// FOP
import org.apache.fop.apps.StructureHandler;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.FilledArea;
}
protected InlineArea getInlineArea() {
- if(leaderArea == null) {
+ if (leaderArea == null) {
createLeaderArea();
}
return leaderArea;
protected void createLeaderArea() {
setup();
- if(leaderPattern == LeaderPattern.RULE) {
+ if (leaderPattern == LeaderPattern.RULE) {
org.apache.fop.area.inline.Leader leader = new org.apache.fop.area.inline.Leader();
leader.setRuleStyle(ruleStyle);
leaderArea = leader;
} else if (leaderPattern == LeaderPattern.SPACE) {
leaderArea = new Space();
- } else if(leaderPattern == LeaderPattern.DOTS) {
+ } else if (leaderPattern == LeaderPattern.DOTS) {
Word w = new Word();
char dot = '.'; // userAgent.getLeaderDotCharacter();
w.setOffset(fontState.getAscender());
int width = CharUtilities.getCharWidth(dot, fontState);
Space spacer = null;
- if(patternWidth > width) {
+ if (patternWidth > width) {
spacer = new Space();
spacer.setWidth(patternWidth - width);
width = patternWidth;
FilledArea fa = new FilledArea();
fa.setUnitWidth(width);
fa.addChild(w);
- if(spacer != null) {
+ if (spacer != null) {
fa.addChild(spacer);
}
fa.setHeight(fontState.getAscender());
leaderArea = fa;
- } else if(leaderPattern == LeaderPattern.USECONTENT) {
+ } else if (leaderPattern == LeaderPattern.USECONTENT) {
if (children == null) {
getLogger().error("Leader use-content with no content");
return;
clm.fillArea(lm);
int width = clm.getStackingSize();
Space spacer = null;
- if(patternWidth > width) {
+ if (patternWidth > width) {
spacer = new Space();
spacer.setWidth(patternWidth - width);
width = patternWidth;
}
fa.setUnitWidth(width);
- if(spacer != null) {
+ if (spacer != null) {
fa.addChild(spacer);
}
leaderArea = fa;
// color properties
ColorType c = this.properties.get("color").getColorType();
- float red = c.red();
- float green = c.green();
- float blue = c.blue();
+ float red = c.getRed();
+ float green = c.getGreen();
+ float blue = c.getBlue();
// fo:leader specific properties
// determines the pattern of leader; allowed values: space, rule,dots, use-content
// the following properties only apply
// for leader-pattern = "rule"
ruleThickness =
- properties.get("rule-thickness").getLength().mvalue();
+ properties.get("rule-thickness").getLength().getValue();
ruleStyle = properties.get("rule-style").getEnum();
break;
case LeaderPattern.DOTS:
// if leaderPatternWidth = 0 = default = use-font-metric
patternWidth =
- this.properties.get("leader-pattern-width").getLength().mvalue();
+ this.properties.get("leader-pattern-width").getLength().getValue();
}
protected int getLength(String prop, int dim) {
int length;
Length maxlength = properties.get(prop).getLength();
- if(maxlength instanceof PercentLength) {
+ if (maxlength instanceof PercentLength) {
length = (int)(((PercentLength)maxlength).value()
* dim);
} else {
- length = maxlength.mvalue();
+ length = maxlength.getValue();
}
return length;
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
+// Java
+import java.util.List;
+
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.datatypes.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.layout.FontState;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.MarginProps;
+import org.apache.fop.layout.RelativePositionProps;
import org.apache.fop.layoutmgr.list.ListBlockLayoutManager;
-// Java
-import java.util.Iterator;
-import java.util.List;
-
public class ListBlock extends FObj {
int align;
this.align = this.properties.get("text-align").getEnum();
this.alignLast = this.properties.get("text-align-last").getEnum();
this.lineHeight =
- this.properties.get("line-height").getLength().mvalue();
+ this.properties.get("line-height").getLength().getValue();
this.startIndent =
- this.properties.get("start-indent").getLength().mvalue();
+ this.properties.get("start-indent").getLength().getValue();
this.endIndent =
- this.properties.get("end-indent").getLength().mvalue();
+ this.properties.get("end-indent").getLength().getValue();
this.spaceBefore =
- this.properties.get("space-before.optimum").getLength().mvalue();
+ this.properties.get("space-before.optimum").getLength().getValue();
this.spaceAfter =
- this.properties.get("space-after.optimum").getLength().mvalue();
+ this.properties.get("space-after.optimum").getLength().getValue();
this.spaceBetweenListRows = 0; // not used at present
this.backgroundColor =
this.properties.get("background-color").getColorType();
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
-// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.layout.FontState;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.layoutmgr.list.ListItemLayoutManager;
-
// Java
-import java.util.Iterator;
import java.util.List;
+// FOP
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.MarginProps;
+import org.apache.fop.layout.RelativePositionProps;
+import org.apache.fop.layoutmgr.list.ListItemLayoutManager;
+
public class ListItem extends FObj {
ListItemLabel label = null;
ListItemBody body = null;
}
public void addLayoutManager(List list) {
- if(label != null && body != null) {
+ if (label != null && body != null) {
ListItemLayoutManager blm = new ListItemLayoutManager();
blm.setUserAgent(getUserAgent());
blm.setFObj(this);
this.align = this.properties.get("text-align").getEnum();
this.alignLast = this.properties.get("text-align-last").getEnum();
this.lineHeight =
- this.properties.get("line-height").getLength().mvalue();
+ this.properties.get("line-height").getLength().getValue();
this.spaceBefore =
- this.properties.get("space-before.optimum").getLength().mvalue();
+ this.properties.get("space-before.optimum").getLength().getValue();
this.spaceAfter =
- this.properties.get("space-after.optimum").getLength().mvalue();
+ this.properties.get("space-after.optimum").getLength().getValue();
}
label = (ListItemLabel)child;
} else if ("fo:list-item-body".equals(child.getName())) {
body = (ListItemBody)child;
- } else if("fo:marker".equals(child.getName())) {
+ } else if ("fo:marker".equals(child.getName())) {
// marker
} else {
// error
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
+// Java
+import java.util.List;
+
// FOP
-import org.apache.fop.fo.*;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.layout.FontState;
-import org.apache.fop.datatypes.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.apps.FOPException;
+import org.apache.fop.layout.MarginInlineProps;
+import org.apache.fop.layout.RelativePositionProps;
+import org.apache.fop.layout.TextState;
import org.apache.fop.util.CharUtilities;
import org.apache.fop.apps.StructureHandler;
import org.apache.fop.layoutmgr.LayoutContext;
import org.apache.fop.area.inline.InlineArea;
import org.apache.fop.area.inline.Word;
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
import org.apache.fop.area.Trait;
-// Java
-import java.util.List;
-
public class PageNumber extends FObj {
protected FontInfo fontInfo = null;
protected FontState fontState;
- float red;
- float green;
- float blue;
- int wrapOption;
- int whiteSpaceCollapse;
- TextState ts;
+ private float red;
+ private float green;
+ private float blue;
+ private int wrapOption;
+ private int whiteSpaceCollapse;
+ private TextState ts;
public PageNumber(FONode parent) {
super(parent);
}
inline.setWord(str);
inline.setIPD(width);
- inline.setHeight(fontState.getAscender() -
- fontState.getDescender());
+ inline.setHeight(fontState.getAscender()
+ - fontState.getDescender());
inline.setOffset(fontState.getAscender());
inline.addTrait(Trait.FONT_NAME,
// this.properties.get("word-spacing");
ColorType c = this.properties.get("color").getColorType();
- this.red = c.red();
- this.green = c.green();
- this.blue = c.blue();
+ this.red = c.getRed();
+ this.green = c.getGreen();
+ this.blue = c.getBlue();
this.wrapOption = this.properties.get("wrap-option").getEnum();
this.whiteSpaceCollapse =
- this.properties.get("white-space-collapse").getEnum();
+ this.properties.get("white-space-collapse").getEnum();
ts = new TextState();
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
-// FOP
+// Java
import java.util.List;
+// FOP
import org.apache.fop.apps.StructureHandler;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Resolveable;
protected FontInfo fontInfo = null;
protected FontState fontState;
- float red;
- float green;
- float blue;
- int wrapOption;
- int whiteSpaceCollapse;
- String pageNumber;
- String refId;
- TextState ts;
- InlineArea inline = null;
- boolean unresolved = false;
+ private float red;
+ private float green;
+ private float blue;
+ private int wrapOption;
+ private int whiteSpaceCollapse;
+ private String pageNumber;
+ private String refId;
+ private TextState ts;
+ private InlineArea inline = null;
+ private boolean unresolved = false;
public PageNumberCitation(FONode parent) {
super(parent);
int width = getStringWidth(str);
word.setWord(str);
inline.setIPD(width);
- inline.setHeight(fontState.getAscender() -
- fontState.getDescender());
+ inline.setHeight(fontState.getAscender()
+ - fontState.getDescender());
inline.setOffset(fontState.getAscender());
inline.addTrait(Trait.FONT_NAME, fontState.getFontName());
String str = "MMM"; // reserve three spaces for page number
int width = getStringWidth(str);
inline.setIPD(width);
- inline.setHeight(fontState.getAscender() -
- fontState.getDescender());
+ inline.setHeight(fontState.getAscender()
+ - fontState.getDescender());
inline.setOffset(fontState.getAscender());
inline.addTrait(Trait.FONT_NAME, fontState.getFontName());
// this.properties.get("word-spacing");
ColorType c = this.properties.get("color").getColorType();
- this.red = c.red();
- this.green = c.green();
- this.blue = c.blue();
+ this.red = c.getRed();
+ this.green = c.getGreen();
+ this.blue = c.getBlue();
this.wrapOption = this.properties.get("wrap-option").getEnum();
this.whiteSpaceCollapse =
/*
- * -- $Id$ --
- * 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.
- */
-
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
-// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.datatypes.*;
-import org.apache.fop.apps.FOPException;
-
-import org.apache.fop.layoutmgr.table.TableLayoutManager;
-
// Java
import java.util.ArrayList;
import java.util.List;
-import java.util.Iterator;
+
+// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.LengthRange;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.TableLayout;
+import org.apache.fop.fo.properties.TableOmitFooterAtBreak;
+import org.apache.fop.fo.properties.TableOmitHeaderAtBreak;
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.MarginProps;
+import org.apache.fop.layout.RelativePositionProps;
+import org.apache.fop.layoutmgr.table.TableLayoutManager;
public class Table extends FObj {
private static final int MINCOLWIDTH = 10000; // 10pt
protected ArrayList columns = null;
- TableBody tableHeader = null;
- TableBody tableFooter = null;
- boolean omitHeaderAtBreak = false;
- boolean omitFooterAtBreak = false;
-
- int breakBefore;
- int breakAfter;
- int spaceBefore;
- int spaceAfter;
- ColorType backgroundColor;
- LengthRange ipd;
- int height;
+ private TableBody tableHeader = null;
+ private TableBody tableFooter = null;
+ private boolean omitHeaderAtBreak = false;
+ private boolean omitFooterAtBreak = false;
+
+ private int breakBefore;
+ private int breakAfter;
+ private int spaceBefore;
+ private int spaceAfter;
+ private ColorType backgroundColor;
+ private LengthRange ipd;
+ private int height;
private boolean bAutoLayout = false;
private int contentWidth = 0; // Sum of column widths
}
protected void addChild(FONode child) {
- if(child.getName().equals("fo:table-column")) {
- if(columns == null) {
+ if (child.getName().equals("fo:table-column")) {
+ if (columns == null) {
columns = new ArrayList();
}
columns.add(((TableColumn)child).getLayoutManager());
- } else if(child.getName().equals("fo:table-footer")) {
+ } else if (child.getName().equals("fo:table-footer")) {
tableFooter = (TableBody)child;
- } else if(child.getName().equals("fo:table-header")) {
+ } else if (child.getName().equals("fo:table-header")) {
tableHeader = (TableBody)child;
} else {
// add bodies
tlm.setUserAgent(getUserAgent());
tlm.setFObj(this);
tlm.setColumns(columns);
- if(tableHeader != null) {
+ if (tableHeader != null) {
tlm.setTableHeader(tableHeader.getLayoutManager());
}
- if(tableFooter != null) {
+ if (tableFooter != null) {
tlm.setTableFooter(tableFooter.getLayoutManager());
}
list.add(tlm);
// Common Relative Position Properties
RelativePositionProps mRelProps =
- propMgr.getRelativePositionProps();
+ propMgr.getRelativePositionProps();
// this.properties.get("block-progression-dimension");
// this.properties.get("border-after-precendence");
this.breakBefore = this.properties.get("break-before").getEnum();
this.breakAfter = this.properties.get("break-after").getEnum();
this.spaceBefore = this.properties.get(
- "space-before.optimum").getLength().mvalue();
+ "space-before.optimum").getLength().getValue();
this.spaceAfter = this.properties.get(
- "space-after.optimum").getLength().mvalue();
+ "space-after.optimum").getLength().getValue();
this.backgroundColor =
this.properties.get("background-color").getColorType();
this.ipd = this.properties.get(
- "inline-progression-dimension"). getLengthRange();
- this.height = this.properties.get("height").getLength().mvalue();
- this.bAutoLayout = (this.properties.get("table-layout").getEnum() ==
- TableLayout.AUTO);
+ "inline-progression-dimension").getLengthRange();
+ this.height = this.properties.get("height").getLength().getValue();
+ this.bAutoLayout = (this.properties.get(
+ "table-layout").getEnum() == TableLayout.AUTO);
this.omitHeaderAtBreak = this.properties.get(
- "table-omit-header-at-break").getEnum() ==
- TableOmitHeaderAtBreak.TRUE;
+ "table-omit-header-at-break").getEnum()
+ == TableOmitHeaderAtBreak.TRUE;
this.omitFooterAtBreak = this.properties.get(
- "table-omit-footer-at-break").getEnum() ==
- TableOmitFooterAtBreak.TRUE;
+ "table-omit-footer-at-break").getEnum()
+ == TableOmitFooterAtBreak.TRUE;
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
+// Java
+import java.util.List;
+
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.datatypes.*;
-import org.apache.fop.layout.*;
import org.apache.fop.apps.FOPException;
-
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.RelativePositionProps;
import org.apache.fop.layoutmgr.table.Body;
-// Java
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Iterator;
-
public class TableBody extends FObj {
- int spaceBefore;
- int spaceAfter;
- ColorType backgroundColor;
+ private int spaceBefore;
+ private int spaceAfter;
+ private ColorType backgroundColor;
public TableBody(FONode parent) {
super(parent);
setupID();
this.spaceBefore = this.properties.get(
- "space-before.optimum").getLength().mvalue();
+ "space-before.optimum").getLength().getValue();
this.spaceAfter = this.properties.get(
- "space-after.optimum").getLength().mvalue();
+ "space-after.optimum").getLength().getValue();
this.backgroundColor =
this.properties.get("background-color").getColorType();
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
+// Java
+import java.util.List;
+
+// XML
+import org.xml.sax.Attributes;
+
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.*;
-
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.BorderCollapse;
+import org.apache.fop.fo.properties.DisplayAlign;
+
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.RelativePositionProps;
import org.apache.fop.layoutmgr.table.Cell;
-import org.xml.sax.Attributes;
-
-import java.util.List;
public class TableCell extends FObj {
- // int spaceBefore;
- // int spaceAfter;
- ColorType backgroundColor;
+ // private int spaceBefore;
+ // private int spaceAfter;
+ private ColorType backgroundColor;
- int numColumnsSpanned;
- int numRowsSpanned;
- int iColNumber = -1; // uninitialized
+ private int numColumnsSpanned;
+ private int numRowsSpanned;
+ private int iColNumber = -1; // uninitialized
/**
* Offset of content rectangle in inline-progression-direction,
/* For collapsed border style */
protected int borderHeight = 0;
- /**
- * Minimum ontent height of cell.
- */
+ /** Minimum ontent height of cell. */
protected int minCellHeight = 0;
-
+ /** Height of cell */
protected int height = 0;
- protected int top; // Ypos of cell ???
+ /** Ypos of cell ??? */
+ protected int top;
protected int verticalAlign;
protected boolean bRelativeAlign = false;
// boolean setup = false;
- boolean bSepBorders = true;
+ private boolean bSepBorders = true;
/**
* Set to true if all content completely laid out.
*/
- boolean bDone = false;
+ private boolean bDone = false;
/**
* Border separation value in the block-progression dimension.
* Used in calculating cells height.
*/
- int m_borderSeparation = 0;
+ private int borderSeparation = 0;
public TableCell(FONode parent) {
super(parent);
list.add(clm);
}
- // Set position relative to table (set by body?)
+ /**
+ * Set position relative to table (set by body?)
+ */
public void setStartOffset(int offset) {
startOffset = offset;
}
return numRowsSpanned;
}
- public void doSetup() // throws FOPException
- {
+ public void doSetup() {
// Common Accessibility Properties
AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
}
this.minCellHeight =
- this.properties.get("height").getLength().mvalue();
+ this.properties.get("height").getLength().getValue();
}
/**
* border-separate should only be specified on the table object,
* but it inherits.
*/
- int iSep =
- properties.get("border-separation.inline-progression-direction").getLength().mvalue();
+ int iSep = properties.get(
+ "border-separation.inline-progression-direction").getLength().getValue();
this.startAdjust = iSep / 2 + bp.getBorderLeftWidth(false)
+ bp.getPaddingLeft(false);
/*
+ bp.getPaddingRight(false);
// bp.getBorderEndWidth(false) + bp.getPaddingEnd(false);
// Offset of content rectangle in the block-progression direction
- m_borderSeparation =
- properties.get("border-separation.block-progression-direction").getLength().mvalue();
- this.beforeOffset = m_borderSeparation / 2
+ borderSeparation = properties.get(
+ "border-separation.block-progression-direction").getLength().getValue();
+ this.beforeOffset = borderSeparation / 2
+ bp.getBorderTopWidth(false)
+ bp.getPaddingTop(false);
// bp.getBorderBeforeWidth(false) + bp.getPaddingBefore(false);
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.datatypes.*;
-
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.Property;
+
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.layoutmgr.LayoutManager;
import org.apache.fop.layoutmgr.table.Column;
-
public class TableColumn extends FObj {
- ColorType backgroundColor;
+ private ColorType backgroundColor;
- Length columnWidthPropVal;
- int columnWidth;
- int columnOffset;
- int numColumnsRepeated;
- int iColumnNumber;
+ private Length columnWidthPropVal;
+ private int columnWidth;
+ private int columnOffset;
+ private int numColumnsRepeated;
+ private int iColumnNumber;
- boolean setup = false;
+ private boolean setup = false;
public TableColumn(FONode parent) {
super(parent);
this.properties.get("background-color").getColorType();
Property prop = this.properties.get("column-width");
- if(prop != null) {
+ if (prop != null) {
columnWidthPropVal = properties.get("column-width").getLength();
// This won't include resolved table-units or % values yet.
- columnWidth = columnWidthPropVal.mvalue();
+ columnWidth = columnWidthPropVal.getValue();
} else {
columnWidth = 300000;
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.flow;
-// FOP
-import org.apache.fop.fo.*;
-import org.apache.fop.fo.properties.*;
-import org.apache.fop.datatypes.*;
-import org.apache.fop.layout.*;
-import org.apache.fop.apps.FOPException;
-
-import org.apache.fop.layoutmgr.table.Row;
-
// Java
-import java.util.ArrayList;
import java.util.List;
-import java.util.Iterator;
+
+// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.KeepValue;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.Property;
+import org.apache.fop.fo.properties.Constants;
+
+import org.apache.fop.layout.AccessibilityProps;
+import org.apache.fop.layout.AuralProps;
+import org.apache.fop.layout.BackgroundProps;
+import org.apache.fop.layout.BorderAndPadding;
+import org.apache.fop.layout.RelativePositionProps;
+import org.apache.fop.layoutmgr.table.Row;
public class TableRow extends FObj {
- boolean setup = false;
+ private boolean setup = false;
- int breakAfter;
- ColorType backgroundColor;
+ private int breakAfter;
+ private ColorType backgroundColor;
- KeepValue keepWithNext;
- KeepValue keepWithPrevious;
- KeepValue keepTogether;
+ private KeepValue keepWithNext;
+ private KeepValue keepWithPrevious;
+ private KeepValue keepTogether;
- int minHeight = 0; // force row height
+ private int minHeight = 0; // force row height
public TableRow(FONode parent) {
super(parent);
this.keepWithPrevious =
getKeepValue("keep-with-previous.within-column");
- this.minHeight = this.properties.get("height").getLength().mvalue();
+ this.minHeight = this.properties.get("height").getLength().getValue();
setup = true;
}
switch (p.getEnum()) {
case Constants.ALWAYS:
return new KeepValue(KeepValue.KEEP_WITH_ALWAYS, 0);
- // break;
case Constants.AUTO:
default:
return new KeepValue(KeepValue.KEEP_WITH_AUTO, 0);
- // break;
}
}
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.pagination;
// FOP
public void end() {
// The problem with this is that it might not be known yet....
// Supposing extent is calculated in terms of percentage
- this.extent = this.properties.get("extent").getLength().mvalue();
+ this.extent = this.properties.get("extent").getLength().getValue();
}
- int getExtent() {
+ public int getExtent() {
return this.extent;
}
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.pagination;
// Java
public class RegionBody extends Region {
- ColorType backgroundColor;
+ private ColorType backgroundColor;
public RegionBody(FONode parent) {
super(parent);
}
- protected Rectangle getViewportRectangle (FODimension reldims)
- {
+ protected Rectangle getViewportRectangle (FODimension reldims) {
/*
* Use space-before and space-after which will use corresponding
* absolute margin properties if specified. For indents:
MarginProps mProps = propMgr.getMarginProps();
int start = getRelMargin(PropertyList.START, "start-indent");
Rectangle vpRect;
- if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
- vpRect = new Rectangle( start, mProps.spaceBefore,
- reldims.ipd - start -
- getRelMargin(PropertyList.END, "end-indent"),
- reldims.bpd - mProps.spaceBefore -
- mProps.spaceAfter);
- else
- vpRect = new Rectangle( start, mProps.spaceBefore,
- reldims.bpd - mProps.spaceBefore -
- mProps.spaceAfter,
- reldims.ipd - start -
- getRelMargin(PropertyList.END, "end-indent")
- );
+ if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
+ vpRect = new Rectangle(start, mProps.spaceBefore,
+ reldims.ipd - start
+ - getRelMargin(PropertyList.END, "end-indent"),
+ reldims.bpd - mProps.spaceBefore - mProps.spaceAfter);
+ } else {
+ vpRect = new Rectangle(start, mProps.spaceBefore,
+ reldims.bpd - mProps.spaceBefore - mProps.spaceAfter,
+ reldims.ipd - start
+ - getRelMargin(PropertyList.END, "end-indent"));
+ }
return vpRect;
}
*/
private int getRelMargin(int reldir, String sRelPropName) {
FObj parent = (FObj) getParent();
- String sPropName = "margin-" +
- parent.properties.wmRelToAbs(reldir);
+ String sPropName = "margin-"
+ + parent.properties.wmRelToAbs(reldir);
Property prop = properties.getExplicitBaseProp(sPropName);
if (prop == null) {
prop = properties.getExplicitBaseProp(sRelPropName);
}
- return ((prop != null)? prop.getLength().mvalue() : 0);
+ return ((prop != null) ? prop.getLength().getValue() : 0);
}
protected String getDefaultRegionName() {
// Should set some column stuff here I think, or put it elsewhere
BodyRegion body = new BodyRegion();
setRegionPosition(body, absRegVPRect);
- int columnCount=
+ int columnCount =
this.properties.get("column-count").getNumber().intValue();
if ((columnCount > 1) && (overflow == Overflow.SCROLL)) {
// recover by setting 'column-count' to 1. This is allowed but
body.setColumnCount(columnCount);
int columnGap =
- this.properties.get("column-gap").getLength().mvalue();
+ this.properties.get("column-gap").getLength().getValue();
body.setColumnGap(columnGap);
return body;
}
/*
-* $Id$
-* 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.
-*/
-
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.fo.pagination;
+// Java
+import java.awt.Rectangle;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+// XML
+import org.xml.sax.Attributes;
+
// FOP
-import org.apache.fop.fo.*;
import org.apache.fop.area.CTM;
import org.apache.fop.datatypes.FODimension;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Page;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.apps.FOPException;
-import java.awt.Rectangle;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.xml.sax.Attributes;
-
/**
* A simple-page-master formatting object.
* This creates a simple page from the specified regions
/**
* Page regions (regionClass, Region)
*/
- private Map _regions;
+ private Map regions;
- PageMaster pageMaster;
- String masterName;
+ private PageMaster pageMaster;
+ private String masterName;
public SimplePageMaster(FONode parent) {
super(parent);
+ parent.getName());
}
//Well, there are only 5 regions so we can save a bit of memory here
- _regions = new HashMap(5);
+ regions = new HashMap(5);
}
/**
*/
protected void end() {
int pageWidth =
- this.properties.get("page-width").getLength().mvalue();
+ this.properties.get("page-width").getLength().getValue();
int pageHeight =
- this.properties.get("page-height").getLength().mvalue();
+ this.properties.get("page-height").getLength().getValue();
// this.properties.get("reference-orientation");
// this.properties.get("writing-mode");
// Set up the CTM on the page reference area based on writing-mode
// and reference-orientation
- FODimension reldims=new FODimension(0,0);
+ FODimension reldims = new FODimension(0, 0);
CTM pageCTM = propMgr.getCTMandRelDims(pageRefRect, reldims);
// Create a RegionViewport/ reference area pair for each page region
- boolean bHasBody=false;
+ boolean bHasBody = false;
- for (Iterator regenum = _regions.values().iterator();
- regenum.hasNext(); ) {
+ for (Iterator regenum = regions.values().iterator();
+ regenum.hasNext();) {
Region r = (Region)regenum.next();
RegionViewport rvp = r.makeRegionViewport(reldims, pageCTM);
rvp.setRegion(r.makeRegionReferenceArea(rvp.getViewArea()));
}
this.pageMaster = new PageMaster(new PageViewport(page,
- new Rectangle(0,0,
- pageWidth,pageHeight)));
+ new Rectangle(0, 0, pageWidth, pageHeight)));
- // _regions = null; // PageSequence access SimplePageMaster....
+ // regions = null; // PageSequence access SimplePageMaster....
children = null;
properties = null;
}
if (child instanceof Region) {
addRegion((Region)child);
} else {
- getLogger().error("SimplePageMaster cannot have child of type " +
- child.getName());
+ getLogger().error("SimplePageMaster cannot have child of type "
+ + child.getName());
}
}
protected void addRegion(Region region) {
String key = region.getRegionClass();
- if (_regions.containsKey(key)) {
+ if (regions.containsKey(key)) {
getLogger().error("Only one region of class "
+ key
+ " allowed within a simple-page-master.");
// + key
// + " allowed within a simple-page-master.");
} else {
- _regions.put(key, region);
+ regions.put(key, region);
}
}
public Region getRegion(String regionClass) {
- return (Region)_regions.get(regionClass);
+ return (Region)regions.get(regionClass);
}
protected Map getRegions() {
- return _regions;
+ return regions;
}
protected boolean regionNameExists(String regionName) {
- for (Iterator regenum = _regions.values().iterator();
- regenum.hasNext(); ) {
+ for (Iterator regenum = regions.values().iterator();
+ regenum.hasNext();) {
Region r = (Region)regenum.next();
if (r.getRegionName().equals(regionName)) {
return true;
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layout;
import org.apache.fop.datatypes.ColorType;
public static final int RIGHT = END;
private static class ResolvedCondLength implements Cloneable {
- int iLength; // Resolved length value
- boolean bDiscard;
+ private int iLength; // Resolved length value
+ private boolean bDiscard;
- ResolvedCondLength(CondLength length) {
+ public ResolvedCondLength(CondLength length) {
bDiscard = length.isDiscard();
- iLength = length.mvalue();
+ iLength = length.getLengthValue();
}
public Object clone() throws CloneNotSupportedException {
private BorderInfo[] borderInfo = new BorderInfo[4];
private ResolvedCondLength[] padding = new ResolvedCondLength[4];
- public BorderAndPadding() {}
+ public BorderAndPadding() {
+ }
public void setBorder(int side, int style, CondLength width,
ColorType color) {
public int getBorderWidth(int side, boolean bDiscard) {
- if ((borderInfo[side] == null) ||
- (borderInfo[side].mStyle == Constants.NONE) ||
- (bDiscard && borderInfo[side].mWidth.bDiscard)) {
+ if ((borderInfo[side] == null)
+ || (borderInfo[side].mStyle == Constants.NONE)
+ || (bDiscard && borderInfo[side].mWidth.bDiscard)) {
return 0;
} else {
return borderInfo[side].mWidth.iLength;
public ColorType getBorderColor(int side) {
if (borderInfo[side] != null) {
return borderInfo[side].mColor;
- } else
+ } else {
return null;
+ }
}
public int getBorderStyle(int side) {
if (borderInfo[side] != null) {
return borderInfo[side].mStyle;
- } else
+ } else {
return 0;
+ }
}
public int getPadding(int side, boolean bDiscard) {
- if ((padding[side] == null) ||
- (bDiscard && padding[side].bDiscard)) {
+ if ((padding[side] == null) || (bDiscard && padding[side].bDiscard)) {
return 0;
- } else
+ } else {
return padding[side].iLength;
+ }
}
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layoutmgr;
+import java.util.List;
+import java.awt.geom.Rectangle2D;
+
import org.apache.fop.area.Area;
import org.apache.fop.area.BlockViewport;
import org.apache.fop.area.Block;
import org.apache.fop.area.CTM;
import org.apache.fop.datatypes.FODimension;
-import java.util.ArrayList;
-import java.util.List;
-
-import java.awt.geom.Rectangle2D;
-
/**
* LayoutManager for a block FO.
*/
private BlockViewport viewportBlockArea;
private Block curBlockArea;
- List childBreaks = new ArrayList();
+ private List childBreaks = new java.util.ArrayList();
- AbsolutePositionProps abProps;
- FODimension relDims;
- CTM absoluteCTM;
- boolean clip = false;
- int overflow;
- PropertyManager propManager;
+ private AbsolutePositionProps abProps;
+ private FODimension relDims;
+ private CTM absoluteCTM;
+ private boolean clip = false;
+ private int overflow;
+ private PropertyManager propManager;
/**
* Create a new block container layout manager.
protected int getRotatedIPD() {
PropertyList props = propManager.getProperties();
- int height = props.get("height").getLength().mvalue();
- height = props.get("inline-progression-dimension.optimum").getLength().mvalue();
+ int height = props.get("height").getLength().getValue();
+ height = props.get("inline-progression-dimension.optimum").getLength().getValue();
return height;
}
/*
* $Id$
- * Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layoutmgr;
+import java.util.ListIterator;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.TextInfo;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.layout.BackgroundProps;
-import java.util.ListIterator;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* LayoutManager for a block FO.
*/
private Block curBlockArea;
- LayoutProps layoutProps;
- BorderAndPadding borderProps;
- BackgroundProps backgroundProps;
+ private LayoutProps layoutProps;
+ private BorderAndPadding borderProps;
+ private BackgroundProps backgroundProps;
- int lead = 12000;
- int lineHeight = 14000;
- int follow = 2000;
+ private int lead = 12000;
+ private int lineHeight = 14000;
+ private int follow = 2000;
- int iStartPos = 0;
+ private int iStartPos = 0;
- protected List childBreaks = new ArrayList();
+ protected List childBreaks = new java.util.ArrayList();
/**
* Iterator for Block layout.
while (proxy.hasNext()) {
LayoutProcessor lm = (LayoutProcessor) proxy.next();
lm.setParent(BlockLayoutManager.this);
- if(lm.generatesInlineAreas()) {
+ if (lm.generatesInlineAreas()) {
LineLayoutManager lineLM = createLineManager(lm);
listLMs.add(lineLM);
} else {
MinOptMax stackSize = new MinOptMax();
// if starting add space before
- stackSize.add(layoutProps.spaceBefore.space);
+ stackSize.add(layoutProps.spaceBefore.getSpace());
BreakPoss lastPos = null;
}
}
}
- if(getChildLM() == null || over) {
- if(getChildLM() == null) {
+ if (getChildLM() == null || over) {
+ if (getChildLM() == null) {
setFinished(true);
- stackSize.add(layoutProps.spaceAfter.space);
+ stackSize.add(layoutProps.spaceAfter.getSpace());
}
BreakPoss breakPoss = new BreakPoss(
new LeafPosition(this, childBreaks.size() - 1));
// if adjusted space before
double adjust = layoutContext.getSpaceAdjust();
- addBlockSpacing(adjust, layoutProps.spaceBefore.space);
+ addBlockSpacing(adjust, layoutProps.spaceBefore.getSpace());
addID();
addMarkers(true, true);
flush();
// if adjusted space after
- addBlockSpacing(adjust, layoutProps.spaceAfter.space);
+ addBlockSpacing(adjust, layoutProps.spaceAfter.getSpace());
curBlockArea = null;
}
/*
* $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layoutmgr;
+import java.util.Iterator;
+import java.util.ListIterator;
+import java.util.HashMap;
+
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.area.inline.InlineParent;
import org.apache.fop.area.inline.Space;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.HashMap;
-
/**
* LayoutManager for objects which stack children in the inline direction,
* such as Inline or Line
// Back up the child LM Position
Position childPos = prevPos.getPosition();
reset(childPos);
- if (prevBP != null &&
- prevBP.getLayoutManager() != childPos.getLM()) {
+ if (prevBP != null
+ && prevBP.getLayoutManager() != childPos.getLM()) {
childLC = null;
}
prevBP = new BreakPoss(childPos);
* propagate to first child LM
*/
public boolean canBreakBefore(LayoutContext context) {
- if (inlineProps.spaceStart.space.min > 0 ||
- hasLeadingFence(false)) {
+ if (inlineProps.spaceStart.getSpace().min > 0 || hasLeadingFence(false)) {
return true;
}
LayoutProcessor lm = getChildLM();
* and initialize pending space from previous LM sibling's
* trailing space specifiers.
*/
- boolean bFirstChildBP = (prevBP == null ||
- prevBP.getLayoutManager() != curLM);
+ boolean bFirstChildBP = (prevBP == null
+ || prevBP.getLayoutManager() != curLM);
initChildLC(childLC, prevBP, lc.startsNewArea(),
bFirstChildBP, leadingSpace);
childLC.setHyphContext(lc.getHyphContext());
}
- if (((bp = curLM.getNextBreakPoss(childLC)) != null) ||
- (lc.tryHyphenate() &&
- !lc.getHyphContext().hasMoreHyphPoints())) {
+ if (((bp = curLM.getNextBreakPoss(childLC)) != null)
+ || (lc.tryHyphenate()
+ && !lc.getHyphContext().hasMoreHyphPoints())) {
break;
}
// If LM has no content, should it generate any area? If not,
context.setTrailingSpace(getContext().getTrailingSpace());
}
// Add own trailing space to parent context (or set on area?)
- if(context.getTrailingSpace() != null) {
+ if (context.getTrailingSpace() != null) {
context.getTrailingSpace().addSpace(inlineProps.spaceEnd);
}
TraitSetter.setBorderPaddingTraits(getCurrentArea(),
borderProps, bAreaCreated, !bIsLast);
- if(borderProps != null) {
+ if (borderProps != null) {
TraitSetter.addBorders(getCurrentArea(), borderProps);
}
- if(backgroundProps != null) {
+ if (backgroundProps != null) {
TraitSetter.addBackground(getCurrentArea(), backgroundProps);
}
int iAdjust = spaceRange.opt;
if (dSpaceAdjust > 0.0) {
// Stretch by factor
- iAdjust += (int)((double)(spaceRange.max -
- spaceRange.opt) * dSpaceAdjust);
+ iAdjust += (int)((double)(spaceRange.max
+ - spaceRange.opt) * dSpaceAdjust);
} else if (dSpaceAdjust < 0.0) {
// Shrink by factor
- iAdjust += (int)((double)(spaceRange.opt -
- spaceRange.min) * dSpaceAdjust);
+ iAdjust += (int)((double)(spaceRange.opt
+ - spaceRange.min) * dSpaceAdjust);
}
if (iAdjust != 0) {
//getLogger().debug("Add leading space: " + iAdjust);
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layoutmgr;
import org.apache.fop.traits.SpaceVal;
private boolean bStartsRefArea;
private boolean bHasForcing = false;
- private List vecSpaceVals = new ArrayList();
+ private List vecSpaceVals = new java.util.ArrayList();
public SpaceSpecifier(boolean bStarts) {
* add it to the sequence.
*/
public void addSpace(SpaceVal moreSpace) {
- if (!bStartsRefArea || !moreSpace.bConditional ||
- !vecSpaceVals.isEmpty()) {
- if (moreSpace.bForcing) {
+ if (!bStartsRefArea
+ || !moreSpace.isConditional()
+ || !vecSpaceVals.isEmpty()) {
+ if (moreSpace.isForcing()) {
if (bHasForcing == false) {
// Remove all other values (must all be non-forcing)
vecSpaceVals.clear();
vecSpaceVals.add(moreSpace);
} else if (bHasForcing == false) {
// Don't bother adding all 0 space-specifier if not forcing
- if (moreSpace.space.min != 0 || moreSpace.space.opt != 0 ||
- moreSpace.space.max != 0) {
+ if (moreSpace.getSpace().min != 0
+ || moreSpace.getSpace().opt != 0
+ || moreSpace.getSpace().max != 0) {
vecSpaceVals.add(moreSpace);
}
}
for (; lastIndex > 0; --lastIndex) {
SpaceVal sval = (SpaceVal) vecSpaceVals.get(
lastIndex - 1);
- if (!sval.bConditional) {
+ if (!sval.isConditional()) {
break;
}
}
for (int index = 0; index < lastIndex; index++) {
SpaceVal sval = (SpaceVal) vecSpaceVals.get(index);
if (bHasForcing) {
- resSpace.add(sval.space);
- } else if (sval.iPrecedence > iMaxPrec) {
- iMaxPrec = sval.iPrecedence;
- resSpace = sval.space;
- } else if (sval.iPrecedence == iMaxPrec) {
- if (sval.space.opt > resSpace.opt) {
- resSpace = sval.space;
- } else if (sval.space.opt == resSpace.opt) {
- if (resSpace.min < sval.space.min) {
- resSpace.min = sval.space.min;
+ resSpace.add(sval.getSpace());
+ } else if (sval.getPrecedence() > iMaxPrec) {
+ iMaxPrec = sval.getPrecedence();
+ resSpace = sval.getSpace();
+ } else if (sval.getPrecedence() == iMaxPrec) {
+ if (sval.getSpace().opt > resSpace.opt) {
+ resSpace = sval.getSpace();
+ } else if (sval.getSpace().opt == resSpace.opt) {
+ if (resSpace.min < sval.getSpace().min) {
+ resSpace.min = sval.getSpace().min;
}
- if (resSpace.max > sval.space.max) {
- resSpace.max = sval.space.max;
+ if (resSpace.max > sval.getSpace().max) {
+ resSpace.max = sval.getSpace().max;
}
}
}
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.layoutmgr;
+import java.util.ArrayList;
+
import org.apache.fop.fo.TextInfo;
import org.apache.fop.traits.SpaceVal;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.Space;
import org.apache.fop.util.CharUtilities;
-import java.util.ArrayList;
-
/**
* LayoutManager for text (a sequence of characters) which generates one
* or more inline areas.
* Number of word-spaces?
*/
private class AreaInfo {
- short iStartIndex;
- short iBreakIndex;
- short iWScount;
- MinOptMax ipdArea;
- AreaInfo(short iSIndex, short iBIndex, short iWS,
+ private short iStartIndex;
+ private short iBreakIndex;
+ private short iWScount;
+ private MinOptMax ipdArea;
+ public AreaInfo(short iSIndex, short iBIndex, short iWS,
MinOptMax ipd) {
iStartIndex = iSIndex;
iBreakIndex = iBIndex;
private ArrayList vecAreaInfo;
/** Non-space characters on which we can end a line. */
- private static final String s_breakChars = "-/" ;
+ private static final String BREAK_CHARS = "-/" ;
private char[] chars;
private TextInfo textInfo;
/**
* Create a Text layout manager.
*
- * @param fobj the fo object that contains the text
* @param chars the characters
* @param textInfo the text information for doing layout
*/
public TextLayoutManager(char[] chars, TextInfo textInfo) {
this.chars = chars;
this.textInfo = textInfo;
- this.vecAreaInfo = new ArrayList();
+ this.vecAreaInfo = new java.util.ArrayList();
// With CID fonts, space isn't neccesary currentFontState.width(32)
spaceCharIPD = CharUtilities.getCharWidth(' ', textInfo.fs);
hyphIPD = CharUtilities.getCharWidth('-', textInfo.fs);
// Make half-space: <space> on either side of a word-space)
SpaceVal ws = textInfo.wordSpacing;
- halfWS = new SpaceVal(MinOptMax.multiply(ws.space, 0.5),
- ws.bConditional, ws.bForcing, ws.iPrecedence);
+ halfWS = new SpaceVal(MinOptMax.multiply(ws.getSpace(), 0.5),
+ ws.isConditional(), ws.isForcing(), ws.getPrecedence());
}
/**
(AreaInfo) vecAreaInfo.get(endPos.getLeafPos());
// Skip all leading spaces for hyphenation
int i;
- for (i = ai.iStartIndex; i < ai.iBreakIndex &&
- CharUtilities.isAnySpace(chars[i]) == true ; i++)
- ;
+ for (i = ai.iStartIndex;
+ i < ai.iBreakIndex && CharUtilities.isAnySpace(chars[i]) == true;
+ i++) {
+ //nop
+ }
sbChars.append(new String(chars, i, ai.iBreakIndex - i));
}
*/
public boolean canBreakBefore(LayoutContext context) {
char c = chars[iNextStart];
- return ((c == NEWLINE) || (textInfo.bWrap &&
- (CharUtilities.isSpace(c) ||
- s_breakChars.indexOf(c) >= 0)));
+ return ((c == NEWLINE)
+ || (textInfo.bWrap && (CharUtilities.isSpace(c)
+ || BREAK_CHARS.indexOf(c) >= 0)));
}
/**
for (; iNextStart < chars.length; iNextStart++) {
char c = chars[iNextStart];
- if (CharUtilities.isAnySpace(c) == false)
+ if (CharUtilities.isAnySpace(c) == false) {
break;
+ }
if (c == SPACE || c == NBSPACE) {
++iWScount;
// Counted as word-space
- if (iNextStart == iThisStart &&
- (iFlags & BreakPoss.ISFIRST) != 0) {
+ if (iNextStart == iThisStart
+ && (iFlags & BreakPoss.ISFIRST) != 0) {
// If possible, treat as normal inter-word space
if (context.getLeadingSpace().hasSpaces()) {
context.getLeadingSpace().addSpace(halfWS);
} else {
// Doesn't combine with any other leading spaces
// from ancestors
- spaceIPD.add(halfWS.space);
+ spaceIPD.add(halfWS.getSpace());
}
} else {
pendingSpace.addSpace(halfWS);
// Get the size of the next syallable
MinOptMax hyphIPD = new MinOptMax(0);
if (getHyphenIPD(context.getHyphContext(), hyphIPD)) {
- iFlags |= (BreakPoss.CAN_BREAK_AFTER |
- BreakPoss.HYPHENATED);
+ iFlags |= (BreakPoss.CAN_BREAK_AFTER | BreakPoss.HYPHENATED);
}
wordIPD += hyphIPD.opt;
} else {
char c = chars[iNextStart];
if ((c == NEWLINE) || // Include any breakable white-space as break char
// even if fixed width
- (textInfo.bWrap && (CharUtilities.isSpace(c) ||
- s_breakChars.indexOf(c) >= 0))) {
+ (textInfo.bWrap && (CharUtilities.isSpace(c)
+ || BREAK_CHARS.indexOf(c) >= 0))) {
iFlags |= BreakPoss.CAN_BREAK_AFTER;
if (c != SPACE) {
iNextStart++;
// line-end, set a flag for parent LM.
int iLastChar;
for (iLastChar = iNextStart;
- iLastChar < chars.length &&
- chars[iLastChar] == SPACE; iLastChar++)
- ;
+ iLastChar < chars.length
+ && chars[iLastChar] == SPACE; iLastChar++) {
+ //nop
+ }
if (iLastChar == chars.length) {
iFlags |= BreakPoss.REST_ARE_SUPPRESS_AT_LB;
}
* an area containing all text with a parameter controlling the size of
* the word space. The latter is most efficient for PDF generation.
* Set size of each area.
- * @param parentIter Iterator over Position information returned
+ * @param posIter Iterator over Position information returned
* by this LayoutManager.
- * @param dSpaceAdjust Factor controlling how much extra space to add
- * in order to justify the line.
+ * @param context LayoutContext for adjustments
*/
public void addAreas(PositionIterator posIter, LayoutContext context) {
// Add word areas
}
iWScount += ai.iWScount;
}
- if(ai == null) {
+ if (ai == null) {
return;
}
// Calculate total adjustment
// Stretch by factor
// System.err.println("Potential stretch = " +
// (ai.ipdArea.max - ai.ipdArea.opt));
- iAdjust = (int)((double)(ai.ipdArea.max -
- ai.ipdArea.opt) * dSpaceAdjust);
+ iAdjust = (int)((double)(ai.ipdArea.max
+ - ai.ipdArea.opt) * dSpaceAdjust);
} else if (dSpaceAdjust < 0.0) {
// Shrink by factor
// System.err.println("Potential shrink = " +
// (ai.ipdArea.opt - ai.ipdArea.min));
- iAdjust = (int)((double)(ai.ipdArea.opt -
- ai.ipdArea.min) * dSpaceAdjust);
+ iAdjust = (int)((double)(ai.ipdArea.opt
+ - ai.ipdArea.min) * dSpaceAdjust);
}
// System.err.println("Text adjustment factor = " + dSpaceAdjust +
// " total=" + iAdjust);
InlineArea word = null;
int adjust = 0;
// ingnore newline character
- if(chars[ai.iBreakIndex - 1] == NEWLINE) {
+ if (chars[ai.iBreakIndex - 1] == NEWLINE) {
adjust = 1;
}
String str = new String(chars, iStart, ai.iBreakIndex - iStart - adjust);
- if(" ".equals(str)) {
+ if (" ".equals(str)) {
word = new Space();
word.setWidth(ai.ipdArea.opt + iAdjust);
} else {
}
word = w;
}
- if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE) &&
- context.getLeadingSpace().hasSpaces()) {
+ if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE)
+ && context.getLeadingSpace().hasSpaces()) {
context.getLeadingSpace().addSpace(halfWS);
}
// Set LAST flag if done making characters
int iLastChar;
for (iLastChar = ai.iBreakIndex;
iLastChar < chars.length && chars[iLastChar] == SPACE;
- iLastChar++)
- ;
+ iLastChar++) {
+ //nop
+ }
context.setFlags(LayoutContext.LAST_AREA,
iLastChar == chars.length);
// Can we have any trailing space? Yes, if last char was a space!
context.setTrailingSpace(new SpaceSpecifier(false));
- if (chars[ai.iBreakIndex - 1] == SPACE ||
- chars[ai.iBreakIndex - 1] == NBSPACE) {
+ if (chars[ai.iBreakIndex - 1] == SPACE
+ || chars[ai.iBreakIndex - 1] == NBSPACE) {
context.getTrailingSpace().addSpace(halfWS);
}
- if(word != null) {
+ if (word != null) {
parentLM.addChild(word);
}
}
protected Word createWord(String str, int width, int base) {
Word curWordArea = new Word();
curWordArea.setWidth(width);
- curWordArea.setHeight(textInfo.fs.getAscender() -
- textInfo.fs.getDescender());
+ curWordArea.setHeight(textInfo.fs.getAscender()
+ - textInfo.fs.getDescender());
curWordArea.setOffset(textInfo.fs.getAscender());
curWordArea.setOffset(base);
back.setURL(backProps.backImage);
back.setRepeat(backProps.backRepeat);
if (backProps.backPosHorizontal != null) {
- back.setHoriz(backProps.backPosHorizontal.mvalue());
+ back.setHoriz(backProps.backPosHorizontal.getValue());
}
if (backProps.backPosVertical != null) {
- back.setVertical(backProps.backPosVertical.mvalue());
+ back.setVertical(backProps.backPosVertical.getValue());
}
}
}
private void updateColor(ColorType col, boolean fill, StringBuffer pdf) {
- Color newCol = new Color(col.red(), col.green(), col.blue());
+ Color newCol = new Color(col.getRed(), col.getGreen(), col.getBlue());
boolean update = false;
if (fill) {
update = currentState.setBackColor(newCol);
}
if (update) {
- PDFColor color = new PDFColor((double)col.red(),
- (double)col.green(),
- (double)col.blue());
+ PDFColor color = new PDFColor((double)col.getRed(),
+ (double)col.getGreen(),
+ (double)col.getBlue());
closeText();
/*
* $Id$
- * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
- * For details on use and redistribution please refer to the
- * LICENSE file included with these sources.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.render.ps;
// Java
}
private void useColor(ColorType col) {
- useColor(col.red(), col.green(), col.blue());
+ useColor(col.getRed(), col.getGreen(), col.getBlue());
}
private void useColor(float red, float green, float blue) {
renderDocument(doc, ns, pos);
}
+ /**
+ * Renders an XML document (SVG for example).
+ * @param doc DOM Document containing the XML document to be rendered
+ * @param ns Namespace for the XML document
+ * @param pos Position for the generated graphic/image
+ */
public void renderDocument(Document doc, String ns, Rectangle2D pos) {
RendererContext context;
context = new RendererContext(MIME_TYPE);
/*
* $Id$
- * 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.
- */
-
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 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 <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
package org.apache.fop.traits;
import org.apache.fop.datatypes.Space;
/**
* Store a single Space property value in simplified form, with all
- * Length values resolved.
+ * Length values resolved. See section 4.3 in the specs.
*/
public class SpaceVal {
- public final MinOptMax space;
- public final boolean bConditional;
- public final boolean bForcing;
- public final int iPrecedence; // Numeric only, if forcing, set to 0
+
+ private final MinOptMax space;
+ private final boolean bConditional;
+ private final boolean bForcing;
+ private final int iPrecedence; // Numeric only, if forcing, set to 0
+ /**
+ * Constructor for SpaceVal objects based on Space objects.
+ * @param spaceprop Space object to use
+ */
public SpaceVal(Space spaceprop) {
- space = new MinOptMax( spaceprop.getMinimum().getLength().mvalue(),
- spaceprop.getOptimum().getLength().mvalue(),
- spaceprop.getMaximum().getLength().mvalue());
- bConditional = (spaceprop.getConditionality().getEnum() ==
- Constants.DISCARD);
+ space = new MinOptMax(spaceprop.getMinimum().getLength().getValue(),
+ spaceprop.getOptimum().getLength().getValue(),
+ spaceprop.getMaximum().getLength().getValue());
+ bConditional =
+ (spaceprop.getConditionality().getEnum() == Constants.DISCARD);
Property precProp = spaceprop.getPrecedence();
if (precProp.getNumber() != null) {
iPrecedence = precProp.getNumber().intValue();
}
}
+ /**
+ * Constructor for SpaceVal objects based on the full set of properties.
+ * @param space space to use
+ * @param bConditional Conditionality value
+ * @param bForcing Forcing value
+ * @param iPrecedence Precedence value
+ */
public SpaceVal(MinOptMax space, boolean bConditional,
boolean bForcing, int iPrecedence) {
this.space = space;
this.iPrecedence = iPrecedence;
}
+ /**
+ * Returns the Conditionality value.
+ * @return the Conditionality value
+ */
+ public boolean isConditional() {
+ return bConditional;
+ }
+
+ /**
+ * Returns the Forcing value.
+ * @return the Forcing value
+ */
+ public boolean isForcing() {
+ return bForcing;
+ }
+
+ /**
+ * Returns the Precedence value.
+ * @return the Precedence value
+ */
+ public int getPrecedence() {
+ return iPrecedence;
+ }
+
+ /**
+ * Returns the Space value.
+ * @return the Space value
+ */
+ public MinOptMax getSpace() {
+ return space;
+ }
+
}