+++ /dev/null
-/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <jtauber@jtauber.com>. For more information on the Apache
- Software Foundation, please see <http://www.apache.org/>.
-
- */
-package org.apache.fop.layout;
-
-// FOP
-import org.apache.fop.render.Renderer;
-
-// Java
-import java.util.Vector;
-import java.util.Enumeration;
-
-public class ForeignObjectArea extends Area {
-
- protected int xOffset = 0;
- /* text-align of contents */
- protected int align;
- /* vertical align of contents */
- protected int valign;
- /* scaling method */
- protected int scaling;
- protected Area foreignObject;
- /* height according to the instream-foreign-object */
- protected int cheight;
- /* width according to the instream-foreign-object */
- protected int cwidth;
- /* width of the content */
- protected int awidth;
- /* height of the content */
- protected int aheight;
- /* width */
- protected int width;
- /* height */
- protected int height;
- boolean wauto;
- boolean hauto;
- boolean cwauto;
- boolean chauto;
- int overflow;
-
- public ForeignObjectArea(FontState fontState, int width,
- int height) {
- super(fontState, width, height);
- }
-
- public void render(Renderer renderer) {
- if(foreignObject != null)
- renderer.renderForeignObjectArea(this);
- }
-
- public int getXOffset()
- {
- return this.xOffset;
- }
-
- public void setStartIndent(int startIndent)
- {
- xOffset = startIndent;
- }
-
- public void setObject(Area fobject) {
- foreignObject = fobject;
- }
-
- public Area getObject() {
- return foreignObject;
- }
-
- public void setSizeAuto(boolean wa, boolean ha)
- {
- wauto = wa;
- hauto = ha;
- }
-
- public void setContentSizeAuto(boolean wa, boolean ha)
- {
- cwauto = wa;
- chauto = ha;
- }
-
- public void setAlign(int align)
- {
- this.align = align;
- }
-
- public int getAlign()
- {
- return this.align;
- }
-
- public void setVerticalAlign(int align)
- {
- this.valign = align;
- }
-
- public int getVerticalAlign()
- {
- return this.valign;
- }
-
- public void setOverflow(int o)
- {
- this.overflow = o;
- }
-
- public int getOverflow()
- {
- return this.overflow;
- }
-
- public void setHeight(int height)
- {
- this.height = height;
- }
-
- public void setWidth(int width)
- {
- this.width = width;
- }
-
- public void setContentHeight(int cheight)
- {
- this.cheight = cheight;
- }
-
- public void setContentWidth(int cwidth)
- {
- this.cwidth = cwidth;
- }
-
- public void setScaling(int scaling)
- {
- this.scaling = scaling;
- }
-
- public int scalingMethod()
- {
- return this.scaling;
- }
-
- public void setIntrinsicWidth(int w)
- {
- awidth = w;
- }
-
- public void setIntrinsicHeight(int h)
- {
- aheight = h;
- }
-
- public int getIntrinsicHeight()
- {
- return aheight;
- }
-
- public int getIntrinsicWidth()
- {
- return awidth;
- }
-
- public int getEffectiveHeight()
- {
- if(this.hauto) {
- if(this.chauto) {
- return aheight;
- } else {
- // need to handle percentages, this would be a scaling factor on the
- // instrinsic height (content determined height)
- // if(this.properties.get("content-height").getLength().isPercentage()) {
- // switch(scaling) {
- // case Scaling.UNIFORM:
- // break;
- // case Scaling.NON_UNIFORM:
- // break;
- // }
- // } else {
- return this.cheight;
- }
- } else {
- return this.height;
- }
- }
-
- public int getEffectiveWidth()
- {
- if(this.wauto) {
- if(this.cwauto) {
- return awidth;
- } else {
- // need to handle percentages, this would be a scaling factor on the
- // instrinsic height (content determined height)
- // if(this.properties.get("content-width").getLength().isPercentage()) {
- // switch(scaling) {
- // case Scaling.UNIFORM:
- // break;
- // case Scaling.NON_UNIFORM:
- // break;
- // }
- // } else {
- return this.cwidth;
- }
- } else {
- return this.width;
- }
- }
-}
+++ /dev/null
-/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <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.render.Renderer;
-
-public class InlineArea extends Area {
-
- private String text;
- protected String pageNumberId = null;
- private float red, green, blue;
-
- // Textdecoration
- protected boolean underlined = false;
- protected boolean overlined = false;
- protected boolean lineThrough = false;
-
-
- public InlineArea(FontState fontState, float red, float green,
- float blue, String text, int width) {
- super(fontState);
- this.red = red;
- this.green = green;
- this.blue = blue;
- this.text = text;
- this.contentRectangleWidth = width;
- }
-
- public void render(Renderer renderer) {
- renderer.renderInlineArea(this);
- }
-
- public float getBlue() {
- return this.blue;
- }
-
- public float getGreen() {
- return this.green;
- }
-
- public float getRed() {
- return this.red;
- }
-
- public String getText() {
- return this.text;
- }
-
- public String getPageNumberID() {
- return pageNumberId;
- }
-
- public void setUnderlined(boolean ul) {
- this.underlined = ul;
- }
-
- public boolean getUnderlined() {
- return this.underlined;
- }
-
-}
+++ /dev/null
-/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <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.render.Renderer;
-
-public class InlineSpace extends Space {
- private int size; // in millipoints
- private boolean resizeable = true; //to disallow size changes during justification of a line
-
- public InlineSpace(int amount) {
- this.size = amount;
- }
-
- public InlineSpace(int amount, boolean resizeable) {
- this.resizeable = resizeable;
- this.size = amount;
- }
-
- public int getSize() {
- return size;
- }
-
- public void setSize(int amount) {
- this.size = amount;
- }
-
- public boolean getResizeable() {
- return resizeable;
- }
-
- public void setResizeable(boolean resizeable) {
- this.resizeable = resizeable;
- }
-
- public void render(Renderer renderer) {
- renderer.renderInlineSpace(this);
- }
-}
+++ /dev/null
-/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <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.render.Renderer;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-public class LeaderArea extends InlineArea {
-
- int ruleThickness;
- int leaderLengthOptimum;
- int leaderPattern;
- int ruleStyle;
-
- float red, green, blue;
- public LeaderArea(FontState fontState, float red, float green,
- float blue, String text, int leaderLengthOptimum,
- int leaderPattern, int ruleThickness, int ruleStyle) {
- super(fontState, red, green, blue, text, leaderLengthOptimum);
-
- this.leaderPattern = leaderPattern;
- this.leaderLengthOptimum = leaderLengthOptimum;
- this.ruleStyle = ruleStyle;
- //following the xsl spec rule: if rule-style="none" set thickness to 0;
- //actually in pdf this doesn't work, because a very thin line is still shown
- //this is handled in the pdf renderer
- if (ruleStyle == org.apache.fop.fo.properties.RuleStyle.NONE) {
- ruleThickness = 0;
- }
- this.ruleThickness = ruleThickness;
- }
-
- public void render(Renderer renderer) {
- renderer.renderLeaderArea(this);
- }
- public int getRuleThickness() {
- return this.ruleThickness;
- }
- public int getRuleStyle() {
- return this.ruleStyle;
- }
- public int getLeaderPattern() {
- return this.leaderPattern;
- }
- public int getLeaderLength() {
- return this.contentRectangleWidth;
- }
-
-
-
-}
+++ /dev/null
-/*-- $Id$ --
-
- ============================================================================
- The Apache Software License, Version 1.1
- ============================================================================
-
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modifica-
- tion, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
-
- 4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many individuals
- on behalf of the Apache Software Foundation and was originally created by
- James Tauber <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.render.Renderer;
-import org.apache.fop.datatypes.IDNode;
-
-public class PageNumberInlineArea extends InlineArea {
-
-
- public PageNumberInlineArea(FontState fontState, float red, float green, float blue, String refid, int width) {
- super(fontState, red, green, blue, "?", width);
- this.pageNumberId = refid;
- }
-
-}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+// FOP
+import org.apache.fop.render.Renderer;
+import org.apache.fop.layout.*;
+
+// Java
+import java.util.Vector;
+import java.util.Enumeration;
+
+public class ForeignObjectArea extends Area {
+
+ protected int xOffset = 0;
+ /* text-align of contents */
+ protected int align;
+ /* vertical align of contents */
+ protected int valign;
+ /* scaling method */
+ protected int scaling;
+ protected Area foreignObject;
+ /* height according to the instream-foreign-object */
+ protected int cheight;
+ /* width according to the instream-foreign-object */
+ protected int cwidth;
+ /* width of the content */
+ protected int awidth;
+ /* height of the content */
+ protected int aheight;
+ /* width */
+ protected int width;
+ /* height */
+ protected int height;
+ boolean wauto;
+ boolean hauto;
+ boolean cwauto;
+ boolean chauto;
+ int overflow;
+
+ public ForeignObjectArea(FontState fontState, int width,
+ int height) {
+ super(fontState, width, height);
+ }
+
+ public void render(Renderer renderer) {
+ if(foreignObject != null)
+ renderer.renderForeignObjectArea(this);
+ }
+
+ public int getXOffset()
+ {
+ return this.xOffset;
+ }
+
+ public void setStartIndent(int startIndent)
+ {
+ xOffset = startIndent;
+ }
+
+ public void setObject(Area fobject) {
+ foreignObject = fobject;
+ }
+
+ public Area getObject() {
+ return foreignObject;
+ }
+
+ public void setSizeAuto(boolean wa, boolean ha)
+ {
+ wauto = wa;
+ hauto = ha;
+ }
+
+ public void setContentSizeAuto(boolean wa, boolean ha)
+ {
+ cwauto = wa;
+ chauto = ha;
+ }
+
+ public void setAlign(int align)
+ {
+ this.align = align;
+ }
+
+ public int getAlign()
+ {
+ return this.align;
+ }
+
+ public void setVerticalAlign(int align)
+ {
+ this.valign = align;
+ }
+
+ public int getVerticalAlign()
+ {
+ return this.valign;
+ }
+
+ public void setOverflow(int o)
+ {
+ this.overflow = o;
+ }
+
+ public int getOverflow()
+ {
+ return this.overflow;
+ }
+
+ public void setHeight(int height)
+ {
+ this.height = height;
+ }
+
+ public void setWidth(int width)
+ {
+ this.width = width;
+ }
+
+ public void setContentHeight(int cheight)
+ {
+ this.cheight = cheight;
+ }
+
+ public void setContentWidth(int cwidth)
+ {
+ this.cwidth = cwidth;
+ }
+
+ public void setScaling(int scaling)
+ {
+ this.scaling = scaling;
+ }
+
+ public int scalingMethod()
+ {
+ return this.scaling;
+ }
+
+ public void setIntrinsicWidth(int w)
+ {
+ awidth = w;
+ }
+
+ public void setIntrinsicHeight(int h)
+ {
+ aheight = h;
+ }
+
+ public int getIntrinsicHeight()
+ {
+ return aheight;
+ }
+
+ public int getIntrinsicWidth()
+ {
+ return awidth;
+ }
+
+ public int getEffectiveHeight()
+ {
+ if(this.hauto) {
+ if(this.chauto) {
+ return aheight;
+ } else {
+ // need to handle percentages, this would be a scaling factor on the
+ // instrinsic height (content determined height)
+ // if(this.properties.get("content-height").getLength().isPercentage()) {
+ // switch(scaling) {
+ // case Scaling.UNIFORM:
+ // break;
+ // case Scaling.NON_UNIFORM:
+ // break;
+ // }
+ // } else {
+ return this.cheight;
+ }
+ } else {
+ return this.height;
+ }
+ }
+
+ public int getEffectiveWidth()
+ {
+ if(this.wauto) {
+ if(this.cwauto) {
+ return awidth;
+ } else {
+ // need to handle percentages, this would be a scaling factor on the
+ // instrinsic height (content determined height)
+ // if(this.properties.get("content-width").getLength().isPercentage()) {
+ // switch(scaling) {
+ // case Scaling.UNIFORM:
+ // break;
+ // case Scaling.NON_UNIFORM:
+ // break;
+ // }
+ // } else {
+ return this.cwidth;
+ }
+ } else {
+ return this.width;
+ }
+ }
+}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.layout.Area;
+import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.*;
+
+public abstract class InlineArea extends Area {
+
+ private int yOffset = 0;
+ private int height = 0;
+ private int verticalAlign = 0;
+ protected String pageNumberId = null;
+ private float red, green, blue;
+
+ // Textdecoration
+ protected boolean underlined = false;
+ protected boolean overlined = false;
+ protected boolean lineThrough = false;
+
+
+ public InlineArea(FontState fontState, int width, float red, float green,
+ float blue) {
+ super(fontState);
+ this.contentRectangleWidth = width;
+ }
+
+ public float getBlue() {
+ return this.blue;
+ }
+
+ public float getGreen() {
+ return this.green;
+ }
+
+ public float getRed() {
+ return this.red;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public int getHeight() {
+ return this.height;
+ }
+
+ public void setVerticalAlign(int align) {
+ this.verticalAlign = align;
+ }
+
+ public int getVerticalAlign() {
+ return this.verticalAlign;
+ }
+
+ public void setYOffset(int yOffset) {
+ this.yOffset = yOffset;
+ }
+
+ public int getYOffset() {
+ return this.yOffset;
+ }
+
+ public String getPageNumberID() {
+ return pageNumberId;
+ }
+
+ public void setUnderlined(boolean ul) {
+ this.underlined = ul;
+ }
+
+ public boolean getUnderlined() {
+ return this.underlined;
+ }
+
+}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.layout.*;
+
+public class InlineSpace extends Space {
+ private int size; // in millipoints
+ private boolean resizeable = true; //to disallow size changes during justification of a line
+
+ public InlineSpace(int amount) {
+ this.size = amount;
+ }
+
+ public InlineSpace(int amount, boolean resizeable) {
+ this.resizeable = resizeable;
+ this.size = amount;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ public void setSize(int amount) {
+ this.size = amount;
+ }
+
+ public boolean getResizeable() {
+ return resizeable;
+ }
+
+ public void setResizeable(boolean resizeable) {
+ this.resizeable = resizeable;
+ }
+
+ public void render(Renderer renderer) {
+ renderer.renderInlineSpace(this);
+ }
+}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.layout.*;
+
+import java.util.Vector;
+import java.util.Enumeration;
+
+public class LeaderArea extends InlineArea {
+
+ int ruleThickness;
+ int leaderLengthOptimum;
+ int leaderPattern;
+ int ruleStyle;
+
+ float red, green, blue;
+ public LeaderArea(FontState fontState, float red, float green,
+ float blue, String text, int leaderLengthOptimum,
+ int leaderPattern, int ruleThickness, int ruleStyle) {
+ super(fontState, leaderLengthOptimum, red, green, blue);
+
+ this.leaderPattern = leaderPattern;
+ this.leaderLengthOptimum = leaderLengthOptimum;
+ this.ruleStyle = ruleStyle;
+ //following the xsl spec rule: if rule-style="none" set thickness to 0;
+ //actually in pdf this doesn't work, because a very thin line is still shown
+ //this is handled in the pdf renderer
+ if (ruleStyle == org.apache.fop.fo.properties.RuleStyle.NONE) {
+ ruleThickness = 0;
+ }
+ this.ruleThickness = ruleThickness;
+ }
+
+ public void render(Renderer renderer) {
+ renderer.renderLeaderArea(this);
+ }
+ public int getRuleThickness() {
+ return this.ruleThickness;
+ }
+ public int getRuleStyle() {
+ return this.ruleStyle;
+ }
+ public int getLeaderPattern() {
+ return this.leaderPattern;
+ }
+ public int getLeaderLength() {
+ return this.contentRectangleWidth;
+ }
+
+
+
+}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.datatypes.IDNode;
+import org.apache.fop.layout.*;
+
+public class PageNumberInlineArea extends WordArea {
+
+
+ public PageNumberInlineArea(FontState fontState, float red, float green, float blue, String refid, int width) {
+ super(fontState, red, green, blue, "?", width);
+ this.pageNumberId = refid;
+ }
+
+}
--- /dev/null
+/*-- $Id$ --
+
+ ============================================================================
+ The Apache Software License, Version 1.1
+ ============================================================================
+
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modifica-
+ tion, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "Fop" and "Apache Software Foundation" must not be used to
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software consists of voluntary contributions made by many individuals
+ on behalf of the Apache Software Foundation and was originally created by
+ James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ Software Foundation, please see <http://www.apache.org/>.
+
+ */
+package org.apache.fop.layout.inline;
+
+import org.apache.fop.render.Renderer;
+import org.apache.fop.layout.FontState;
+
+public class WordArea extends InlineArea {
+
+ private String text;
+
+ // Textdecoration
+ protected boolean underlined = false;
+ protected boolean overlined = false;
+ protected boolean lineThrough = false;
+
+
+ public WordArea(FontState fontState, float red, float green,
+ float blue, String text, int width) {
+ super(fontState, width, red, green, blue);
+ this.text = text;
+ this.contentRectangleWidth = width;
+ }
+
+ public void render(Renderer renderer) {
+ renderer.renderWordArea(this);
+ }
+
+ public String getText() {
+ return this.text;
+ }
+
+ public void setUnderlined(boolean ul) {
+ this.underlined = ul;
+ }
+
+ public boolean getUnderlined() {
+ return this.underlined;
+ }
+
+}