+++ /dev/null
-/*
- * $Id: ColorProfile.java,v 1.10 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- * 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
-import java.awt.color.ICC_Profile;
-import java.awt.color.ICC_ColorSpace;
-import java.net.URL;
-import java.io.IOException;
-import java.io.InputStream;
-
-// FOP
-import org.apache.fop.datatypes.ColorType;
-
-/**
- * The fo:color-profile formatting object.
- * This loads the color profile when needed and resolves a requested color.
- */
-public class ColorProfile extends FObj {
- private int intent;
- private String src;
- private String profileName;
- private ICC_ColorSpace colorSpace = null;
-
- /**
- * @see org.apache.fop.fo.FONode#FONode(FONode)
- */
- protected ColorProfile(FONode parent) {
- super(parent);
- }
-
- public void end() {
- src = this.properties.get("src").getString();
- profileName = this.properties.get("color-profile-name").getString();
- intent = this.properties.get("rendering-intent").getEnum();
- this.properties = null;
- }
-
- /**
- * Get the name of this color profile.
- */
- public String getProfileName() {
- return profileName;
- }
-
- /**
- * Get the color specified with the color values from the color profile.
- * The default values are used if the profile could not be loaded
- * or the value is not found.
- */
- public ColorType getColor(int[] colorVals, int defR, int defG, int defB) {
- // float[] rgbvals = colorSpace.toRGB(colorVals);
- // return new ColorType(rgbvals);
- return null;
- }
-
- /**
- * Load the color profile.
- */
- private void load() {
- try {
- URL url = new URL(src);
- InputStream is = url.openStream();
- ICC_Profile iccProfile = ICC_Profile.getInstance(is);
- colorSpace = new ICC_ColorSpace(iccProfile);
- } catch (IOException ioe) {
- getLogger().error("Could not read Color Profile src", ioe);
- } catch (IllegalArgumentException iae) {
- getLogger().error("Color Profile src not an ICC Profile", iae);
- }
- }
-}
+++ /dev/null
-/*
- * $Id: Declarations.java,v 1.8 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- * 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
-import java.util.List;
-import java.util.Map;
-import java.util.Iterator;
-
-/**
- * Declarations formatting object.
- * A declarations formatting object holds a set of color-profiles
- * and optionally additional non-XSL namespace elements.
- * The color-profiles are held in a hashmap for use with color-profile
- * references.
- */
-public class Declarations extends FObj {
-
- private Map colorProfiles = null;
- private List external = null;
-
- protected Declarations(FONode parent) {
- super(parent);
- }
-
- /**
- * At then end of this element sort out the child into
- * a hashmap of color profiles and a list of external xml.
- */
- public void end() {
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- FONode node = (FONode)iter.next();
- if (node.getName().equals("fo:color-profile")) {
- ColorProfile cp = (ColorProfile)node;
- if (!"".equals(cp.getProfileName())) {
- if (colorProfiles == null) {
- colorProfiles = new java.util.HashMap();
- }
- if (colorProfiles.get(cp.getProfileName()) != null) {
- // duplicate names
- getLogger().warn("Duplicate fo:color-profile profile name : "
- + cp.getProfileName());
- }
- colorProfiles.put(cp.getProfileName(), cp);
- } else {
- getLogger().warn("color-profile-name required for color profile");
- }
- } else if (node instanceof XMLObj) {
- if (external == null) {
- external = new java.util.ArrayList();
- }
- external.add(node);
- } else {
- getLogger().warn("invalid element " + node.getName() + "inside declarations");
- }
- }
- children = null;
- }
-}
static class Dec extends ElementMapping.Maker {
public FONode make(FONode parent) {
- return new Declarations(parent);
+ return new org.apache.fop.fo.pagination.Declarations(parent);
}
}
static class CP extends ElementMapping.Maker {
public FONode make(FONode parent) {
- return new ColorProfile(parent);
+ return new org.apache.fop.fo.pagination.ColorProfile(parent);
}
}
static class Fl extends ElementMapping.Maker {
public FONode make(FONode parent) {
- return new org.apache.fop.fo.flow.Flow(parent);
+ return new org.apache.fop.fo.pagination.Flow(parent);
}
}
static class SC extends ElementMapping.Maker {
public FONode make(FONode parent) {
- return new org.apache.fop.fo.flow.StaticContent(parent);
+ return new org.apache.fop.fo.pagination.StaticContent(parent);
}
}
static class T extends ElementMapping.Maker {
public FONode make(FONode parent) {
- return new Title(parent);
+ return new org.apache.fop.fo.pagination.Title(parent);
}
}
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.ExternalGraphic;
-import org.apache.fop.fo.flow.Flow;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.TableBody;
import org.apache.fop.fo.flow.TableCell;
import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.layout.FontInfo;
+++ /dev/null
-/*
- * $Id: Title.java,v 1.15 2003/03/05 21:48:01 jeremias Exp $
- * ============================================================================
- * 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;
-
-// FOP
-import org.apache.fop.datatypes.ColorType;
-import org.apache.fop.datatypes.Length;
-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.FontState;
-import org.apache.fop.layout.MarginInlineProps;
-import org.apache.fop.layoutmgr.ContentLayoutManager;
-import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
-import org.apache.fop.layoutmgr.LMiter;
-
-/**
- * Class modelling the fo:title object. See Sec. 6.4.20 in the XSL-FO Standard.
- */
-public class Title extends FObjMixed {
-
- /**
- * @param parent FONode that is the parent of this object
- */
- public Title(FONode parent) {
- super(parent);
- }
-
- /**
- * TODO: shouldn't this code be in Layout??
- * @return the Title area
- */
- public org.apache.fop.area.Title getTitleArea() {
- org.apache.fop.area.Title title =
- new org.apache.fop.area.Title();
- // use special layout manager to add the inline areas
- // to the Title.
- InlineStackingLayoutManager lm;
- lm = new InlineStackingLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- lm.setLMiter(new LMiter(children.listIterator()));
- lm.init();
-
- // get breaks then add areas to title
-
- ContentLayoutManager clm = new ContentLayoutManager(title);
- clm.setUserAgent(getUserAgent());
- lm.setParent(clm);
-
- clm.fillArea(lm);
-
- return title;
- }
-
- private void setup() {
-
- // Common Accessibility Properties
- AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- AuralProps mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- BorderAndPadding bap = propMgr.getBorderAndPadding();
- BackgroundProps bProps = propMgr.getBackgroundProps();
-
- // Common Font Properties
- FontState fontState = propMgr.getFontState(structHandler.getFontInfo());
-
- // Common Margin Properties-Inline
- MarginInlineProps mProps = propMgr.getMarginInlineProps();
-
- Property prop;
- prop = this.properties.get("baseline-shift");
- if (prop instanceof LengthProperty) {
- Length bShift = prop.getLength();
- } else if (prop instanceof EnumProperty) {
- int bShift = prop.getEnum();
- }
- ColorType col = this.properties.get("color").getColorType();
- Length lHeight = this.properties.get("line-height").getLength();
- int lShiftAdj = this.properties.get(
- "line-height-shift-adjustment").getEnum();
- int vis = this.properties.get("visibility").getEnum();
- Length zIndex = this.properties.get("z-index").getLength();
-
- }
-}
-
+++ /dev/null
-/*
- * $Id: Flow.java,v 1.37 2003/03/06 11:36:30 jeremias Exp $
- * ============================================================================
- * 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.ArrayList;
-import java.util.List;
-
-// XML
-import org.xml.sax.Attributes;
-
-// FOP
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.layoutmgr.FlowLayoutManager;
-
-/**
- * Class modelling the fo:flow object. See Sec. 6.4.18 in the XSL-FO Standard.
- */
-public class Flow extends FObj {
-
- /**
- * PageSequence container
- */
- private PageSequence pageSequence;
-
- /**
- * ArrayList to store snapshot
- */
- private ArrayList markerSnapshot;
-
- /**
- * flow-name attribute
- */
- private String flowName;
-
- /**
- * Content-width of current column area during layout
- */
- private int contentWidth;
-
- /**
- * @param parent FONode that is the parent of this object
- */
- public Flow(FONode parent) {
- super(parent);
- }
-
- /**
- * @see org.apache.fop.fo.FObj#handleAttrs
- * @param attlist Collection of attributes passed to us from the parser.
- * @throws FOPException if parent is not a page-sequence object
- */
- public void handleAttrs(Attributes attlist) throws FOPException {
- super.handleAttrs(attlist);
- if (parent.getName().equals("fo:page-sequence")) {
- this.pageSequence = (PageSequence) parent;
- } else {
- throw new FOPException("flow must be child of "
- + "page-sequence, not " + parent.getName());
- }
- // according to communication from Paul Grosso (XSL-List,
- // 001228, Number 406), confusion in spec section 6.4.5 about
- // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
- // fo:flow per fo:page-sequence only.
-
- /* if (pageSequence.isFlowSet()) {
- if (this.name.equals("fo:flow")) {
- throw new FOPException("Only a single fo:flow permitted"
- + " per fo:page-sequence");
- } else {
- throw new FOPException(this.name
- + " not allowed after fo:flow");
- }
- }
- */
- setFlowName(getProperty("flow-name").getString());
- // Now done in addChild of page-sequence
- //pageSequence.addFlow(this);
-
- structHandler.startFlow(this);
- }
-
- /**
- * Tell the StructureRenderer that we are at the end of the flow.
- */
- public void end() {
- structHandler.endFlow(this);
- }
-
- /**
- * @param name the name of the flow to set
- * @throws FOPException for an empty name
- */
- protected void setFlowName(String name) throws FOPException {
- if (name == null || name.equals("")) {
- throw new FOPException("A 'flow-name' is required for "
- + getName());
- } else {
- flowName = name;
- }
- }
-
- /**
- * @return the name of this flow
- */
- public String getFlowName() {
- return flowName;
- }
-
- /**
- * @param contentWidth content width of this flow, in millipoints (??)
- */
- protected void setContentWidth(int contentWidth) {
- this.contentWidth = contentWidth;
- }
- /**
- * @return the content width of this flow (really of the region
- * in which it is flowing), in millipoints (??).
- */
- public int getContentWidth() {
- return this.contentWidth;
- }
-
- /**
- * @return true (Flow can generate reference areas)
- */
- public boolean generatesReferenceAreas() {
- return true;
- }
-
- /**
- * @see org.apache.fop.fo.FObj#addLayoutManager
- */
- public void addLayoutManager(List list) {
- FlowLayoutManager lm = new FlowLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- list.add(lm);
- }
-
-}
+++ /dev/null
-/*
- * $Id: StaticContent.java,v 1.26 2003/03/06 11:36:30 jeremias Exp $
- * ============================================================================
- * 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.FONode;
-import org.apache.fop.apps.FOPException;
-import org.apache.fop.layoutmgr.StaticContentLayoutManager;
-
-/**
- * Class modelling the fo:static-content object. See Sec. 6.4.19 of the XSL-FO
- * Standard.
- */
-public class StaticContent extends Flow {
-
- /**
- * @param parent FONode that is the parent of this object
- */
- public StaticContent(FONode parent) {
- super(parent);
- }
-
- private void setup() {
- }
-
- /**
- * flowname checking is more stringient for static content currently
- * @param name the flow-name to set
- * @throws FOPException for a missing flow name
- */
- protected void setFlowName(String name) throws FOPException {
- if (name == null || name.equals("")) {
- throw new FOPException("A 'flow-name' is required for "
- + getName() + ".");
- } else {
- super.setFlowName(name);
- }
-
- }
-
- private StaticContentLayoutManager lm;
-
- /**
- * @return this object's layout manager
- */
- public StaticContentLayoutManager getLayoutManager() {
- if (lm == null) {
- lm = new StaticContentLayoutManager();
- lm.setUserAgent(getUserAgent());
- lm.setFObj(this);
- }
- return lm;
- }
-
-}
--- /dev/null
+/*
+ * $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.color.ICC_Profile;
+import java.awt.color.ICC_ColorSpace;
+import java.net.URL;
+import java.io.IOException;
+import java.io.InputStream;
+
+// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+
+/**
+ * The fo:color-profile formatting object.
+ * This loads the color profile when needed and resolves a requested color.
+ */
+public class ColorProfile extends FObj {
+ private int intent;
+ private String src;
+ private String profileName;
+ private ICC_ColorSpace colorSpace = null;
+
+ /**
+ * @see org.apache.fop.fo.FONode#FONode(FONode)
+ */
+ public ColorProfile(FONode parent) {
+ super(parent);
+ }
+
+ public void end() {
+ src = this.properties.get("src").getString();
+ profileName = this.properties.get("color-profile-name").getString();
+ intent = this.properties.get("rendering-intent").getEnum();
+ this.properties = null;
+ }
+
+ /**
+ * Get the name of this color profile.
+ */
+ public String getProfileName() {
+ return profileName;
+ }
+
+ /**
+ * Get the color specified with the color values from the color profile.
+ * The default values are used if the profile could not be loaded
+ * or the value is not found.
+ */
+ public ColorType getColor(int[] colorVals, int defR, int defG, int defB) {
+ // float[] rgbvals = colorSpace.toRGB(colorVals);
+ // return new ColorType(rgbvals);
+ return null;
+ }
+
+ /**
+ * Load the color profile.
+ */
+ private void load() {
+ try {
+ URL url = new URL(src);
+ InputStream is = url.openStream();
+ ICC_Profile iccProfile = ICC_Profile.getInstance(is);
+ colorSpace = new ICC_ColorSpace(iccProfile);
+ } catch (IOException ioe) {
+ getLogger().error("Could not read Color Profile src", ioe);
+ } catch (IllegalArgumentException iae) {
+ getLogger().error("Color Profile src not an ICC Profile", iae);
+ }
+ }
+}
--- /dev/null
+/*
+ * $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.util.List;
+import java.util.Map;
+import java.util.Iterator;
+
+// FOP
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.XMLObj;
+
+
+/**
+ * Declarations formatting object.
+ * A declarations formatting object holds a set of color-profiles
+ * and optionally additional non-XSL namespace elements.
+ * The color-profiles are held in a hashmap for use with color-profile
+ * references.
+ */
+public class Declarations extends FObj {
+
+ private Map colorProfiles = null;
+ private List external = null;
+
+ public Declarations(FONode parent) {
+ super(parent);
+ }
+
+ /**
+ * At then end of this element sort out the child into
+ * a hashmap of color profiles and a list of external xml.
+ */
+ public void end() {
+ for (Iterator iter = children.iterator(); iter.hasNext();) {
+ FONode node = (FONode)iter.next();
+ if (node.getName().equals("fo:color-profile")) {
+ ColorProfile cp = (ColorProfile)node;
+ if (!"".equals(cp.getProfileName())) {
+ if (colorProfiles == null) {
+ colorProfiles = new java.util.HashMap();
+ }
+ if (colorProfiles.get(cp.getProfileName()) != null) {
+ // duplicate names
+ getLogger().warn("Duplicate fo:color-profile profile name : "
+ + cp.getProfileName());
+ }
+ colorProfiles.put(cp.getProfileName(), cp);
+ } else {
+ getLogger().warn("color-profile-name required for color profile");
+ }
+ } else if (node instanceof XMLObj) {
+ if (external == null) {
+ external = new java.util.ArrayList();
+ }
+ external.add(node);
+ } else {
+ getLogger().warn("invalid element " + node.getName() + "inside declarations");
+ }
+ }
+ children = null;
+ }
+}
--- /dev/null
+/*
+ * $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.util.ArrayList;
+import java.util.List;
+
+// XML
+import org.xml.sax.Attributes;
+
+// FOP
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.layoutmgr.FlowLayoutManager;
+
+/**
+ * Class modelling the fo:flow object. See Sec. 6.4.18 in the XSL-FO Standard.
+ */
+public class Flow extends FObj {
+
+ /**
+ * PageSequence container
+ */
+ private PageSequence pageSequence;
+
+ /**
+ * ArrayList to store snapshot
+ */
+ private ArrayList markerSnapshot;
+
+ /**
+ * flow-name attribute
+ */
+ private String flowName;
+
+ /**
+ * Content-width of current column area during layout
+ */
+ private int contentWidth;
+
+ /**
+ * @param parent FONode that is the parent of this object
+ */
+ public Flow(FONode parent) {
+ super(parent);
+ }
+
+ /**
+ * @see org.apache.fop.fo.FObj#handleAttrs
+ * @param attlist Collection of attributes passed to us from the parser.
+ * @throws FOPException if parent is not a page-sequence object
+ */
+ public void handleAttrs(Attributes attlist) throws FOPException {
+ super.handleAttrs(attlist);
+ if (parent.getName().equals("fo:page-sequence")) {
+ this.pageSequence = (PageSequence) parent;
+ } else {
+ throw new FOPException("flow must be child of "
+ + "page-sequence, not " + parent.getName());
+ }
+ // according to communication from Paul Grosso (XSL-List,
+ // 001228, Number 406), confusion in spec section 6.4.5 about
+ // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
+ // fo:flow per fo:page-sequence only.
+
+ /* if (pageSequence.isFlowSet()) {
+ if (this.name.equals("fo:flow")) {
+ throw new FOPException("Only a single fo:flow permitted"
+ + " per fo:page-sequence");
+ } else {
+ throw new FOPException(this.name
+ + " not allowed after fo:flow");
+ }
+ }
+ */
+ setFlowName(getProperty("flow-name").getString());
+ // Now done in addChild of page-sequence
+ //pageSequence.addFlow(this);
+
+ structHandler.startFlow(this);
+ }
+
+ /**
+ * Tell the StructureRenderer that we are at the end of the flow.
+ */
+ public void end() {
+ structHandler.endFlow(this);
+ }
+
+ /**
+ * @param name the name of the flow to set
+ * @throws FOPException for an empty name
+ */
+ protected void setFlowName(String name) throws FOPException {
+ if (name == null || name.equals("")) {
+ throw new FOPException("A 'flow-name' is required for "
+ + getName());
+ } else {
+ flowName = name;
+ }
+ }
+
+ /**
+ * @return the name of this flow
+ */
+ public String getFlowName() {
+ return flowName;
+ }
+
+ /**
+ * @param contentWidth content width of this flow, in millipoints (??)
+ */
+ protected void setContentWidth(int contentWidth) {
+ this.contentWidth = contentWidth;
+ }
+ /**
+ * @return the content width of this flow (really of the region
+ * in which it is flowing), in millipoints (??).
+ */
+ public int getContentWidth() {
+ return this.contentWidth;
+ }
+
+ /**
+ * @return true (Flow can generate reference areas)
+ */
+ public boolean generatesReferenceAreas() {
+ return true;
+ }
+
+ /**
+ * @see org.apache.fop.fo.FObj#addLayoutManager
+ */
+ public void addLayoutManager(List list) {
+ FlowLayoutManager lm = new FlowLayoutManager();
+ lm.setUserAgent(getUserAgent());
+ lm.setFObj(this);
+ list.add(lm);
+ }
+
+}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.Title;
-import org.apache.fop.fo.flow.Flow;
-import org.apache.fop.fo.flow.StaticContent;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.area.AreaTree;
import org.apache.fop.area.PageViewport;
--- /dev/null
+/*
+ * $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;
+
+// FOP
+import org.apache.fop.fo.FONode;
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.layoutmgr.StaticContentLayoutManager;
+
+/**
+ * Class modelling the fo:static-content object. See Sec. 6.4.19 of the XSL-FO
+ * Standard.
+ */
+public class StaticContent extends Flow {
+
+ /**
+ * @param parent FONode that is the parent of this object
+ */
+ public StaticContent(FONode parent) {
+ super(parent);
+ }
+
+ private void setup() {
+ }
+
+ /**
+ * flowname checking is more stringient for static content currently
+ * @param name the flow-name to set
+ * @throws FOPException for a missing flow name
+ */
+ protected void setFlowName(String name) throws FOPException {
+ if (name == null || name.equals("")) {
+ throw new FOPException("A 'flow-name' is required for "
+ + getName() + ".");
+ } else {
+ super.setFlowName(name);
+ }
+
+ }
+
+ private StaticContentLayoutManager lm;
+
+ /**
+ * @return this object's layout manager
+ */
+ public StaticContentLayoutManager getLayoutManager() {
+ if (lm == null) {
+ lm = new StaticContentLayoutManager();
+ lm.setUserAgent(getUserAgent());
+ lm.setFObj(this);
+ }
+ return lm;
+ }
+
+}
--- /dev/null
+/*
+ * $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;
+
+// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.EnumProperty;
+import org.apache.fop.fo.FObjMixed;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.LengthProperty;
+import org.apache.fop.fo.Property;
+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.FontState;
+import org.apache.fop.layout.MarginInlineProps;
+import org.apache.fop.layoutmgr.ContentLayoutManager;
+import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
+import org.apache.fop.layoutmgr.LMiter;
+
+/**
+ * Class modelling the fo:title object. See Sec. 6.4.20 in the XSL-FO Standard.
+ */
+public class Title extends FObjMixed {
+
+ /**
+ * @param parent FONode that is the parent of this object
+ */
+ public Title(FONode parent) {
+ super(parent);
+ }
+
+ /**
+ * TODO: shouldn't this code be in Layout??
+ * @return the Title area
+ */
+ public org.apache.fop.area.Title getTitleArea() {
+ org.apache.fop.area.Title title =
+ new org.apache.fop.area.Title();
+ // use special layout manager to add the inline areas
+ // to the Title.
+ InlineStackingLayoutManager lm;
+ lm = new InlineStackingLayoutManager();
+ lm.setUserAgent(getUserAgent());
+ lm.setFObj(this);
+ lm.setLMiter(new LMiter(children.listIterator()));
+ lm.init();
+
+ // get breaks then add areas to title
+
+ ContentLayoutManager clm = new ContentLayoutManager(title);
+ clm.setUserAgent(getUserAgent());
+ lm.setParent(clm);
+
+ clm.fillArea(lm);
+
+ return title;
+ }
+
+ private void setup() {
+
+ // Common Accessibility Properties
+ AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
+
+ // Common Aural Properties
+ AuralProps mAurProps = propMgr.getAuralProps();
+
+ // Common Border, Padding, and Background Properties
+ BorderAndPadding bap = propMgr.getBorderAndPadding();
+ BackgroundProps bProps = propMgr.getBackgroundProps();
+
+ // Common Font Properties
+ FontState fontState = propMgr.getFontState(structHandler.getFontInfo());
+
+ // Common Margin Properties-Inline
+ MarginInlineProps mProps = propMgr.getMarginInlineProps();
+
+ Property prop;
+ prop = this.properties.get("baseline-shift");
+ if (prop instanceof LengthProperty) {
+ Length bShift = prop.getLength();
+ } else if (prop instanceof EnumProperty) {
+ int bShift = prop.getEnum();
+ }
+ ColorType col = this.properties.get("color").getColorType();
+ Length lHeight = this.properties.get("line-height").getLength();
+ int lShiftAdj = this.properties.get(
+ "line-height-shift-adjustment").getEnum();
+ int vis = this.properties.get("visibility").getEnum();
+ Length zIndex = this.properties.get("z-index").getLength();
+
+ }
+}
+
import org.apache.fop.area.Title;
import org.apache.fop.area.TreeExt;
import org.apache.fop.fo.StructureHandler;
-import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.layout.FontInfo;
-import org.apache.fop.render.Renderer;
import org.apache.fop.fo.flow.Block;
-import org.apache.fop.fo.flow.Flow;
import org.apache.fop.fo.flow.ExternalGraphic;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.TableBody;
import org.apache.fop.fo.flow.TableCell;
import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.pagination.Flow;
+import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.fop.layout.FontInfo;
+import org.apache.fop.render.Renderer;
/**
* Layout handler that receives the structure events.
import org.apache.fop.area.Footnote;
import org.apache.fop.area.Resolveable;
import org.apache.fop.fo.flow.Marker;
-import org.apache.fop.fo.flow.StaticContent;
+import org.apache.fop.fo.properties.Constants;
+import org.apache.fop.fo.pagination.PageNumberGenerator;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Region;
-import org.apache.fop.fo.pagination.SimplePageMaster;
-import org.apache.fop.fo.pagination.PageNumberGenerator;
-import org.apache.fop.fo.properties.Constants;
import org.apache.fop.fo.properties.RetrieveBoundary;
+import org.apache.fop.fo.pagination.SimplePageMaster;
+import org.apache.fop.fo.pagination.StaticContent;
import java.util.ArrayList;
import java.util.List;
// FOP
import org.apache.fop.fo.StructureHandler;
import org.apache.fop.fo.flow.Block;
-import org.apache.fop.fo.flow.Flow;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.PageSequenceMaster;
import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.fo.StructureHandler;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.ExternalGraphic;
-import org.apache.fop.fo.flow.Flow;
import org.apache.fop.fo.flow.InstreamForeignObject;
import org.apache.fop.fo.flow.Leader;
import org.apache.fop.fo.flow.ListBlock;
import org.apache.fop.fo.flow.TableBody;
import org.apache.fop.fo.flow.TableCell;
import org.apache.fop.fo.flow.TableRow;
+import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.properties.Constants;
import org.apache.fop.layout.FontInfo;