Rectangle2D glBounds = layout.getBounds2D(); if ( glBounds == null ){ continue;
/** * Returns true if the specified Point2D is inside the boundary of this * node, false otherwise. * * @param p the specified Point2D in the user space */ public boolean contains(Point2D p) { // <!> FIXME: should put this code in TextPaint somewhere, // as pointer-events support - same problem with pointer-events // and ShapeNode if (!super.contains(p)) { return false; } List list = getTextRuns(); // place coords in text node coordinate system for (int i = 0 ; i < list.size(); i++) { StrokingTextPainter.TextRun run = (StrokingTextPainter.TextRun)list.get(i); TextSpanLayout layout = run.getLayout(); float x = (float)p.getX(); float y = (float)p.getY(); TextHit textHit = layout.hitTestChar(x, y); if (textHit != null && contains(p, layout.getBounds2D())) { return true; } } return false; }
Rectangle2D glBounds = layout.getBounds2D(); if (glBounds == null) { continue;
Rectangle2D glBounds = layout.getBounds2D(); if (glBounds == null) { continue;
/** * Returns true if the specified Point2D is inside the boundary of this * node, false otherwise. * * @param p the specified Point2D in the user space */ public boolean contains(Point2D p) { // <!> FIXME: should put this code in TextPaint somewhere, // as pointer-events support - same problem with pointer-events // and ShapeNode if (!super.contains(p)) { return false; } List list = getTextRuns(); // place coords in text node coordinate system for (Object aList : list) { StrokingTextPainter.TextRun run = (StrokingTextPainter.TextRun) aList; TextSpanLayout layout = run.getLayout(); float x = (float) p.getX(); float y = (float) p.getY(); TextHit textHit = layout.hitTestChar(x, y); if (textHit != null && contains(p, layout.getBounds2D())) { return true; } } return false; }
/** * Returns true if the specified Point2D is inside the boundary of this * node, false otherwise. * * @param p the specified Point2D in the user space */ public boolean contains(Point2D p) { // <!> FIXME: should put this code in TextPaint somewhere, // as pointer-events support - same problem with pointer-events // and ShapeNode if (!super.contains(p)) { return false; } List list = getTextRuns(); // place coords in text node coordinate system for (Object aList : list) { StrokingTextPainter.TextRun run = (StrokingTextPainter.TextRun) aList; TextSpanLayout layout = run.getLayout(); float x = (float) p.getX(); float y = (float) p.getY(); TextHit textHit = layout.hitTestChar(x, y); if (textHit != null && contains(p, layout.getBounds2D())) { return true; } } return false; }
protected Mark hitTest(double x, double y, TextNode node) { AttributedCharacterIterator aci; aci = node.getAttributedCharacterIterator(); if (aci == null) return null; // get the list of text runs List textRuns = getTextRuns(node, aci); if (textRuns != null) { // for each text run, see if its been hit for (int i = 0; i < textRuns.size(); ++i) { TextRun textRun = (TextRun)textRuns.get(i); TextSpanLayout layout = textRun.getLayout(); TextHit textHit = layout.hitTestChar((float) x, (float) y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x,y)) return new BasicTextPainter.BasicMark(node, textHit); } } return null; }
TextSpanLayout layout = run.getLayout(); TextHit textHit = layout.hitTestChar(x, y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x, y)) {
if (!isTextSensitive(elem)) continue; Rectangle2D glBounds = layout.getBounds2D(); if (glBounds != null) { glBounds = at.createTransformedShape(glBounds).getBounds2D();
TextRun textRun = (TextRun)textRuns.get(i); TextSpanLayout textRunLayout = textRun.getLayout(); Rectangle2D runBounds = textRunLayout.getBounds2D(); if (runBounds != null) { if (bounds == null)
if (!isTextSensitive(elem)) continue; Rectangle2D glBounds = layout.getBounds2D(); if (glBounds != null) { glBounds = at.createTransformedShape(glBounds).getBounds2D();
if (!isTextSensitive(elem)) continue; Rectangle2D glBounds = layout.getBounds2D(); if (glBounds != null) { glBounds = at.createTransformedShape(glBounds).getBounds2D();
TextSpanLayout layout = run.getLayout(); TextHit textHit = layout.hitTestChar(x, y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x, y)) {
TextRun textRun = (TextRun) textRun1; TextSpanLayout textRunLayout = textRun.getLayout(); Rectangle2D runBounds = textRunLayout.getBounds2D(); if (runBounds != null) { if (bounds == null)
TextSpanLayout layout = run.getLayout(); TextHit textHit = layout.hitTestChar(x, y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x, y)) {
Rectangle2D glBounds = layout.getBounds2D(); if (glBounds == null) continue; glBounds = at.createTransformedShape(glBounds).getBounds2D();
protected Mark hitTest(double x, double y, TextNode node) { AttributedCharacterIterator aci; aci = node.getAttributedCharacterIterator(); if (aci == null) return null; // get the list of text runs List textRuns = getTextRuns(node, aci); if (textRuns != null) { // for each text run, see if its been hit for (Object textRun1 : textRuns) { TextRun textRun = (TextRun) textRun1; TextSpanLayout layout = textRun.getLayout(); TextHit textHit = layout.hitTestChar((float) x, (float) y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x, y)) return new BasicMark(node, textHit); } } return null; }
protected Mark hitTest(double x, double y, TextNode node) { AttributedCharacterIterator aci; aci = node.getAttributedCharacterIterator(); if (aci == null) return null; // get the list of text runs List textRuns = getTextRuns(node, aci); if (textRuns != null) { // for each text run, see if its been hit for (Object textRun1 : textRuns) { TextRun textRun = (TextRun) textRun1; TextSpanLayout layout = textRun.getLayout(); TextHit textHit = layout.hitTestChar((float) x, (float) y); Rectangle2D bounds = layout.getBounds2D(); if ((textHit != null) && (bounds != null) && bounds.contains(x, y)) return new BasicMark(node, textHit); } } return null; }
Rectangle2D glBounds = layout.getBounds2D(); if (glBounds != null) { if (ret == null) ret = (Rectangle2D)glBounds.clone();
Rectangle2D glBounds = layout.getBounds2D(); if (glBounds != null) { if (ret == null) ret = (Rectangle2D) glBounds.clone();