keiron 01/12/13 01:25:22 Modified: docs/examples/fo Tag: fop-0_20_2-maintain textdeko.fo src/org/apache/fop/fo Tag: fop-0_20_2-maintain FObjMixed.java PropertyManager.java src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain Block.java Inline.java Log: adds text-decoration support for blocks Submitted by: Christian Geisert <[EMAIL PROTECTED]> Revision Changes Path No revision No revision 1.3.4.2 +8 -2 xml-fop/docs/examples/fo/textdeko.fo Index: textdeko.fo =================================================================== RCS file: /home/cvs/xml-fop/docs/examples/fo/textdeko.fo,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -u -r1.3.4.1 -r1.3.4.2 --- textdeko.fo 2001/12/06 21:28:18 1.3.4.1 +++ textdeko.fo 2001/12/13 09:25:21 1.3.4.2 @@ -77,7 +77,7 @@ line-height="15pt" space-after.optimum="10pt" text-align="start"> - This is simple test of the text-decoration<fo:inline text-decoration="underline">underline</fo:inline>. + This is simple test of the text-decoration <fo:inline text-decoration="underline">'underline'</fo:inline>. </fo:block> <fo:block font-size="22pt" font-family="sans-serif" @@ -96,7 +96,7 @@ </fo:block> <fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt"> - The following text decorations are defined in the CR: + The following text decorations are defined in the REC: </fo:block> <fo:list-block space-after.optimum="13pt"> @@ -244,6 +244,12 @@ space-after.optimum="10pt" text-align="start"> What about underlining of whitespace only<fo:inline text-decoration="underline"> </fo:inline>? + </fo:block> + + + <fo:block space-after.optimum="13pt" font-size="14pt" text-decoration="underline"> + A whole block should work now. + And again some more Text to get at least two lines. </fo:block> No revision No revision 1.12.2.1 +13 -2 xml-fop/src/org/apache/fop/fo/FObjMixed.java Index: FObjMixed.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObjMixed.java,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -r1.12 -r1.12.2.1 --- FObjMixed.java 2001/08/01 22:12:52 1.12 +++ FObjMixed.java 2001/12/13 09:25:21 1.12.2.1 @@ -1,5 +1,5 @@ /* - * $Id: FObjMixed.java,v 1.12 2001/08/01 22:12:52 gears Exp $ + * $Id: FObjMixed.java,v 1.12.2.1 2001/12/13 09:25:21 keiron Exp $ * 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. @@ -8,6 +8,7 @@ package org.apache.fop.fo; import org.apache.fop.layout.Area; +import org.apache.fop.layout.TextState; import org.apache.fop.apps.FOPException; /** @@ -16,6 +17,9 @@ */ public class FObjMixed extends FObj { + // Textdecoration + protected TextState ts; + public static class Maker extends FObj.Maker { public FObj make(FObj parent, PropertyList propertyList) throws FOPException { @@ -33,7 +37,14 @@ } protected void addCharacters(char data[], int start, int length) { - addChild(new FOText(data, start, length, this)); + // addChild(new FOText(data, start, length, this)); + FOText ft = new FOText(data, start, length, this); + ft.setLogger(log); + ft.setUnderlined(ts.getUnderlined()); + ft.setOverlined(ts.getOverlined()); + ft.setLineThrough(ts.getLineThrough()); + addChild(ft); + } public Status layout(Area area) throws FOPException { 1.7.2.1 +28 -1 xml-fop/src/org/apache/fop/fo/PropertyManager.java Index: PropertyManager.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/PropertyManager.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- PropertyManager.java 2001/08/06 09:12:58 1.7 +++ PropertyManager.java 2001/12/13 09:25:22 1.7.2.1 @@ -1,5 +1,5 @@ /* - * $Id: PropertyManager.java,v 1.7 2001/08/06 09:12:58 keiron Exp $ + * $Id: PropertyManager.java,v 1.7.2.1 2001/12/13 09:25:22 keiron Exp $ * 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. @@ -26,6 +26,8 @@ import java.text.FieldPosition; import org.apache.fop.layout.Area; import org.apache.fop.layout.ColumnArea; +import org.apache.fop.layout.TextState; +import org.apache.fop.fo.properties.TextDecoration; public class PropertyManager { @@ -247,4 +249,29 @@ AbsolutePositionProps props = new AbsolutePositionProps(); return props; } + + public TextState getTextDecoration() throws FOPException { + TextState ts = new TextState(); + + int textDecoration = this.properties.get("text-decoration").getEnum(); + + switch (textDecoration) { + case TextDecoration.UNDERLINE: + ts.setUnderlined(true); + break; + case TextDecoration.OVERLINE: + ts.setOverlined(true); + break; + case TextDecoration.LINE_THROUGH: + ts.setLineThrough(true); + break; + case TextDecoration.NONE: + ts.setUnderlined(false); + ts.setOverlined(false); + ts.setLineThrough(false); + } + + return ts; + } + } No revision No revision 1.41.2.2 +5 -2 xml-fop/src/org/apache/fop/fo/flow/Block.java Index: Block.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.41.2.1 retrieving revision 1.41.2.2 diff -u -r1.41.2.1 -r1.41.2.2 --- Block.java 2001/12/06 21:28:21 1.41.2.1 +++ Block.java 2001/12/13 09:25:22 1.41.2.2 @@ -1,5 +1,5 @@ /* - * $Id: Block.java,v 1.41.2.1 2001/12/06 21:28:21 tore Exp $ + * $Id: Block.java,v 1.41.2.2 2001/12/13 09:25:22 keiron Exp $ * 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. @@ -66,10 +66,13 @@ // this may be helpful on other FOs too boolean anythingLaidOut = false; - public Block(FObj parent, PropertyList propertyList) { + public Block(FObj parent, PropertyList propertyList) + throws FOPException { + super(parent, propertyList); this.name = "fo:block"; this.span = this.properties.get("span").getEnum(); + ts = propMgr.getTextDecoration(); } public Status layout(Area area) throws FOPException { 1.8.2.1 +6 -22 xml-fop/src/org/apache/fop/fo/flow/Inline.java Index: Inline.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Inline.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -r1.8 -r1.8.2.1 --- Inline.java 2001/09/16 13:42:49 1.8 +++ Inline.java 2001/12/13 09:25:22 1.8.2.1 @@ -1,5 +1,5 @@ /* - * $Id: Inline.java,v 1.8 2001/09/16 13:42:49 keiron Exp $ + * $Id: Inline.java,v 1.8.2.1 2001/12/13 09:25:22 keiron Exp $ * 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. @@ -30,12 +30,6 @@ return new Inline.Maker(); } - // Textdecoration - protected boolean underlined = false; - protected boolean overlined = false; - protected boolean lineThrough = false; - - public Inline(FObj parent, PropertyList propertyList) throws FOPException { super(parent, propertyList); @@ -79,27 +73,17 @@ // this.properties.get("visibility"); // this.properties.get("z-index"); - int textDecoration = this.properties.get("text-decoration").getEnum(); - - if (textDecoration == TextDecoration.UNDERLINE) { - this.underlined = true; - } + // Text Decoration Properties + ts = propMgr.getTextDecoration(); - if (textDecoration == TextDecoration.OVERLINE) { - this.overlined = true; - } - - if (textDecoration == TextDecoration.LINE_THROUGH) { - this.lineThrough = true; - } } protected void addCharacters(char data[], int start, int length) { FOText ft = new FOText(data, start, length, this); ft.setLogger(log); - ft.setUnderlined(underlined); - ft.setOverlined(overlined); - ft.setLineThrough(lineThrough); + ft.setUnderlined(ts.getUnderlined()); + ft.setOverlined(ts.getOverlined()); + ft.setLineThrough(ts.getLineThrough()); children.addElement(ft); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]