- borderPaddingWidth;
return MinOptMax.getInstance(min, opt, max);
}
private InlineArea getLeaderInlineArea(LayoutContext context) {
InlineArea leaderArea = null;
if (fobj.getLeaderPattern() == EN_RULE) {
if (fobj.getRuleStyle() != EN_NONE) {
org.apache.fop.area.inline.Leader leader
= new org.apache.fop.area.inline.Leader();
leader.setRuleStyle(fobj.getRuleStyle());
leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
leaderArea = leader;
} else {
leaderArea = new Space();
}
leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
leaderArea.addTrait(Trait.COLOR, fobj.getColor());
} else if (fobj.getLeaderPattern() == EN_SPACE) {
leaderArea = new Space();
leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
} else if (fobj.getLeaderPattern() == EN_DOTS) {
TextArea t = new TextArea();
char dot = '.'; // userAgent.getLeaderDotCharacter();
int width = font.getCharWidth(dot);
t.addWord("" + dot, 0);
t.setIPD(width);
t.setBPD(width);
t.setBaselineOffset(width);
TraitSetter.addFontTraits(t, font);
t.addTrait(Trait.COLOR, fobj.getColor());
Space spacer = null;
if (fobj.getLeaderPatternWidth().getValue(this) > width) {
spacer = new Space();
spacer.setIPD(fobj.getLeaderPatternWidth().getValue(this) - width);
width = fobj.getLeaderPatternWidth().getValue(this);
}
FilledArea fa = new FilledArea();
fa.setUnitWidth(width);
fa.addChildArea(t);
if (spacer != null) {
fa.addChildArea(spacer);
}
fa.setBPD(t.getBPD());
leaderArea = fa;
} else if (fobj.getLeaderPattern() == EN_USECONTENT) {
if (fobj.getChildNodes() == null) {
InlineLevelEventProducer eventProducer = InlineLevelEventProducer.Provider.get(
getFObj().getUserAgent().getEventBroadcaster());
eventProducer.leaderWithoutContent(this, getFObj().getLocator());
return null;
}
// child FOs are assigned to the InlineStackingLM
fobjIter = null;
// get breaks then add areas to FilledArea
FilledArea fa = new FilledArea();
clm = new ContentLayoutManager(fa, this);
addChildLM(clm);
InlineLayoutManager lm;
lm = new InlineLayoutManager(fobj);
clm.addChildLM(lm);
lm.initialize();
LayoutContext childContext = new LayoutContext(0);
childContext.setAlignmentContext(context.getAlignmentContext());
contentList = clm.getNextKnuthElements(childContext, 0);
int width = clm.getStackingSize();
if (width != 0) {
Space spacer = null;
if (fobj.getLeaderPatternWidth().getValue(this) > width) {
spacer = new Space();
spacer.setIPD(fobj.getLeaderPatternWidth().getValue(this) - width);
width = fobj.getLeaderPatternWidth().getValue(this);
}
fa.setUnitWidth(width);
if (spacer != null) {
fa.addChildArea(spacer);
}
leaderArea = fa;
} else {
//Content collapsed to nothing, so use a space
leaderArea = new Space();
leaderArea.setBPD(fobj.getRuleThickness().getValue(this));
}
}
TraitSetter.setProducerID(leaderArea, fobj.getId());
return leaderArea;
}