to "instanceof InlineLevelLayoutManager", because AFAICT there is a 1-to-1 mapping between the two. If no one has problems with this, I will be removing the generatesInlineAreas() implementations next. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198736 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_90-alpha1
@@ -175,25 +175,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants | |||
return null; | |||
} | |||
public KnuthElement addALetterSpaceTo(KnuthElement element) { | |||
log.warn("null implementation of addALetterSpaceTo() called!"); | |||
return element; | |||
} | |||
public void getWordChars(StringBuffer sbChars, Position bp1, | |||
Position bp2) { | |||
log.warn("null implementation of getWordChars() called!"); | |||
} | |||
public void hyphenate(Position pos, HyphContext hc) { | |||
log.warn("null implementation of hyphenate called!"); | |||
} | |||
public boolean applyChanges(List oldList) { | |||
log.warn("null implementation of applyChanges() called!"); | |||
return false; | |||
} | |||
public LinkedList getChangedKnuthElements(List oldList, | |||
/*int flaggedPenalty,*/ | |||
int alignment) { |
@@ -125,7 +125,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { | |||
while (proxyLMiter.hasNext()) { | |||
LayoutManager lm = (LayoutManager) proxyLMiter.next(); | |||
if (lm.generatesInlineAreas()) { | |||
if (lm instanceof InlineLevelLayoutManager) { | |||
LineLayoutManager lineLM = createLineManager(lm); | |||
addChildLM(lineLM); | |||
} else { | |||
@@ -151,7 +151,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { | |||
inlines.add(firstlm); | |||
while (proxyLMiter.hasNext()) { | |||
LayoutManager lm = (LayoutManager) proxyLMiter.next(); | |||
if (lm.generatesInlineAreas()) { | |||
if (lm instanceof InlineLevelLayoutManager) { | |||
inlines.add(lm); | |||
} else { | |||
proxyLMiter.previous(); |
@@ -166,24 +166,6 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { | |||
(((org.apache.fop.area.inline.Character) curArea).getChar()); | |||
} | |||
public KnuthElement addALetterSpaceTo(KnuthElement element) { | |||
areaInfo.iLScount ++; | |||
areaInfo.ipdArea.add(letterSpaceIPD); | |||
if (letterSpaceIPD.min == letterSpaceIPD.max) { | |||
// constant letter space, return a new box | |||
return new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead, | |||
areaInfo.total, areaInfo.middle, | |||
new LeafPosition(this, 0), false); | |||
} else { | |||
// adjustable letter space, return a new glue | |||
return new KnuthGlue(letterSpaceIPD.opt, | |||
letterSpaceIPD.max - letterSpaceIPD.opt, | |||
letterSpaceIPD.opt - letterSpaceIPD.min, | |||
new LeafPosition(this, -1), true); | |||
} | |||
} | |||
public void hyphenate(Position pos, HyphContext hc) { | |||
if (hc.getNextHyphPoint() == 1) { | |||
// the character ends a syllable |
@@ -218,10 +218,6 @@ public class ContentLayoutManager implements InlineLevelLayoutManager { | |||
//to be done | |||
} | |||
/** @see org.apache.fop.layoutmgr.LayoutManager */ | |||
public void getWordChars(StringBuffer sbChars, Position bp1, | |||
Position bp2) { } | |||
/** | |||
* @see org.apache.fop.layoutmgr.LayoutManager#createNextChildLMs | |||
*/ |
@@ -78,7 +78,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager | |||
LinkedList returnList = new LinkedList(); | |||
while ((curLM = ((BlockLevelLayoutManager) getChildLM())) != null) { | |||
if (curLM.generatesInlineAreas()) { | |||
if (curLM instanceof InlineLevelLayoutManager) { | |||
log.error("inline area not allowed under flow - ignoring"); | |||
curLM.setFinished(true); | |||
continue; |
@@ -65,18 +65,6 @@ public interface LayoutManager { | |||
*/ | |||
void resetPosition(Position position); | |||
/** | |||
* Get the word chars between two positions and | |||
* append to the string buffer. The positions could | |||
* span multiple layout managers. | |||
* | |||
* @param sbChars the string buffer to append the word chars | |||
* @param bp1 the start position | |||
* @param bp2 the end position | |||
*/ | |||
void getWordChars(StringBuffer sbChars, Position bp1, | |||
Position bp2); | |||
/** | |||
* Return a value indicating whether this LayoutManager has laid out | |||
* all its content (or generated BreakPossibilities for all content.) |
@@ -219,7 +219,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker { | |||
super.make(node, childList); | |||
for (int count = childList.size() - 1; count >= 0; count--) { | |||
LayoutManager lm = (LayoutManager) childList.get(count); | |||
if (lm.generatesInlineAreas()) { | |||
if (lm instanceof InlineLevelLayoutManager) { | |||
LayoutManager blm = new BidiLayoutManager | |||
(node, (InlineLayoutManager) lm); | |||
lms.add(blm); |
@@ -281,14 +281,6 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { | |||
return returnList; | |||
} | |||
public KnuthElement addALetterSpaceTo(KnuthElement element) { | |||
// return the unchanged glue object | |||
return new KnuthGlue(areaInfo.ipdArea.opt, | |||
areaInfo.ipdArea.max - areaInfo.ipdArea.opt, | |||
areaInfo.ipdArea.opt - areaInfo.ipdArea.min, | |||
new LeafPosition(this, 0), false); | |||
} | |||
public void hyphenate(Position pos, HyphContext hc) { | |||
// use the AbstractLayoutManager.hyphenate() null implementation | |||
super.hyphenate(pos, hc); |
@@ -27,7 +27,6 @@ import org.apache.fop.hyphenation.Hyphenator; | |||
import org.apache.fop.area.LineArea; | |||
import java.util.ListIterator; | |||
import java.util.Iterator; | |||
import java.util.List; | |||
import java.util.ArrayList; | |||
import java.util.LinkedList; |
@@ -79,7 +79,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { | |||
LinkedList returnList = new LinkedList(); | |||
while ((curLM = ((BlockLevelLayoutManager) getChildLM())) != null) { | |||
if (curLM.generatesInlineAreas()) { | |||
if (curLM instanceof InlineLevelLayoutManager) { | |||
log.error("inline area not allowed under flow - ignoring"); | |||
curLM.setFinished(true); | |||
continue; |
@@ -194,30 +194,6 @@ public class TextLayoutManager extends LeafNodeLayoutManager { | |||
return true; | |||
} | |||
/** | |||
* Get the word characters between two positions. | |||
* This is used when doing hyphenation or other word manipulations. | |||
* | |||
* @param sbChars the string buffer to put the chars into | |||
* @param bp1 the start position | |||
* @param bp2 the end position | |||
*/ | |||
public void getWordChars(StringBuffer sbChars, Position bp1, | |||
Position bp2) { | |||
LeafPosition endPos = (LeafPosition) bp2; | |||
AreaInfo ai = | |||
(AreaInfo) vecAreaInfo.get(endPos.getLeafPos()); | |||
// Skip all leading spaces for hyphenation | |||
int i; | |||
for (i = ai.iStartIndex; | |||
i < ai.iBreakIndex | |||
&& CharUtilities.isAnySpace(textArray[i]) == true; | |||
i++) { | |||
//nop | |||
} | |||
sbChars.append(new String(textArray, i, ai.iBreakIndex - i)); | |||
} | |||
/** | |||
* Reset position for returning next BreakPossibility. | |||
* |