public void selectAll() { _selectionStart = 0; _selectionEnd = (short)getSubstring().length(); }
public String getSelection() { return getSubstring().substring(_selectionStart, _selectionEnd); }
public void selectAll() { _selectionStart = 0; _selectionEnd = (short)getSubstring().length(); }
public String getSelection() { return getSubstring().substring(_selectionStart, _selectionEnd); }
public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineText: "); if (_containedLF || isDynamicFunction()) { result.append("("); if (_containedLF) { result.append('L'); } if (isDynamicFunction()) { result.append('F'); } result.append(") "); } result.append('('); result.append(getSubstring()); result.append(')'); return result.toString(); }
public String getTextExportText() { char[] ch = getSubstring().toCharArray(); StringBuffer result = new StringBuffer(); if (isTrimmedLeadingSpace()) { result.append(' '); } for (int i = 0; i < ch.length; i++) { char c = ch[i]; if (c != '\n') { result.append(c); } } if (isTrimmedTrailingSpace()) { result.append(' '); } return result.toString(); }
public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineText: "); if (_containedLF || isDynamicFunction()) { result.append("("); if (_containedLF) { result.append('L'); } if (isDynamicFunction()) { result.append('F'); } result.append(") "); } result.append('('); result.append(getSubstring()); result.append(')'); return result.toString(); }
public String getTextExportText() { char[] ch = getSubstring().toCharArray(); StringBuffer result = new StringBuffer(); if (isTrimmedLeadingSpace()) { result.append(' '); } for (int i = 0; i < ch.length; i++) { char c = ch[i]; if (c != '\n') { result.append(c); } } if (isTrimmedTrailingSpace()) { result.append(' '); } return result.toString(); }
public float calcTotalAdjustment(JustificationInfo info) { String s = getSubstring(); int len = s.length(); float result = 0.0f; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { result += info.getSpaceAdjust(); } else { result += info.getNonSpaceAdjust(); } } return result; } public int getStart(){
public float calcTotalAdjustment(JustificationInfo info) { String s = getSubstring(); int len = s.length(); float result = 0.0f; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { result += info.getSpaceAdjust(); } else { result += info.getNonSpaceAdjust(); } } return result; } public int getStart(){
public void countJustifiableChars(CharCounts counts) { String s = getSubstring(); int len = s.length(); int spaces = 0; int other = 0; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { spaces++; } else { other++; } } counts.setSpaceCount(counts.getSpaceCount() + spaces); counts.setNonSpaceCount(counts.getNonSpaceCount() + other); }
public void countJustifiableChars(CharCounts counts) { String s = getSubstring(); int len = s.length(); int spaces = 0; int other = 0; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { spaces++; } else { other++; } } counts.setSpaceCount(counts.getSpaceCount() + spaces); counts.setNonSpaceCount(counts.getNonSpaceCount() + other); }
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) { FSFont font = iB.getStyle().getFSFont(c); c.getOutputDevice(), font, inlineText.getSubstring());
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 drawText(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring();