Author: ssteiner Date: Thu Jul 5 11:29:01 2018 New Revision: 1835125 URL: http://svn.apache.org/viewvc?rev=1835125&view=rev Log: FOP-1760: Change bar generation
Added: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_block.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_inline.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_list.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_overlapped.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_placement-rtl.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_placement.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_style.xml (with props) xmlgraphics/fop/branches/Temp_ChangeBars2/fop/test/layoutengine/standard-testcases/change-bar_table.xml (with props) Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Area.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Span.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOElementMapping.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FONode.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOPropertyMapping.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOText.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOTreeBuilder.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOValidationEventProducer.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FObj.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/table/TableRow.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/PageSequence.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/Root.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractPathOrientedRenderer.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/xml/XMLRenderer.java xmlgraphics/fop/branches/Temp_ChangeBars2/fop/src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Area.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Area.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Area.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Area.java Thu Jul 5 11:29:01 2018 @@ -20,12 +20,14 @@ package org.apache.fop.area; import java.io.Serializable; +import java.util.List; import java.util.Map; import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.fo.flow.ChangeBar; import org.apache.fop.traits.BorderProps; import org.apache.fop.traits.WritingModeTraitsGetter; @@ -129,6 +131,29 @@ public class Area extends AreaTreeObject protected static final Log log = LogFactory.getLog(Area.class); /** + * The active change bar list + */ + private List<ChangeBar> changeBarList; + + /** + * Returns the active change bar list. + * + * @return The active change bar list + */ + public List<ChangeBar> getChangeBarList() { + return changeBarList; + } + + /** + * Sets the active change bar list. + * + * @param changeBarList The active change bar list + */ + public void setChangeBarList(List<ChangeBar> changeBarList) { + this.changeBarList = changeBarList; + } + + /** * Get the area class of this area. * * @return the area class Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/AreaTreeParser.java Thu Jul 5 11:29:01 2018 @@ -66,6 +66,7 @@ import org.apache.fop.area.inline.Contai import org.apache.fop.area.inline.ForeignObject; import org.apache.fop.area.inline.Image; import org.apache.fop.area.inline.InlineArea; +import org.apache.fop.area.inline.InlineBlock; import org.apache.fop.area.inline.InlineBlockParent; import org.apache.fop.area.inline.InlineParent; import org.apache.fop.area.inline.InlineViewport; @@ -80,6 +81,7 @@ import org.apache.fop.fo.extensions.Exte import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.traits.BorderProps; +import org.apache.fop.traits.Direction; import org.apache.fop.traits.Visibility; import org.apache.fop.util.ColorUtil; import org.apache.fop.util.ContentHandlerFactory; @@ -190,6 +192,7 @@ public class AreaTreeParser { makers.put("block", new BlockMaker()); makers.put("lineArea", new LineAreaMaker()); makers.put("inline", new InlineMaker()); + makers.put("inlineblock", new InlineBlockMaker()); makers.put("inlineparent", new InlineParentMaker()); makers.put("inlineblockparent", new InlineBlockParentMaker()); makers.put("text", new TextMaker()); @@ -594,6 +597,17 @@ public class AreaTreeParser { BodyRegion body = getCurrentBodyRegion(); Span span = new Span(columnCount, body.getColumnGap(), ipd); + + String blockDirection = attributes.getValue("block-progression-direction"); + if (blockDirection != null) { + span.addTrait(Trait.BLOCK_PROGRESSION_DIRECTION, Direction.valueOf(blockDirection)); + } + + String inlineDirection = attributes.getValue("inline-progression-direction"); + if (inlineDirection != null) { + span.addTrait(Trait.INLINE_PROGRESSION_DIRECTION, Direction.valueOf(inlineDirection)); + } + transferForeignObjects(attributes, span); setAreaAttributes(attributes, span); body.getMainReference().getSpans().add(span); @@ -723,6 +737,34 @@ public class AreaTreeParser { } } + private class InlineBlockMaker extends AbstractMaker { + + public void startElement(Attributes attributes) { + + Block block = new Block(); + + if (attributes.getValue("left-offset") != null) { + block.setXOffset(XMLUtil.getAttributeAsInt(attributes, "left-offset", 0)); + } + if (attributes.getValue("top-offset") != null) { + block.setYOffset(XMLUtil.getAttributeAsInt(attributes, "top-offset", 0)); + } + transferForeignObjects(attributes, block); + setAreaAttributes(attributes, block); + setTraits(attributes, block, SUBSET_COMMON); + setTraits(attributes, block, SUBSET_BOX); + setTraits(attributes, block, SUBSET_COLOR); + Area parent = (Area)areaStack.peek(); + InlineBlock inlineBlock = new InlineBlock(block); + parent.addChildArea(inlineBlock); + areaStack.push(inlineBlock); + } + + public void endElement() { + assertObjectOfClass(areaStack.pop(), InlineBlock.class); + } + } + private class InlineParentMaker extends AbstractMaker { public void startElement(Attributes attributes) { Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Span.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Span.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Span.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/Span.java Thu Jul 5 11:29:01 2018 @@ -82,6 +82,15 @@ public class Span extends Area { } /** + * Get the column gap for this span area. + * + * @return the column gap for this span area + */ + public int getColumnGap() { + return colGap; + } + + /** * Get the width of a single column within this Span * * @return the width of a single column @@ -206,6 +215,8 @@ public class Span extends Area { } break; } + addTrait(Trait.INLINE_PROGRESSION_DIRECTION, wmtg.getInlineProgressionDirection()); + addTrait(Trait.BLOCK_PROGRESSION_DIRECTION, wmtg.getBlockProgressionDirection()); } /** {@inheritDoc} */ Added: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java?rev=1835125&view=auto ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java (added) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java Thu Jul 5 11:29:01 2018 @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.area.inline; + +import org.apache.fop.area.Block; + +/** + * This is the inline block area class. + * It wraps the child block when it has to be placed into inline parent. + */ +public class InlineBlock extends InlineParent { + + private final Block block; + + public InlineBlock(Block block) { + this.block = block; + } + + /** + * @return the wrapped block + */ + public Block getBlock() { + return block; + } +} Propchange: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/InlineBlock.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/area/inline/TextArea.java Thu Jul 5 11:29:01 2018 @@ -95,6 +95,7 @@ public class TextArea extends AbstractTe WordArea wordArea = new WordArea( blockProgressionOffset, minWordLevel, word, letterAdjust, levels, gposAdjustments); wordArea.setIPD(ipd); + wordArea.setChangeBarList(getChangeBarList()); addChildArea(wordArea); wordArea.setParentArea(this); updateLevel(minWordLevel); @@ -113,6 +114,7 @@ public class TextArea extends AbstractTe char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) { SpaceArea spaceArea = new SpaceArea(blockProgressionOffset, level, space, adjustable); spaceArea.setIPD(ipd); + spaceArea.setChangeBarList(getChangeBarList()); addChildArea(spaceArea); spaceArea.setParentArea(this); updateLevel(level); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOElementMapping.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOElementMapping.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOElementMapping.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOElementMapping.java Thu Jul 5 11:29:01 2018 @@ -141,6 +141,10 @@ public class FOElementMapping extends El foObjs.put("marker", new MarkerMaker()); foObjs.put("retrieve-marker", new RetrieveMarkerMaker()); foObjs.put("retrieve-table-marker", new RetrieveTableMarkerMaker()); + + // change bars + foObjs.put("change-bar-begin", new ChangeBarBeginMaker()); + foObjs.put("change-bar-end", new ChangeBarEndMaker()); } } @@ -527,4 +531,16 @@ public class FOElementMapping extends El return new org.apache.fop.fo.flow.RetrieveTableMarker(parent); } } + + static class ChangeBarBeginMaker extends ElementMapping.Maker { + public FONode make(FONode parent) { + return new org.apache.fop.fo.flow.ChangeBarBegin(parent); + } + } + + static class ChangeBarEndMaker extends ElementMapping.Maker { + public FONode make(FONode parent) { + return new org.apache.fop.fo.flow.ChangeBarEnd(parent); + } + } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FONode.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FONode.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FONode.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FONode.java Thu Jul 5 11:29:01 2018 @@ -20,6 +20,7 @@ package org.apache.fop.fo; // Java +import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Stack; @@ -42,6 +43,7 @@ import org.apache.fop.fo.extensions.Exte import org.apache.fop.fo.extensions.ExtensionElementMapping; import org.apache.fop.fo.extensions.InternalElementMapping; import org.apache.fop.fo.extensions.svg.SVGElementMapping; +import org.apache.fop.fo.flow.ChangeBar; import org.apache.fop.fo.pagination.Root; import org.apache.fop.util.CharUtilities; import org.apache.fop.util.ContentHandlerFactory; @@ -63,6 +65,12 @@ public abstract class FONode implements /** pointer to the sibling nodes */ protected FONode[] siblings; + /** The list of active change bars for the given node */ + protected List<ChangeBar> nodeChangeBarList; + + /** The list of active change bars for the start of the given node */ + protected List<ChangeBar> startOfNodeChangeBarList; + /** * Marks the location of this object from the input FO * <br>Call <code>locator.getSystemId()</code>, @@ -174,6 +182,18 @@ public abstract class FONode implements } /** + * Tests if the given element is a change bar element. + * + * @param namespaceURI The name space of the element + * @param localName The local name of the element + * @return A boolean value true if the given element is a change bar element + */ + public boolean isChangeBarElement(String namespaceURI, String localName) { + return FO_URI.equals(namespaceURI) + && (localName.equals("change-bar-begin") || localName.equals("change-bar-end")); + } + + /** * Returns the user agent that is associated with the * tree's <code>FOEventHandler</code>. * @@ -1083,6 +1103,15 @@ public abstract class FONode implements } /** + * Returns the list of active change bars. + * + * @return The list of active change bars + */ + public List<ChangeBar> getChangeBarList() { + return nodeChangeBarList; + } + + /** * Sets the structure tree element. * * @param structureTreeElement set. Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOPropertyMapping.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOPropertyMapping.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOPropertyMapping.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOPropertyMapping.java Thu Jul 5 11:29:01 2018 @@ -322,6 +322,7 @@ public final class FOPropertyMapping imp gp.createTableProperties(); gp.createWritingModeProperties(); gp.createMiscProperties(); + gp.createChangeBarProperties(); // Hardcode the subproperties. addSubpropMakerName("length", CP_LENGTH); @@ -2588,6 +2589,56 @@ public final class FOPropertyMapping imp addPropertyMaker("writing-mode", m); } + private void createChangeBarProperties() { + PropertyMaker m; + + // change-bar-class + m = new StringProperty.Maker(PR_CHANGE_BAR_CLASS); + m.setInherited(false); + m.setDefault(""); + addPropertyMaker("change-bar-class", m); + + // change-bar-color + m = new ColorProperty.Maker(PR_CHANGE_BAR_COLOR); + + m.setInherited(true); + // TODO: fall back to "color" property + m.setDefault("black"); + addPropertyMaker("change-bar-color", m); + + // change-bar-placement + m = new EnumProperty.Maker(PR_CHANGE_BAR_PLACEMENT); + m.setInherited(true); + m.setDefault("start"); + m.addEnum("start", getEnumProperty(EN_START, "START")); + m.addEnum("end", getEnumProperty(EN_END, "END")); + m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT")); + m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT")); + m.addEnum("inside", getEnumProperty(EN_INSIDE, "INSIDE")); + m.addEnum("outside", getEnumProperty(EN_OUTSIDE, "OUTSIDE")); + m.addEnum("alternate", getEnumProperty(EN_ALTERNATE, "ALTERNATE")); + addPropertyMaker("change-bar-placement", m); + + // change-bar-style + m = new EnumProperty.Maker(PR_CHANGE_BAR_STYLE); + m.useGeneric(genericBorderStyle); + m.setInherited(true); + m.setDefault("solid"); + addPropertyMaker("change-bar-style", m); + + // change-bar-width + m = new LengthProperty.Maker(PR_CHANGE_BAR_WIDTH); + m.setInherited(true); + m.setDefault("6pt"); + addPropertyMaker("change-bar-width", m); + + // change-bar-offset + m = new LengthProperty.Maker(PR_CHANGE_BAR_OFFSET); + m.setInherited(true); + m.setDefault("6pt"); + addPropertyMaker("change-bar-offset", m); + } + private void createMiscProperties() { PropertyMaker m; Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOText.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOText.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOText.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOText.java Thu Jul 5 11:29:01 2018 @@ -33,6 +33,7 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.complexscripts.bidi.DelimitedTextRange; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.properties.CommonFont; import org.apache.fop.fo.properties.CommonHyphenation; import org.apache.fop.fo.properties.CommonTextDecoration; @@ -109,6 +110,11 @@ public class FOText extends FONode imple */ public FOText(FONode parent) { super(parent); + + PageSequence pageSequence = getRoot().getLastPageSequence(); + if (pageSequence != null && pageSequence.hasChangeBars()) { + nodeChangeBarList = getRoot().getLastPageSequence().getClonedChangeBarList(); + } } /** {@inheritDoc} */ Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOTreeBuilder.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOTreeBuilder.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOTreeBuilder.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOTreeBuilder.java Thu Jul 5 11:29:01 2018 @@ -273,7 +273,9 @@ public class FOTreeBuilder extends Defau if (currentFObj.getNamespaceURI().equals(FOElementMapping.URI) || currentFObj.getNamespaceURI().equals(ExtensionElementMapping.URI) || currentFObj.getNamespaceURI().equals(PDFElementMapping.NAMESPACE)) { - currentFObj.validateChildNode(locator, namespaceURI, localName); + if (!currentFObj.isChangeBarElement(namespaceURI, localName)) { + currentFObj.validateChildNode(locator, namespaceURI, localName); + } } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOValidationEventProducer.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOValidationEventProducer.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOValidationEventProducer.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FOValidationEventProducer.java Thu Jul 5 11:29:01 2018 @@ -382,6 +382,47 @@ public interface FOValidationEventProduc QName offendingNode, Locator loc); /** + * A class for change bars is not unique. + * @param source the event source + * @param elementName the name of the context node + * @param name the class name + * @param loc the location of the error or null + * @event.severity FATAL + */ + void changeBarClassNotUnique(Object source, String elementName, String name, + Locator loc); + + /** + * Change bars were not stacked correctly + * @param source the event source + * @param elementName the name of the context node + * @param beginName the class name of the beginning change bar + * @param endName the class name of the ending change bar + * @param loc the location of the error or null + * @event.severity FATAL + */ + void changeBarWrongStacking(Object source, String elementName, String beginName, + String endName, Locator loc); + + /** + * Change bar ended without a start of bar occurred + * @param source the event source + * @param elementName the name of the context node + * @param loc the location of the error or null + * @event.severity FATAL + */ + void changeBarNoBegin(Object source, String elementName, Locator loc); + + /** + * Change bar not descendant of fo:flow or fo:static-content + * @param source the event source + * @param elementName the name of the context node + * @param loc the location of the error or null + * @event.severity FATAL + */ + void changeBarWrongAncestor(Object source, String elementName, Locator loc); + + /** * Alternate text is missing for a graphic element. * * @param source the event source Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FObj.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FObj.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FObj.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/FObj.java Thu Jul 5 11:29:01 2018 @@ -21,6 +21,7 @@ package org.apache.fop.fo; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -34,7 +35,9 @@ import org.apache.xmlgraphics.util.QName import org.apache.fop.apps.FOPException; import org.apache.fop.fo.extensions.ExtensionAttachment; +import org.apache.fop.fo.flow.ChangeBar; import org.apache.fop.fo.flow.Marker; +import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.properties.Property; import org.apache.fop.fo.properties.PropertyMaker; @@ -182,6 +185,39 @@ public abstract class FObj extends FONod if (id != null) { checkId(id); } + + PageSequence pageSequence = getRoot().getLastPageSequence(); + if (pageSequence != null && pageSequence.hasChangeBars()) { + startOfNodeChangeBarList = pageSequence.getClonedChangeBarList(); + } + } + + /** + * {@inheritDoc} + * @throws FOPException FOP Exception + */ + public void endOfNode() throws FOPException { + + List<ChangeBar> endOfNodeChangeBarList = null; + + PageSequence pageSequence = getRoot().getLastPageSequence(); + if (pageSequence != null) { + endOfNodeChangeBarList = pageSequence.getClonedChangeBarList(); + } + + if (startOfNodeChangeBarList != null && endOfNodeChangeBarList != null) { + + nodeChangeBarList = new LinkedList<ChangeBar>(endOfNodeChangeBarList); + nodeChangeBarList.retainAll(startOfNodeChangeBarList); + + if (nodeChangeBarList.isEmpty()) { + nodeChangeBarList = null; + } + + startOfNodeChangeBarList = null; + } + + super.endOfNode(); } /** @@ -492,6 +528,8 @@ public abstract class FObj extends FONod protected boolean isInlineItem(String nsURI, String lName) { return (FO_URI.equals(nsURI) && ("bidi-override".equals(lName) + || "change-bar-begin".equals(lName) + || "change-bar-end".equals(lName) || "character".equals(lName) || "external-graphic".equals(lName) || "instream-foreign-object".equals(lName) Added: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java?rev=1835125&view=auto ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java (added) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java Thu Jul 5 11:29:01 2018 @@ -0,0 +1,214 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.fo.flow; + +import java.awt.Color; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; + +import org.apache.fop.apps.FOPException; +import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.StaticPropertyList; +import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.SpaceProperty; + +/** + * Common change bar base class. Handles change bar properties and validates child nodes. + */ +public abstract class ChangeBar extends FObj { + + /** + * Constructs a ChangeBar element with common parts for both begin and end change bars. + * + * @param parent The parent node + */ + public ChangeBar(FONode parent) { + super(parent); + } + + /** + * The change bar class (required). + */ + protected String changeBarClass; + + /** + * The change bar color. + */ + protected Color color; + + /** + * The change bar offset. + */ + protected Length offset; + + /** + * The change bar placement. + */ + protected int placement = -1; + + /** + * The change bar style. + */ + protected int style = -1; + + /** + * The change bar width. + */ + protected Length width; + + /** + * The actual line height. + */ + protected SpaceProperty lineHeight; + + /** {@inheritDoc} */ + public void bind(PropertyList pList) throws FOPException { + super.bind(pList); + + changeBarClass = pList.get(PR_CHANGE_BAR_CLASS).getString(); + color = pList.get(PR_CHANGE_BAR_COLOR).getColor(getUserAgent()); + offset = pList.get(PR_CHANGE_BAR_OFFSET).getLength(); + placement = pList.get(PR_CHANGE_BAR_PLACEMENT).getEnum(); + style = pList.get(PR_CHANGE_BAR_STYLE).getEnum(); + width = pList.get(PR_CHANGE_BAR_WIDTH).getLength(); + lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); + } + + /** {@inheritDoc} */ + protected void validateChildNode( + Locator loc, + String namespaceURI, + String localName) throws ValidationException { + // no children allowed + invalidChildError(loc, namespaceURI, localName); + } + + /** {@inheritDoc} */ + public void processNode(String elementName, Locator locator, + Attributes attlist, PropertyList pList) throws FOPException { + super.processNode(elementName, locator, attlist, pList); + + if (inMarker()) { + PropertyList newPList = new StaticPropertyList(this, null); + newPList.addAttributesToList(attlist); + bind(newPList); + } + + if (changeBarClass == null || changeBarClass.isEmpty()) { + missingPropertyError("change-bar-class"); + } + + if (findAncestor(FO_FLOW) == -1 + && findAncestor(FO_STATIC_CONTENT) == -1) { + getFOValidationEventProducer().changeBarWrongAncestor(this, getName(), locator); + } + } + + /** + * Adds the current change bar to the active change bar list. + */ + protected void push() { + getRoot().getLastPageSequence().pushChangeBar(this); + } + + /** + * Removes the starting counterpart of the current change bar from the active change bar list. + */ + protected void pop() { + getRoot().getLastPageSequence().popChangeBar(this); + } + + /** + * Returns the starting counterpart of the current (ending) change bar. + * + * @return The starting counterpart of the current (ending) change bar + */ + protected ChangeBar getChangeBarBegin() { + return getRoot().getLastPageSequence().getChangeBarBegin(this); + } + + /** + * Returns the change bar class. + * + * @return The change bar class + */ + public String getChangeBarClass() { + return changeBarClass; + } + + /** + * Returns the change bar color. + * + * @return The change bar color + */ + public Color getColor() { + return color; + } + + /** + * Returns the change bar offset. + * + * @return The change bar offset + */ + public Length getOffset() { + return offset; + } + + /** + * Returns the change bar placement. + * + * @return The change bar placement + */ + public int getPlacement() { + return placement; + } + + /** + * Returns the change bar style. + * + * @return The change bar style + */ + public int getStyle() { + return style; + } + + /** + * Returns the change bar width. + * + * @return The change bar width + */ + public Length getWidth() { + return width; + } + + /** + * Returns the line height. + * + * @return The line height + */ + public SpaceProperty getLineHeight() { + return lineHeight; + } + +} Propchange: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBar.java ------------------------------------------------------------------------------ svn:eol-style = native Added: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java?rev=1835125&view=auto ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java (added) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java Thu Jul 5 11:29:01 2018 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.fo.flow; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; + +import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; + +public class ChangeBarBegin extends ChangeBar { + + /** + * Constructs a new ChangeBarBegin element. + * + * @param parent The parent node + */ + public ChangeBarBegin(FONode parent) { + super(parent); + } + + /** {@inheritDoc} */ + public String getLocalName() { + return "change-bar-begin"; + } + + /** + * {@inheritDoc} + * @return {@link org.apache.fop.fo.Constants#FO_CHANGE_BAR_BEGIN} + */ + public int getNameId() { + return FO_CHANGE_BAR_BEGIN; + } + + /** {@inheritDoc} */ + public void processNode(String elementName, Locator locator, + Attributes attlist, PropertyList pList) throws FOPException { + super.processNode(elementName, locator, attlist, pList); + + push(); + } +} Propchange: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarBegin.java ------------------------------------------------------------------------------ svn:eol-style = native Added: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java?rev=1835125&view=auto ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java (added) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java Thu Jul 5 11:29:01 2018 @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.fo.flow; + +import org.xml.sax.Attributes; +import org.xml.sax.Locator; + +import org.apache.fop.apps.FOPException; +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; + +public class ChangeBarEnd extends ChangeBar { + + /** + * Constructs a new ChangeBarEnd element. + * + * @param parent The parent node + */ + public ChangeBarEnd(FONode parent) { + super(parent); + } + + /** {@inheritDoc} */ + public String getLocalName() { + return "change-bar-end"; + } + + /** + * {@inheritDoc} + * @return {@link org.apache.fop.fo.Constants#FO_CHANGE_BAR_END} + */ + public int getNameId() { + return FO_CHANGE_BAR_END; + } + + /** {@inheritDoc} */ + public void processNode(String elementName, Locator locator, + Attributes attlist, PropertyList pList) throws FOPException { + super.processNode(elementName, locator, attlist, pList); + + // check if we have an element on the stack at all + ChangeBar changeBarStart = getChangeBarBegin(); + + if (changeBarStart == null) { + getFOValidationEventProducer().changeBarNoBegin(this, getName(), locator); + } else { + pop(); + } + } +} Propchange: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/ChangeBarEnd.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/table/TableRow.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/table/TableRow.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/table/TableRow.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/flow/table/TableRow.java Thu Jul 5 11:29:01 2018 @@ -90,9 +90,11 @@ public class TableRow extends TableCellC /** {@inheritDoc} */ protected void addChildNode(FONode child) throws FOPException { if (!inMarker()) { - TableCell cell = (TableCell) child; - TablePart part = (TablePart) getParent(); - addTableCellChild(cell, part.isFirst(this)); + if (child instanceof TableCell) { + TableCell cell = (TableCell) child; + TablePart part = (TablePart) getParent(); + addTableCellChild(cell, part.isFirst(this)); + } } super.addChildNode(child); } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/PageSequence.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/PageSequence.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/PageSequence.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/PageSequence.java Thu Jul 5 11:29:01 2018 @@ -19,6 +19,8 @@ package org.apache.fop.fo.pagination; +import java.util.LinkedList; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Stack; @@ -31,6 +33,7 @@ import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.flow.ChangeBar; import org.apache.fop.fo.properties.CommonHyphenation; import org.apache.fop.traits.Direction; import org.apache.fop.traits.WritingMode; @@ -78,6 +81,11 @@ public class PageSequence extends Abstra private Flow mainFlow; /** + * Active change bars + */ + private final List<ChangeBar> changeBarList = new LinkedList<ChangeBar>(); + + /** * Create a PageSequence instance that is a child of the * given {@link FONode}. * @@ -118,6 +126,7 @@ public class PageSequence extends Abstra masterReference, getLocator()); } } + getRoot().addPageSequence(this); getFOEventHandler().startPageSequence(this); } @@ -464,4 +473,73 @@ public class PageSequence extends Abstra return pageSequenceMaster.getLastSimplePageMaster(isOddPage, isFirstPage, isBlank, getMainFlow() .getFlowName()); } + + /** + * Adds the specified change bar to the active change bar list. + * + * @param changeBarBegin The starting change bar element + */ + public void pushChangeBar(ChangeBar changeBarBegin) { + changeBarList.add(changeBarBegin); + } + + /** + * Removes the couple of the specified change bar from the active change bar list. + * + * @param changeBarEnd The ending change bar element + */ + public void popChangeBar(ChangeBar changeBarEnd) { + ChangeBar changeBarBegin = getChangeBarBegin(changeBarEnd); + if (changeBarBegin != null) { + changeBarList.remove(changeBarBegin); + } + } + + /** + * Returns the starting counterpart of the specified ending change bar. + * + * @param changeBarEnd The ending change bar element + * @return The starting counterpart of the specified ending change bar + */ + public ChangeBar getChangeBarBegin(ChangeBar changeBarEnd) { + if (changeBarList.isEmpty()) { + return null; + } else { + String changeBarClass = changeBarEnd.getChangeBarClass(); + for (int i = changeBarList.size() - 1; i >= 0; i--) { + ChangeBar changeBar = changeBarList.get(i); + if (changeBar.getChangeBarClass().equals(changeBarClass)) { + return changeBar; + } + } + } + return null; + } + + /** + * Tests if there are any active change bars. + * + * @return A boolean value true if there are any active change bars + */ + public boolean hasChangeBars() { + return !changeBarList.isEmpty(); + } + + /** + * Returns the list of active change bars. + * + * @return The list of active change bars + */ + public List<ChangeBar> getChangeBarList() { + return changeBarList; + } + + /** + * Returns the copy of active change bars list. + * + * @return The list containing a copy of the active change bars + */ + public List<ChangeBar> getClonedChangeBarList() { + return new LinkedList<ChangeBar>(changeBarList); + } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/Root.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/Root.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/Root.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/fo/pagination/Root.java Thu Jul 5 11:29:01 2018 @@ -282,6 +282,28 @@ public class Root extends FObj implement } /** + * Adds the specified page sequence. + * + * @param pageSequence The page sequence to add + */ + public void addPageSequence(PageSequence pageSequence) { + pageSequences.add(pageSequence); + } + + /** + * Returns the last page sequence (current while parsing). + * + * @return The last page sequence or null + */ + public PageSequence getLastPageSequence() { + if (getPageSequenceCount() > 0) { + return pageSequences.get(getPageSequenceCount() - 1); + } else { + return null; + } + } + + /** * Returns the associated LayoutMasterSet. * @return the LayoutMasterSet instance */ Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFac import org.apache.fop.datatypes.LengthBase; import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.flow.ChangeBar; /** * The base class for nearly all LayoutManagers. @@ -257,6 +258,19 @@ public abstract class AbstractBaseLayout return fobj; } + /** + * Returns the active change bar list. + * + * @return The active change bar list + */ + public List<ChangeBar> getChangeBarList() { + if (fobj == null) { + return null; + } else { + return fobj.getChangeBarList(); + } + } + /** {@inheritDoc} */ public void reset() { throw new UnsupportedOperationException("Not implemented"); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -854,6 +854,7 @@ public class BlockContainerLayoutManager int level = getBlockContainerFO().getBidiLevel(); viewportBlockArea = new BlockViewport(allowBPDUpdate); + viewportBlockArea.setChangeBarList(getChangeBarList()); viewportBlockArea.addTrait(Trait.IS_VIEWPORT_AREA, Boolean.TRUE); if (level >= 0) { viewportBlockArea.setBidiLevel(level); @@ -892,6 +893,7 @@ public class BlockContainerLayoutManager } referenceArea = new Block(); + referenceArea.setChangeBarList(getChangeBarList()); referenceArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); if (level >= 0) { referenceArea.setBidiLevel(level); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -357,6 +357,7 @@ public class BlockLayoutManager extends public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); curBlockArea.setIPD(super.getContentAreaIPD()); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -124,6 +124,7 @@ public abstract class BlockStackingLayou int sp = TraitSetter.getEffectiveSpace(adjust, minoptmax); if (sp != 0) { Block spacer = new Block(); + spacer.setChangeBarList(getChangeBarList()); spacer.setBPD(sp); parentLayoutManager.addChildArea(spacer); } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -178,6 +178,7 @@ public class ExternalDocumentLayoutManag Dimension imageSize = this.imageLayout.getViewportSize(); Block blockArea = new Block(); + blockArea.setChangeBarList(getChangeBarList()); blockArea.setIPD(imageSize.width); LineArea lineArea = new LineArea(); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java Thu Jul 5 11:29:01 2018 @@ -39,6 +39,8 @@ import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.BidiOverride; import org.apache.fop.fo.flow.Block; import org.apache.fop.fo.flow.BlockContainer; +import org.apache.fop.fo.flow.ChangeBarBegin; +import org.apache.fop.fo.flow.ChangeBarEnd; import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Float; @@ -146,6 +148,8 @@ public class LayoutManagerMapping implem registerMaker(TableHeader.class, new Maker()); registerMaker(Wrapper.class, new WrapperLayoutManagerMaker()); registerMaker(Title.class, new InlineLayoutManagerMaker()); + registerMaker(ChangeBarBegin.class, new Maker()); + registerMaker(ChangeBarEnd.class, new Maker()); registerMaker(MultiCase.class, new MultiCaseLayoutManagerMaker()); registerMaker(MultiSwitch.class, new MultiSwitchLayoutManagerMaker()); registerMaker(Float.class, new FloatLayoutManagerMaker()); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -133,6 +133,7 @@ public abstract class AbstractPageNumber getPSLM().addUnresolvedArea(citation.getRefId(), unresolved); text = unresolved; } + text.setChangeBarList(getChangeBarList()); setTraits(text); return text; } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -75,6 +75,7 @@ public class CharacterLayoutManager exte private TextArea createCharacterArea() { Character fobj = (Character) this.fobj; TextArea text = new TextArea(); + text.setChangeBarList(getChangeBarList()); char ch = fobj.getCharacter(); int ipd = font.getCharWidth(ch); int blockProgressionOffset = 0; Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -84,6 +84,7 @@ public class ContentLayoutManager extend // get breaks then add areas to title this.parentLM = pslm; holder = new LineArea(); + holder.setChangeBarList(getChangeBarList()); // setUserAgent(foTitle.getUserAgent()); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -42,7 +42,9 @@ public class ExternalGraphicLayoutManage /** {@inheritDoc} */ protected Area getChildArea() { - return new Image(((ExternalGraphic) fobj).getSrc()); + Image im = new Image(((ExternalGraphic) fobj).getSrc()); + im.setChangeBarList(getChangeBarList()); + return im; } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -206,9 +206,11 @@ public class InlineLayoutManager extends InlineArea area; if (isInline) { area = createInlineParent(); + area.setChangeBarList(getChangeBarList()); area.setBlockProgressionOffset(0); } else { area = new InlineBlockParent(); + area.setChangeBarList(getChangeBarList()); } if (fobj instanceof Inline || fobj instanceof BasicLink) { TraitSetter.setProducerID(area, fobj.getId()); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -181,6 +181,7 @@ public abstract class InlineStackingLayo if (iAdjust != 0) { //getLogger().debug("Add leading space: " + iAdjust); Space ls = new Space(); + ls.setChangeBarList(getChangeBarList()); ls.setIPD(iAdjust); int level = parentArea.getBidiLevel(); if (level >= 0) { Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java Thu Jul 5 11:29:01 2018 @@ -46,7 +46,9 @@ public class InstreamForeignObjectLM ext org.w3c.dom.Document doc = child.getDOMDocument(); String ns = child.getNamespaceURI(); - return new ForeignObject(doc, ns); + ForeignObject obj = new ForeignObject(doc, ns); + obj.setChangeBarList(getChangeBarList()); + return obj; } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -217,6 +217,9 @@ public class LeaderLayoutManager extends leaderArea.setBidiLevel(fobj.getBidiLevelRecursive()); } } + + leaderArea.setChangeBarList(getChangeBarList()); + TraitSetter.setProducerID(leaderArea, fobj.getId()); return leaderArea; } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -1504,6 +1504,8 @@ public class LineLayoutManager extends I LineArea lineArea = new LineArea( (lbp.getLeafPos() < seq.size() - 1 ? textAlignment : textAlignmentLast), lbp.difference, lbp.availableStretch, lbp.availableShrink); + lineArea.setChangeBarList(getChangeBarList()); + if (lbp.startIndent != 0) { lineArea.addTrait(Trait.START_INDENT, lbp.startIndent); } @@ -1619,6 +1621,7 @@ public class LineLayoutManager extends I } LineArea lineArea = new LineArea(); + lineArea.setChangeBarList(getChangeBarList()); setCurrentArea(lineArea); LayoutContext lc = LayoutContext.newInstance(); lc.setAlignmentContext(alignmentContext); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -32,6 +32,7 @@ import org.apache.fop.area.Trait; import org.apache.fop.area.inline.TextArea; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FOText; +import org.apache.fop.fo.flow.ChangeBar; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontSelector; import org.apache.fop.fonts.GlyphMapping; @@ -312,6 +313,7 @@ public class TextLayoutManager extends L TextArea textArea = new TextAreaBuilder(realWidth, totalAdjust, context, firstMappingIndex, lastMappingIndex, context.isLastArea(), mapping.font).build(); + textArea.setChangeBarList(getChangeBarList()); // wordSpaceDim is computed in relation to wordSpaceIPD.opt // but the renderer needs to know the adjustment in relation @@ -411,6 +413,7 @@ public class TextLayoutManager extends L textArea = new TextArea(width.getStretch(), width.getShrink(), adjust); } + textArea.setChangeBarList(getChangeBarList()); } private void setInlineProgressionDimension() { @@ -1457,6 +1460,15 @@ public class TextLayoutManager extends L } + @Override + public List<ChangeBar> getChangeBarList() { + if (foText == null) { + return null; + } else { + return foText.getChangeBarList(); + } + } + /** {@inheritDoc} */ public String toString() { return super.toString() + "{" Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -68,10 +68,12 @@ public class WrapperLayoutManager extend if (parentLayoutManager instanceof BlockStackingLayoutManager && !(parentLayoutManager instanceof BlockLayoutManager)) { Block helperBlock = new Block(); + helperBlock.setChangeBarList(getChangeBarList()); TraitSetter.setProducerID(helperBlock, fobj.getId()); parentLayoutManager.addChildArea(helperBlock); } else { InlineArea area = getEffectiveArea(context); + area.setChangeBarList(getChangeBarList()); parentLayoutManager.addChildArea(area); } } Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -216,6 +216,7 @@ public class ListBlockLayoutManager exte public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); // Set up dimensions // Must get dimensions from parent area Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -176,6 +176,7 @@ public class ListItemContentLayoutManage public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); curBlockArea.setPositioning(Block.ABSOLUTE); // set position curBlockArea.setXOffset(xOffset); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -739,6 +739,7 @@ public class ListItemLayoutManager exten public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); // Set up dimensions /*Area parentArea =*/ parentLayoutManager.getParentArea(curBlockArea); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/RowPainter.java Thu Jul 5 11:29:01 2018 @@ -468,6 +468,7 @@ class RowPainter { //generate the block area Block block = new Block(); + block.setChangeBarList(tclm.getTableLM().getFObj().getChangeBarList()); block.setPositioning(Block.ABSOLUTE); block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); block.setIPD(ipd); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -179,6 +179,8 @@ public class TableAndCaptionLayoutManage public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); + // Set up dimensions // Must get dimensions from parent area Area parentArea = parentLayoutManager.getParentArea(curBlockArea); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -175,6 +175,8 @@ public class TableCaptionLayoutManager e public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); + // Set up dimensions // Must get dimensions from parent area Area parentArea = parentLayoutManager.getParentArea(curBlockArea); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -529,11 +529,13 @@ public class TableCellLayoutManager exte if (usedBPD < cellBPD) { if (getTableCell().getDisplayAlign() == EN_CENTER) { Block space = new Block(); + space.setChangeBarList(getChangeBarList()); space.setBPD((cellBPD - usedBPD) / 2); space.setBidiLevel(getTableCell().getBidiLevelRecursive()); curBlockArea.addBlock(space); } else if (getTableCell().getDisplayAlign() == EN_AFTER) { Block space = new Block(); + space.setChangeBarList(getChangeBarList()); space.setBPD(cellBPD - usedBPD); space.setBidiLevel(getTableCell().getBidiLevelRecursive()); curBlockArea.addBlock(space); @@ -620,6 +622,7 @@ public class TableCellLayoutManager exte boolean outer, int level) { if (blocks[i][j] == null) { blocks[i][j] = new Block(); + blocks[i][j].setChangeBarList(getChangeBarList()); blocks[i][j].addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); blocks[i][j].setPositioning(Block.ABSOLUTE); blocks[i][j].setBidiLevel(level); @@ -651,6 +654,7 @@ public class TableCellLayoutManager exte int paddingEnd = padding.getPaddingEnd(false, this); Block block = new Block(); + block.setChangeBarList(getChangeBarList()); TraitSetter.setProducerID(block, getTable().getId()); block.setPositioning(Block.ABSOLUTE); block.setIPD(cellIPD + paddingStart + paddingEnd); @@ -677,6 +681,7 @@ public class TableCellLayoutManager exte public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); curBlockArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); TraitSetter.setProducerID(curBlockArea, getTableCell().getId()); curBlockArea.setPositioning(Block.ABSOLUTE); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java Thu Jul 5 11:29:01 2018 @@ -438,6 +438,8 @@ public class TableLayoutManager extends public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); + curBlockArea.setChangeBarList(getChangeBarList()); + // Set up dimensions // Must get dimensions from parent area /*Area parentArea =*/ parentLayoutManager.getParentArea(curBlockArea); Modified: xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractPathOrientedRenderer.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractPathOrientedRenderer.java?rev=1835125&r1=1835124&r2=1835125&view=diff ============================================================================== --- xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractPathOrientedRenderer.java (original) +++ xmlgraphics/fop/branches/Temp_ChangeBars2/fop-core/src/main/java/org/apache/fop/render/AbstractPathOrientedRenderer.java Thu Jul 5 11:29:01 2018 @@ -736,6 +736,7 @@ public abstract class AbstractPathOrient // save position and offset int saveIP = currentIPPosition; int saveBP = currentBPPosition; + int saveBO = getBeginOffset(); //Establish a new coordinate system AffineTransform at = new AffineTransform(); @@ -743,6 +744,8 @@ public abstract class AbstractPathOrient at.translate(block.getXOffset(), block.getYOffset()); at.translate(0, block.getSpaceBefore()); + setBeginOffset(saveBO - block.getXOffset()); + if (!at.isIdentity()) { establishTransformationMatrix(at); } @@ -760,6 +763,8 @@ public abstract class AbstractPathOrient restoreGraphicsState(); } + setBeginOffset(saveBO); + // stacked and relative blocks effect stacking currentIPPosition = saveIP; currentBPPosition = saveBP; --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org