int leaderWidth = iB.getContainingBlockWidth() - iB.getLineBox().getWidth() + text.getWidth(); int count = (int) ((leaderWidth - (2 * spaceWidth)) / valueWidth);
int leaderWidth = iB.getContainingBlockWidth() - iB.getLineBox().getWidth() + text.getWidth(); int count = (int) ((leaderWidth - (2 * spaceWidth)) / valueWidth);
InlineText txt = (InlineText) o; if (txt.getTextNode() != null) { if ((e.getX() >= x + txt.getX() && e.getX() < x + txt.getX() + txt.getWidth()) || containsWholeIlb) { fndTxt = txt;
InlineText txt = (InlineText) o; if (txt.getTextNode() != null) { if ((e.getX() >= x + txt.getX() && e.getX() < x + txt.getX() + txt.getWidth()) || containsWholeIlb) { fndTxt = txt;
private static int positionHorizontally(CssContext c, InlineLayoutBox current, int start) { int x = start; x += current.getLeftMarginBorderPadding(c); for (int i = 0; i < current.getInlineChildCount(); i++) { Object child = current.getInlineChild(i); if (child instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox) child; iB.setX(x); x += positionHorizontally(c, iB, x); } else if (child instanceof InlineText) { InlineText iT = (InlineText) child; iT.setX(x - start); x += iT.getWidth(); } else if (child instanceof Box) { Box b = (Box) child; b.setX(x); x += b.getWidth(); } } x += current.getRightMarginPaddingBorder(c); current.setInlineWidth(x - start); return x - start; }
private static int positionHorizontally(CssContext c, InlineLayoutBox current, int start) { int x = start; x += current.getLeftMarginBorderPadding(c); for (int i = 0; i < current.getInlineChildCount(); i++) { Object child = current.getInlineChild(i); if (child instanceof InlineLayoutBox) { InlineLayoutBox iB = (InlineLayoutBox) child; iB.setX(x); x += positionHorizontally(c, iB, x); } else if (child instanceof InlineText) { InlineText iT = (InlineText) child; iT.setX(x - start); x += iT.getWidth(); } else if (child instanceof Box) { Box b = (Box) child; b.setX(x); x += b.getWidth(); } } x += current.getRightMarginPaddingBorder(c); current.setInlineWidth(x - start); return x - start; }
boolean allSelected = (text.length() == inlineText.getSelectionEnd()-inlineText.getSelectionStart()); int startX = (inlineText.getSelectionStart() == inlineText.getStart())?iB.getAbsX() + inlineText.getX():(int)Math.round(start.x/scaleX); int endX = (allSelected)?startX+inlineText.getWidth():(int)Math.round((end.x + end.width)/scaleX); _graphics.setColor(UIManager.getColor("TextArea.selectionBackground")); // FIXME fillRect(
boolean allSelected = (text.length() == inlineText.getSelectionEnd()-inlineText.getSelectionStart()); int startX = (inlineText.getSelectionStart() == inlineText.getStart())?iB.getAbsX() + inlineText.getX():(int)Math.round(start.x/scaleX); int endX = (allSelected)?startX+inlineText.getWidth():(int)Math.round((end.x + end.width)/scaleX); _graphics.setColor(UIManager.getColor("TextArea.selectionBackground")); // FIXME fillRect(
private static InlineLayoutBox addFirstLetterBox(LayoutContext c, LineBox current, InlineLayoutBox currentIB, LineBreakContext lbContext, int maxAvailableWidth, int remainingWidth) { CalculatedStyle previous = currentIB.getStyle(); currentIB.setStyle(c.getFirstLettersTracker().deriveAll(currentIB.getStyle())); InlineLayoutBox iB = new InlineLayoutBox(c, null, currentIB.getStyle(), maxAvailableWidth); iB.setStartsHere(true); iB.setEndsHere(true); currentIB.addInlineChild(c, iB); current.setContainsContent(true); InlineText text = layoutText(c, iB.getStyle(), remainingWidth, lbContext, true); iB.addInlineChild(c, text); iB.setInlineWidth(text.getWidth()); lbContext.setStart(lbContext.getEnd()); c.getFirstLettersTracker().clearStyles(); currentIB.setStyle(previous); return iB; }
private static InlineLayoutBox addFirstLetterBox(LayoutContext c, LineBox current, InlineLayoutBox currentIB, LineBreakContext lbContext, int maxAvailableWidth, int remainingWidth) { CalculatedStyle previous = currentIB.getStyle(); currentIB.setStyle(c.getFirstLettersTracker().deriveAll(currentIB.getStyle())); InlineLayoutBox iB = new InlineLayoutBox(c, null, currentIB.getStyle(), maxAvailableWidth); iB.setStartsHere(true); iB.setEndsHere(true); currentIB.addInlineChild(c, iB); current.setContainsContent(true); InlineText text = layoutText(c, iB.getStyle(), remainingWidth, lbContext, true); iB.addInlineChild(c, text); iB.setInlineWidth(text.getWidth()); lbContext.setStart(lbContext.getEnd()); c.getFirstLettersTracker().clearStyles(); currentIB.setStyle(previous); return iB; }
currentLine.setContainsContent(true); lbContext.setStart(lbContext.getEnd()); remainingWidth -= inlineText.getWidth();
currentLine.setContainsContent(true); lbContext.setStart(lbContext.getEnd()); remainingWidth -= inlineText.getWidth();