cvs commit: xml-fop/src/org/apache/fop/fo/flow InstreamForeignObject.java
keiron 2003/02/18 21:39:20 Modified:src/org/apache/fop/fo/flow InstreamForeignObject.java Log: cleaned up some styling Revision ChangesPath 1.36 +50 -43xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java Index: InstreamForeignObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- InstreamForeignObject.java14 Feb 2003 04:15:04 - 1.35 +++ InstreamForeignObject.java19 Feb 2003 05:39:20 - 1.36 @@ -1,6 +1,6 @@ /* * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * 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. */ @@ -8,54 +8,54 @@ package org.apache.fop.fo.flow; // FOP -import org.apache.fop.fo.*; -import org.apache.fop.fo.properties.*; -import org.apache.fop.datatypes.Length; -import org.apache.fop.area.Area; -import org.apache.fop.area.inline.InlineArea; -import org.apache.fop.area.inline.Viewport; +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; +import java.util.List; + import org.apache.fop.area.inline.ForeignObject; -import org.apache.fop.layout.FontState; +import org.apache.fop.area.inline.Viewport; +import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.FObj; +import org.apache.fop.fo.XMLObj; +import org.apache.fop.fo.properties.DisplayAlign; +import org.apache.fop.fo.properties.Overflow; +import org.apache.fop.fo.properties.Scaling; +import org.apache.fop.fo.properties.TextAlign; import org.apache.fop.layout.AccessibilityProps; import org.apache.fop.layout.AuralProps; -import org.apache.fop.layout.BorderAndPadding; import org.apache.fop.layout.BackgroundProps; +import org.apache.fop.layout.BorderAndPadding; import org.apache.fop.layout.MarginInlineProps; import org.apache.fop.layout.RelativePositionProps; -import org.apache.fop.apps.FOPException; -import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.LeafNodeLayoutManager; - import org.w3c.dom.Document; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.util.List; - +/** + * The instream-foreign-object flow formatting object. + * This is an atomic inline object that contains + * xml data. + */ public class InstreamForeignObject extends FObj { -int breakBefore; -int breakAfter; -int spaceBefore; -int spaceAfter; -int startIndent; -int endIndent; - -Viewport areaCurrent; +private Viewport areaCurrent; /** * constructs an instream-foreign-object object (called by Maker). * * @param parent the parent formatting object - * @param propertyList the explicit properties of this object */ public InstreamForeignObject(FONode parent) { super(parent); } +/** + * Add the layout manager for this into the list. + * @see org.apache.fop.fo.FObj#addLayoutManager(List) + */ public void addLayoutManager(List list) { areaCurrent = getInlineArea(); -if(areaCurrent != null) { +if (areaCurrent != null) { LeafNodeLayoutManager lm = new LeafNodeLayoutManager(); lm.setUserAgent(getUserAgent()); lm.setFObj(this); @@ -68,6 +68,8 @@ /** * Get the inline area created by this element. + * + * @return the viewport inline area */ protected Viewport getInlineArea() { if (children == null) { @@ -79,7 +81,7 @@ return null; } FONode fo = (FONode)children.get(0); -if(!(fo instanceof XMLObj)) { +if (!(fo instanceof XMLObj)) { // error return null; } @@ -115,14 +117,14 @@ int bpd = -1; int ipd = -1; boolean bpdauto = false; -if(hasLH) { +if (hasLH) { bpd = properties.get("line-height").getLength().mvalue(); } 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()) { +if (!len.isAuto()) { bpd = len.mvalue(); } else { len = properties.get("height").getLength(); @@ -133,11 +135,11 @@ }
cvs commit: xml-fop/src/org/apache/fop/fo/flow InstreamForeignObject.java ExternalGraphic.java
keiron 2002/08/20 00:03:20 Modified:src/org/apache/fop/fo/flow InstreamForeignObject.java ExternalGraphic.java Log: handle errors better Revision ChangesPath 1.33 +10 -7 xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java Index: InstreamForeignObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- InstreamForeignObject.java16 Aug 2002 13:06:38 - 1.32 +++ InstreamForeignObject.java20 Aug 2002 07:03:19 - 1.33 @@ -54,17 +54,20 @@ } public void addLayoutManager(List list) { -LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this); -lm.setCurrentArea(getInlineArea()); -lm.setAlignment(properties.get("vertical-align").getEnum()); -lm.setLead(areaCurrent.getHeight()); -list.add(lm); +areaCurrent = getInlineArea(); +if(areaCurrent != null) { +LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this); +lm.setCurrentArea(areaCurrent); +lm.setAlignment(properties.get("vertical-align").getEnum()); +lm.setLead(areaCurrent.getHeight()); +list.add(lm); +} } /** * Get the inline area created by this element. */ -protected InlineArea getInlineArea() { +protected Viewport getInlineArea() { if (children == null) { return areaCurrent; } 1.28 +9 -6 xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java Index: ExternalGraphic.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- ExternalGraphic.java 16 Aug 2002 13:06:38 - 1.27 +++ ExternalGraphic.java 20 Aug 2002 07:03:19 - 1.28 @@ -45,11 +45,14 @@ } public void addLayoutManager(List list) { -LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this); -lm.setCurrentArea(getInlineArea()); -lm.setAlignment(properties.get("vertical-align").getEnum()); -lm.setLead(viewHeight); -list.add(lm); +InlineArea area = getInlineArea(); +if(area != null) { +LeafNodeLayoutManager lm = new LeafNodeLayoutManager(this); +lm.setCurrentArea(area); +lm.setAlignment(properties.get("vertical-align").getEnum()); +lm.setLead(viewHeight); +list.add(lm); +} } protected InlineArea getInlineArea() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow InstreamForeignObject.java
keiron 2002/07/23 04:01:59 Modified:src/org/apache/fop/fo/flow InstreamForeignObject.java Log: fix for unknown child that returns null size Revision ChangesPath 1.29 +5 -1 xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java Index: InstreamForeignObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- InstreamForeignObject.java5 Jul 2002 09:21:47 - 1.28 +++ InstreamForeignObject.java23 Jul 2002 11:01:59 - 1.29 @@ -161,6 +161,10 @@ Point2D csize = new Point2D.Float(cwidth == -1 ? -1 : cwidth / 1000f, cheight == -1 ? -1 : cheight / 1000f); Point2D size = child.getDimension(csize); +if(size == null) { +// error +return null; +} if(cwidth == -1) { cwidth = (int)size.getX() * 1000; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/org/apache/fop/fo/flow InstreamForeignObject.java
keiron 02/03/05 02:25:39 Modified:src/org/apache/fop/fo XMLObj.java src/org/apache/fop/fo/flow InstreamForeignObject.java Log: gets namespace of document through different call so conversion is possible Revision ChangesPath 1.9 +6 -2 xml-fop/src/org/apache/fop/fo/XMLObj.java Index: XMLObj.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/XMLObj.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XMLObj.java 26 Feb 2002 12:43:09 - 1.8 +++ XMLObj.java 5 Mar 2002 10:25:39 - 1.9 @@ -1,5 +1,5 @@ /* - * $Id: XMLObj.java,v 1.8 2002/02/26 12:43:09 keiron Exp $ + * $Id: XMLObj.java,v 1.9 2002/03/05 10:25:39 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. @@ -53,7 +53,7 @@ } public Document getDocument() { - return doc; +return doc; } public Point2D getDimension(Point2D view) { @@ -61,6 +61,10 @@ } public abstract String getNameSpace(); + +public String getDocumentNamespace() { +return getNameSpace(); +} protected static HashMap ns = new HashMap(); static { 1.22 +2 -2 xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java Index: InstreamForeignObject.java === RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InstreamForeignObject.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- InstreamForeignObject.java26 Feb 2002 12:43:09 - 1.21 +++ InstreamForeignObject.java5 Mar 2002 10:25:39 - 1.22 @@ -1,5 +1,5 @@ /* - * $Id: InstreamForeignObject.java,v 1.21 2002/02/26 12:43:09 keiron Exp $ + * $Id: InstreamForeignObject.java,v 1.22 2002/03/05 10:25:39 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. @@ -127,7 +127,7 @@ Point2D size = child.getDimension(new Point2D.Float(-1, -1)); Document doc = child.getDocument(); -String ns = child.getNameSpace(); +String ns = child.getDocumentNamespace(); children = null; ForeignObject foreign = new ForeignObject(doc, ns); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]