/** * Retrieve the list of layout for the * text node. */ protected List getTextRuns(TextNode node){ //System.out.println(node.getTextRuns()); if ( node.getTextRuns() == null ){ //TODO : need to work out a solution //to compute the text runs node.getPrimitiveBounds(); } //System.out.println(node.getTextRuns()); return node.getTextRuns(); }
/** * Retrieve the list of layout for the * text node. */ protected List getTextRuns(TextNode node){ //System.out.println(node.getTextRuns()); if ( node.getTextRuns() == null ){ //TODO : need to work out a solution //to compute the text runs node.getPrimitiveBounds(); } //System.out.println(node.getTextRuns()); return node.getTextRuns(); }
/** * Retrieve the list of layout for the * text node. */ protected List getTextRuns(TextNode node){ //System.out.println(node.getTextRuns()); if ( node.getTextRuns() == null ){ //TODO : need to work out a solution //to compute the text runs node.getPrimitiveBounds(); } //System.out.println(node.getTextRuns()); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); // cache the textRuns so don't need to recalculate node.setTextRuns(textRuns); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); // cache the textRuns so don't need to recalculate node.setTextRuns(textRuns); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); // cache the textRuns so don't need to recalculate node.setTextRuns(textRuns); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); aci.first(); List rgns = (List)aci.getAttribute(FLOW_REGIONS); if (rgns != null) { Iterator i = textRuns.iterator(); List chunkLayouts = new ArrayList(); TextRun tr = (TextRun)i.next(); List layouts = new ArrayList(); chunkLayouts.add(layouts); layouts.add(tr.getLayout()); while (i.hasNext()) { tr = (TextRun)i.next(); if (tr.isFirstRunInChunk()) { layouts = new ArrayList(); chunkLayouts.add(layouts); } layouts.add(tr.getLayout()); } textWrap(chunkACIs, chunkLayouts, rgns, fontRenderContext); } node.setTextRuns(textRuns); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); aci.first(); List rgns = (List)aci.getAttribute(FLOW_REGIONS); if (rgns != null) { Iterator i = textRuns.iterator(); List chunkLayouts = new ArrayList(); TextRun tr = (TextRun)i.next(); List layouts = new ArrayList(); chunkLayouts.add(layouts); layouts.add(tr.getLayout()); while (i.hasNext()) { tr = (TextRun)i.next(); if (tr.isFirstRunInChunk()) { layouts = new ArrayList(); chunkLayouts.add(layouts); } layouts.add(tr.getLayout()); } textWrap(chunkACIs, chunkLayouts, rgns, fontRenderContext); } node.setTextRuns(textRuns); return node.getTextRuns(); }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns; } AttributedCharacterIterator[] chunkACIs = getTextChunkACIs(aci); textRuns = computeTextRuns(node, aci, chunkACIs); aci.first(); List rgns = (List)aci.getAttribute(FLOW_REGIONS); if (rgns != null) { Iterator i = textRuns.iterator(); List chunkLayouts = new ArrayList(); TextRun tr = (TextRun)i.next(); List layouts = new ArrayList(); chunkLayouts.add(layouts); layouts.add(tr.getLayout()); while (i.hasNext()) { tr = (TextRun)i.next(); if (tr.isFirstRunInChunk()) { layouts = new ArrayList(); chunkLayouts.add(layouts); } layouts.add(tr.getLayout()); } textWrap(chunkACIs, chunkLayouts, rgns, fontRenderContext); } node.setTextRuns(textRuns); return node.getTextRuns(); }
List list = tn.getTextRuns(); if (list == null) return elems;
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns;
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns;
/** * 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; }
public List getTextRuns(TextNode node, AttributedCharacterIterator aci) { List textRuns = node.getTextRuns(); if (textRuns != null) { return textRuns;
List list = tn.getTextRuns(); if (list == null) return elems;
/** * 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; }
List list = textNode.getTextRuns(); if (list != null){ float x = (float)pt.getX();
/** * 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; }
List list = tn.getTextRuns(); if (list == null) return elems;
/** * Paints the specified attributed character iterator using the * specified Graphics2D and context and font context. * * @param node the TextNode to paint * @param g2d the Graphics2D to use */ public void paint(TextNode node, Graphics2D g2d) { if (isSupportedGraphics2D(g2d)) { new TextRunPainter().paintTextRuns(node.getTextRuns(), g2d, node.getLocation()); } proxyTextPainter.paint(node, g2d); }