private Box getElementContainerBox(InlineText t) { Box b = t.getParent(); while (b.getElement() == null) { b = b.getParent(); } return b; }
private Box getElementContainerBox(InlineText t) { Box b = t.getParent(); while (b.getElement() == null) { b = b.getParent(); } return b; }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
public String calculate(RenderingContext c, FSFunction function, InlineText text) { String uri = text.getParent().getElement().getAttribute("href"); if (uri != null && uri.startsWith("#")) { String anchor = uri.substring(1); Box target = c.getBoxById(anchor); if (target != null) { PageBox targetPage = c.getRootLayer().getPage(c, target.getAbsY()); return CounterFunction.createCounterText(IdentValue.DECIMAL, targetPage.getPageNo()+1); } } return ""; }
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); } } }
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 moveDot(ViewModelInfo pos) { this.dotInfo = pos; if (this.markInfo == null) { this.markInfo = pos; } fireStateChanged(); updateHighlights(); updateSystemSelection(); InlineText iT = this.dotInfo.text; InlineLayoutBox iB = iT.getParent(); adjustVisibility(new Rectangle(iB.getAbsX() + iT.getX(), iB.getAbsY(), 1, iB.getBaseline())); }
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 moveDot(ViewModelInfo pos) { this.dotInfo = pos; if (this.markInfo == null) { this.markInfo = pos; } fireStateChanged(); updateHighlights(); updateSystemSelection(); InlineText iT = this.dotInfo.text; InlineLayoutBox iB = iT.getParent(); adjustVisibility(new Rectangle(iB.getAbsX() + iT.getX(), iB.getAbsY(), 1, iB.getBaseline())); }
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); } }
private void drawFontMetrics(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); setColor(new FSRGBColor(0xFF, 0x33, 0xFF)); FSFontMetrics fm = iB.getStyle().getFSFontMetrics(null); int width = c.getTextRenderer().getWidth( c.getFontContext(), iB.getStyle().getFSFont(c), text); int x = iB.getAbsX() + inlineText.getX(); int y = iB.getAbsY() + iB.getBaseline(); drawLine(x, y, x + width, y); y += (int) Math.ceil(fm.getDescent()); drawLine(x, y, x + width, y); y -= (int) Math.ceil(fm.getDescent()); y -= (int) Math.ceil(fm.getAscent()); drawLine(x, y, x + width, y); }
private void drawFontMetrics(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); setColor(new FSRGBColor(0xFF, 0x33, 0xFF)); FSFontMetrics fm = iB.getStyle().getFSFontMetrics(null); int width = c.getTextRenderer().getWidth( c.getFontContext(), iB.getStyle().getFSFont(c), text); int x = iB.getAbsX() + inlineText.getX(); int y = iB.getAbsY() + iB.getBaseline(); drawLine(x, y, x + width, y); y += (int) Math.ceil(fm.getDescent()); drawLine(x, y, x + width, y); y -= (int) Math.ceil(fm.getDescent()); y -= (int) Math.ceil(fm.getAscent()); drawLine(x, y, x + width, y); }
public void drawSelection(RenderingContext c, InlineText inlineText) { if (inlineText.isSelected()) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); if (text != null && text.length() > 0) {
public void drawText(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); setColor(iB.getStyle().getColor()); setFont(iB.getStyle().getFSFont(c)); if (inlineText.getParent().getStyle().isTextJustify()) { JustificationInfo info = inlineText.getParent().getLineBox().getJustificationInfo(); if (info != null) { c.getTextRenderer().drawString(