public void countJustifiableChars(CharCounts counts) { boolean justifyThis = getStyle().isTextJustify(); for (Iterator i = getInlineChildren().iterator(); i.hasNext(); ) { Object o = i.next(); if (o instanceof InlineLayoutBox) { ((InlineLayoutBox)o).countJustifiableChars(counts); } else if (o instanceof InlineText && justifyThis) { ((InlineText)o).countJustifiableChars(counts); } } }
public void countJustifiableChars(CharCounts counts) { boolean justifyThis = getStyle().isTextJustify(); for (Iterator i = getInlineChildren().iterator(); i.hasNext(); ) { Object o = i.next(); if (o instanceof InlineLayoutBox) { ((InlineLayoutBox)o).countJustifiableChars(counts); } else if (o instanceof InlineText && justifyThis) { ((InlineText)o).countJustifiableChars(counts); } } }
public void calculateTextDecoration(LayoutContext c) { List decorations = InlineBoxing.calculateTextDecorations(this, getBaseline(), getStyle().getFSFontMetrics(c)); setTextDecorations(decorations); }
public void trimTrailingSpace(LayoutContext c) { InlineText text = findTrailingText(); if (text != null) { InlineLayoutBox iB = text.getParent(); IdentValue whitespace = iB.getStyle().getWhitespace(); if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP) { text.trimTrailingSpace(c); } } }
public void trimTrailingSpace(LayoutContext c) { InlineText text = findTrailingText(); if (text != null) { InlineLayoutBox iB = text.getParent(); IdentValue whitespace = iB.getStyle().getWhitespace(); if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP) { text.trimTrailingSpace(c); } } }
public void calculateTextDecoration(LayoutContext c) { List decorations = InlineBoxing.calculateTextDecorations(this, getBaseline(), getStyle().getFSFontMetrics(c)); setTextDecorations(decorations); }
private void ensureGlyphPositions(RenderingContext c) { if (_glyphPositions == null) { FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), getParent().getStyle().getFSFont(c), getSubstring()); _glyphPositions = c.getTextRenderer().getGlyphPositions( c.getOutputDevice(), getParent().getStyle().getFSFont(c), glyphVector); } }
private void ensureGlyphPositions(RenderingContext c) { if (_glyphPositions == null) { FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), getParent().getStyle().getFSFont(c), getSubstring()); _glyphPositions = c.getTextRenderer().getGlyphPositions( c.getOutputDevice(), getParent().getStyle().getFSFont(c), glyphVector); } }
public void updateDynamicValue(RenderingContext c) { String value = _functionData.getContentFunction().calculate( c, _functionData.getFunction(), this); _start = 0; _end = value.length(); _masterText = value; _width = c.getTextRenderer().getWidth( c.getFontContext(), getParent().getStyle().getFSFont(c), value); }
public void updateDynamicValue(RenderingContext c) { String value = _functionData.getContentFunction().calculate( c, _functionData.getFunction(), this); _start = 0; _end = value.length(); _masterText = value; _width = c.getTextRenderer().getWidth( c.getFontContext(), getParent().getStyle().getFSFont(c), value); }
public void trimTrailingSpace(LayoutContext c) { if (! isEmpty() && _masterText.charAt(_end-1) == ' ') { _end--; setWidth(c.getTextRenderer().getWidth(c.getFontContext(), getParent().getStyle().getFSFont(c), getSubstring())); setTrimmedTrailingSpace(true); } }
public void trimTrailingSpace(LayoutContext c) { if (! isEmpty() && _masterText.charAt(_end-1) == ' ') { _end--; setWidth(c.getTextRenderer().getWidth(c.getFontContext(), getParent().getStyle().getFSFont(c), getSubstring())); setTrimmedTrailingSpace(true); } }
public void calculateHeight(LayoutContext c) { BorderPropertySet border = getBorder(c); RectPropertySet padding = getPadding(c); FSFontMetrics metrics = getStyle().getFSFontMetrics(c); setHeight((int)Math.ceil(border.top() + padding.top() + metrics.getAscent() + metrics.getDescent() + padding.bottom() + border.bottom())); }
public void calculateHeight(LayoutContext c) { BorderPropertySet border = getBorder(c); RectPropertySet padding = getPadding(c); FSFontMetrics metrics = getStyle().getFSFontMetrics(c); setHeight((int)Math.ceil(border.top() + padding.top() + metrics.getAscent() + metrics.getDescent() + padding.bottom() + border.bottom())); }
public InlineLayoutBox copyOf() { InlineLayoutBox result = new InlineLayoutBox(); result.setElement(getElement()); result.setStyle(getStyle()); result.setHeight(getHeight()); result._pending = _pending; result.setContainingLayer(getContainingLayer()); return result; }
public InlineLayoutBox copyOf() { InlineLayoutBox result = new InlineLayoutBox(); result.setElement(getElement()); result.setStyle(getStyle()); result.setHeight(getHeight()); result._pending = _pending; result.setContainingLayer(getContainingLayer()); return result; }
public void drawTextDecoration( RenderingContext c, InlineLayoutBox iB, TextDecoration decoration) { setColor(iB.getStyle().getColor()); Rectangle edge = iB.getContentAreaEdge(iB.getAbsX(), iB.getAbsY(), c); fillRect(edge.x, iB.getAbsY() + decoration.getOffset(), edge.width, decoration.getThickness()); }
public void drawTextDecoration( RenderingContext c, InlineLayoutBox iB, TextDecoration decoration) { setColor(iB.getStyle().getColor()); Rectangle edge = iB.getContentAreaEdge(iB.getAbsX(), iB.getAbsY(), c); fillRect(edge.x, iB.getAbsY() + decoration.getOffset(), edge.width, decoration.getThickness()); }
public void unmarkPending(LayoutContext c) { _pending = false; if (getParent() instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)getParent(); if (iB.isPending()) { iB.unmarkPending(c); } } setStartsHere(true); if (getStyle().requiresLayer()) { c.pushLayer(this); getLayer().setInline(true); connectChildrenToCurrentLayer(c); } }
public void unmarkPending(LayoutContext c) { _pending = false; if (getParent() instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox)getParent(); if (iB.isPending()) { iB.unmarkPending(c); } } setStartsHere(true); if (getStyle().requiresLayer()) { c.pushLayer(this); getLayer().setInline(true); connectChildrenToCurrentLayer(c); } }