git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ProcessingFeedback@638302 13f79535-47bb-0310-9956-ffa450edef68Temp_ProcessingFeedback
<message key="org.apache.fop.events.ResourceEventProducer.imageError">Image not available. URI: {uri}. Reason: {e}{{locator}}</message> | <message key="org.apache.fop.events.ResourceEventProducer.imageError">Image not available. URI: {uri}. Reason: {e}{{locator}}</message> | ||||
<message key="org.apache.fop.events.ResourceEventProducer.imageIOError">I/O error while loading image. URI: {uri}. Reason: {ioe}{{locator}}</message> | <message key="org.apache.fop.events.ResourceEventProducer.imageIOError">I/O error while loading image. URI: {uri}. Reason: {ioe}{{locator}}</message> | ||||
<message key="org.apache.fop.events.ResourceEventProducer.ifoNoIntrinsiceSize">The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}}</message> | <message key="org.apache.fop.events.ResourceEventProducer.ifoNoIntrinsiceSize">The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}}</message> | ||||
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.leaderWithoutContent">fo:leader is set to "use-content" but has no content.{{locator}}</message> | |||||
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.lineOverflows">Line {line} of a paragraph overflows the available area by {overflowLength,choice,50000#{overflowLength} millipoints|50000<more than 50 points}.{{locator}}</message> | |||||
</catalogue> | </catalogue> |
package org.apache.fop.layoutmgr.inline; | package org.apache.fop.layoutmgr.inline; | ||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import java.util.LinkedList; | |||||
import java.util.List; | |||||
import java.util.ListIterator; | |||||
import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
import org.apache.commons.logging.LogFactory; | import org.apache.commons.logging.LogFactory; | ||||
import org.apache.fop.apps.FOUserAgent; | |||||
import org.apache.fop.area.Area; | |||||
import org.apache.fop.area.Block; | |||||
import org.apache.fop.area.LineArea; | |||||
import org.apache.fop.area.inline.InlineArea; | |||||
import org.apache.fop.fo.Constants; | import org.apache.fop.fo.Constants; | ||||
import org.apache.fop.fo.pagination.Title; | import org.apache.fop.fo.pagination.Title; | ||||
import org.apache.fop.layoutmgr.AbstractBaseLayoutManager; | import org.apache.fop.layoutmgr.AbstractBaseLayoutManager; | ||||
import org.apache.fop.layoutmgr.Position; | import org.apache.fop.layoutmgr.Position; | ||||
import org.apache.fop.layoutmgr.PositionIterator; | import org.apache.fop.layoutmgr.PositionIterator; | ||||
import org.apache.fop.layoutmgr.SpaceSpecifier; | import org.apache.fop.layoutmgr.SpaceSpecifier; | ||||
import org.apache.fop.area.Area; | |||||
import org.apache.fop.area.LineArea; | |||||
import org.apache.fop.area.inline.InlineArea; | |||||
import java.util.LinkedList; | |||||
import java.util.List; | |||||
import java.util.ListIterator; | |||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import org.apache.fop.traits.MinOptMax; | import org.apache.fop.traits.MinOptMax; | ||||
import org.apache.fop.area.Block; | |||||
/** | /** | ||||
* Content Layout Manager. | * Content Layout Manager. | ||||
* For use with objects that contain inline areas such as | * For use with objects that contain inline areas such as | ||||
*/ | */ | ||||
private static Log log = LogFactory.getLog(ContentLayoutManager.class); | private static Log log = LogFactory.getLog(ContentLayoutManager.class); | ||||
private FOUserAgent userAgent; | |||||
private Area holder; | private Area holder; | ||||
private int stackSize; | private int stackSize; | ||||
private LayoutManager parentLM; | private LayoutManager parentLM; |
/* | |||||
* 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.layoutmgr.inline; | |||||
import org.xml.sax.Locator; | |||||
import org.apache.fop.events.EventBroadcaster; | |||||
import org.apache.fop.events.EventProducer; | |||||
/** | |||||
* Event producer interface for inline-level layout managers. | |||||
*/ | |||||
public interface InlineLevelEventProducer extends EventProducer { | |||||
/** | |||||
* Factory class for the event producer. | |||||
*/ | |||||
class Factory { | |||||
/** | |||||
* Creates a new event producer. | |||||
* @param broadcaster the event broadcaster to use | |||||
* @return the new event producer | |||||
*/ | |||||
public static InlineLevelEventProducer create(EventBroadcaster broadcaster) { | |||||
return (InlineLevelEventProducer)broadcaster.getEventProducerFor( | |||||
InlineLevelEventProducer.class); | |||||
} | |||||
} | |||||
/** | |||||
* fo:leader with "use-content" but without children. | |||||
* @param source the event source | |||||
* @param loc the location of the error or null | |||||
* @event.severity ERROR | |||||
*/ | |||||
void leaderWithoutContent(Object source, Locator loc); | |||||
/** | |||||
* A line overflows. | |||||
* @param source the event source | |||||
* @param line the number number | |||||
* @param overflowLength the length by which the content overflows the available space (in mpt) | |||||
* @param loc the location of the error or null | |||||
* @event.severity WARN | |||||
*/ | |||||
void lineOverflows(Object source, int line, int overflowLength, Locator loc); | |||||
} |
package org.apache.fop.layoutmgr.inline; | package org.apache.fop.layoutmgr.inline; | ||||
import java.util.LinkedList; | |||||
import java.util.List; | |||||
import org.apache.fop.area.Trait; | import org.apache.fop.area.Trait; | ||||
import org.apache.fop.area.inline.FilledArea; | import org.apache.fop.area.inline.FilledArea; | ||||
import org.apache.fop.area.inline.InlineArea; | import org.apache.fop.area.inline.InlineArea; | ||||
import org.apache.fop.area.inline.Space; | import org.apache.fop.area.inline.Space; | ||||
import org.apache.fop.area.inline.TextArea; | import org.apache.fop.area.inline.TextArea; | ||||
import org.apache.fop.fo.FObj; | |||||
import org.apache.fop.fo.flow.Leader; | import org.apache.fop.fo.flow.Leader; | ||||
import org.apache.fop.fonts.Font; | import org.apache.fop.fonts.Font; | ||||
import org.apache.fop.fonts.FontInfo; | import org.apache.fop.fonts.FontInfo; | ||||
import org.apache.fop.layoutmgr.TraitSetter; | import org.apache.fop.layoutmgr.TraitSetter; | ||||
import org.apache.fop.traits.MinOptMax; | import org.apache.fop.traits.MinOptMax; | ||||
import java.util.List; | |||||
import java.util.LinkedList; | |||||
import org.apache.fop.fo.FObj; | |||||
/** | /** | ||||
* LayoutManager for the fo:leader formatting object | * LayoutManager for the fo:leader formatting object | ||||
*/ | */ | ||||
leaderArea = fa; | leaderArea = fa; | ||||
} else if (fobj.getLeaderPattern() == EN_USECONTENT) { | } else if (fobj.getLeaderPattern() == EN_USECONTENT) { | ||||
if (fobj.getChildNodes() == null) { | if (fobj.getChildNodes() == null) { | ||||
fobj.getLogger().error("Leader use-content with no content"); | |||||
InlineLevelEventProducer eventProducer = InlineLevelEventProducer.Factory.create( | |||||
getFObj().getUserAgent().getEventBroadcaster()); | |||||
eventProducer.leaderWithoutContent(this, getFObj().getLocator()); | |||||
return null; | return null; | ||||
} | } | ||||
getPSLM().addIDToPage(fobj.getId()); | getPSLM().addIDToPage(fobj.getId()); | ||||
} | } | ||||
/** | |||||
* {@inheritDoc} | |||||
*/ | |||||
/** {@inheritDoc} */ | |||||
public int getBaseLength(int lengthBase, FObj fobj) { | public int getBaseLength(int lengthBase, FObj fobj) { | ||||
return getParent().getBaseLength(lengthBase, getParent().getFObj()); | return getParent().getBaseLength(lengthBase, getParent().getFObj()); | ||||
} | } |
import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
import org.apache.commons.logging.LogFactory; | import org.apache.commons.logging.LogFactory; | ||||
import org.apache.fop.area.Area; | import org.apache.fop.area.Area; | ||||
import org.apache.fop.area.LineArea; | import org.apache.fop.area.LineArea; | ||||
import org.apache.fop.area.Trait; | import org.apache.fop.area.Trait; | ||||
import org.apache.fop.datatypes.Length; | import org.apache.fop.datatypes.Length; | ||||
import org.apache.fop.datatypes.Numeric; | import org.apache.fop.datatypes.Numeric; | ||||
import org.apache.fop.fo.Constants; | import org.apache.fop.fo.Constants; | ||||
import org.apache.fop.fo.FONode; | |||||
import org.apache.fop.fo.flow.Block; | import org.apache.fop.fo.flow.Block; | ||||
import org.apache.fop.fo.properties.CommonHyphenation; | import org.apache.fop.fo.properties.CommonHyphenation; | ||||
import org.apache.fop.fonts.Font; | import org.apache.fop.fonts.Font; | ||||
if (log.isWarnEnabled()) { | if (log.isWarnEnabled()) { | ||||
int lack = difference + bestActiveNode.availableShrink; | int lack = difference + bestActiveNode.availableShrink; | ||||
if (lack < 0) { | if (lack < 0) { | ||||
InlineLevelEventProducer eventProducer | |||||
= InlineLevelEventProducer.Factory.create( | |||||
getFObj().getUserAgent().getEventBroadcaster()); | |||||
eventProducer.lineOverflows(this, addedPositions + 1, | |||||
-lack, getFObj().getLocator()); | |||||
String textDiff = (lack < -50000 ? "more than 50 points" : (-lack) + "mpt"); | String textDiff = (lack < -50000 ? "more than 50 points" : (-lack) + "mpt"); | ||||
log.warn(FONode.decorateWithContextInfo( | |||||
"Line " + (addedPositions + 1) | |||||
+ " of a paragraph overflows the available area by " | |||||
+ textDiff + ".", getFObj())); | |||||
} | } | ||||
} | } | ||||
auxCount++; | auxCount++; | ||||
} | } | ||||
} | } | ||||
log.trace(" Word to hyphenate: " + sbChars.toString()); | |||||
if (log.isTraceEnabled()) { | |||||
log.trace(" Word to hyphenate: " + sbChars.toString()); | |||||
} | |||||
// find hyphenation points | // find hyphenation points | ||||
HyphContext hc = getHyphenContext(sbChars); | HyphContext hc = getHyphenContext(sbChars); | ||||
// ask each LM to hyphenate its word fragment | // ask each LM to hyphenate its word fragment |