public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineLayoutBox: "); if (getElement() != null) { result.append("<"); result.append(getElement().getNodeName()); result.append("> "); } else { result.append("(anonymous) "); } if (isStartsHere() || isEndsHere()) { result.append("("); if (isStartsHere()) { result.append("S"); } if (isEndsHere()) { result.append("E"); } result.append(") "); } result.append("(baseline="); result.append(_baseline); result.append(") "); result.append("(" + getAbsX() + "," + getAbsY() + ")->(" + getInlineWidth() + " x " + getHeight() + ")"); return result.toString(); }
public String toString() { StringBuffer result = new StringBuffer(); result.append("InlineLayoutBox: "); if (getElement() != null) { result.append("<"); result.append(getElement().getNodeName()); result.append("> "); } else { result.append("(anonymous) "); } if (isStartsHere() || isEndsHere()) { result.append("("); if (isStartsHere()) { result.append("S"); } if (isEndsHere()) { result.append("E"); } result.append(") "); } result.append("(baseline="); result.append(_baseline); result.append(") "); result.append("(" + getAbsX() + "," + getAbsY() + ")->(" + getInlineWidth() + " x " + getHeight() + ")"); return result.toString(); }
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 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())); }
float[] positions = _glyphPositions; int y = getParent().getAbsY(); int offset = getParent().getAbsX() + getX();
float[] positions = _glyphPositions; int y = getParent().getAbsY(); int offset = getParent().getAbsX() + getX();
private ElementBox createElementBox(Styleable styleable, Element element) { if (styleable instanceof InlineLayoutBox) { final InlineLayoutBox box = (InlineLayoutBox) styleable; final int width = Math.max(box.getInlineWidth(), box.getWidth()); return new ElementBox(element, box.getAbsX(), box.getAbsY(), width, box.getHeight()); } if (styleable instanceof Box) { final Box box = (Box) styleable; return new ElementBox(element, box.getAbsX(), box.getAbsY(), box.getWidth(), box.getHeight()); } return null; }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { PaintingInfo pI = getPaintingInfo(); if (pI != null && ! pI.getAggregateBounds().contains(absX, absY)) { return null; } Box result = null; for (int i = 0; i < getInlineChildCount(); i++) { Object child = getInlineChild(i); if (child instanceof Box) { result = ((Box)child).find(cssCtx, absX, absY, findAnonymous); if (result != null) { return result; } } } Rectangle edge = getContentAreaEdge(getAbsX(), getAbsY(), cssCtx); result = edge.contains(absX, absY) && getStyle().isVisible() ? this : null; if (! findAnonymous && result != null && getElement() == null) { return getParent().getParent(); } else { return result; } }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { PaintingInfo pI = getPaintingInfo(); if (pI != null && ! pI.getAggregateBounds().contains(absX, absY)) { return null; } Box result = null; for (int i = 0; i < getInlineChildCount(); i++) { Object child = getInlineChild(i); if (child instanceof Box) { result = ((Box)child).find(cssCtx, absX, absY, findAnonymous); if (result != null) { return result; } } } Rectangle edge = getContentAreaEdge(getAbsX(), getAbsY(), cssCtx); result = edge.contains(absX, absY) && getStyle().isVisible() ? this : null; if (! findAnonymous && result != null && getElement() == null) { return getParent().getParent(); } else { 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()); }
for (int i = ilbs.size() - 1; i >= 0; i--) { InlineLayoutBox ilbt = (InlineLayoutBox) ilbs.get(i); if (ilbt.getAbsY() <= e.getY() && ilbt.getAbsX() <= e.getX()) { if (ilb == null || (ilbt.getAbsY() > ilb.getAbsY()) || (ilbt.getAbsY() == ilb.getAbsY() && ilbt.getX() > ilb.getX())) { int x = ilbt.getAbsX(); int x = ilb.getAbsX(); InlineText lastItxt = null; for (Iterator it = ilb.getInlineChildren().iterator(); it.hasNext();) {
glyphVector, inlineText.getSelectionStart(), iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline()); glyphVector, inlineText.getSelectionEnd() - 1, iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline()); Graphics2D graphics = getGraphics(); double scaleX = graphics.getTransform().getScaleX(); 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
glyphVector, inlineText.getSelectionStart(), iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline()); glyphVector, inlineText.getSelectionEnd() - 1, iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline()); Graphics2D graphics = getGraphics(); double scaleX = graphics.getTransform().getScaleX(); 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
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); }
c.getOutputDevice(), glyphVector, iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline());
c.getOutputDevice(), glyphVector, iB.getAbsX() + inlineText.getX(), iB.getAbsY() + iB.getBaseline());