congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TextNode.getTextRuns
Code IndexAdd Tabnine to your IDE (free)

How to use
getTextRuns
method
in
org.apache.batik.bridge.TextNode

Best Java code snippets using org.apache.batik.bridge.TextNode.getTextRuns (Showing top 20 results out of 315)

origin: org.apache.xmlgraphics/batik-bridge

/**
 * 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();
}
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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();
}
origin: apache/batik

/**
 * 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();
}
origin: org.apache.xmlgraphics/batik-bridge

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();
}
origin: fr.avianey.apache-xmlgraphics/batik

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();
}
origin: apache/batik

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();
}
origin: fr.avianey.apache-xmlgraphics/batik

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();
}
origin: org.apache.xmlgraphics/batik-bridge

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();
}
origin: apache/batik

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();
}
origin: fr.avianey.apache-xmlgraphics/batik

List list = tn.getTextRuns();
if (list == null)
  return elems;
origin: apache/batik

public List getTextRuns(TextNode node, AttributedCharacterIterator aci) {
  List textRuns = node.getTextRuns();
  if (textRuns != null) {
    return textRuns;
origin: fr.avianey.apache-xmlgraphics/batik

public List getTextRuns(TextNode node, AttributedCharacterIterator aci) {
  List textRuns = node.getTextRuns();
  if (textRuns != null) {
    return textRuns;
origin: fr.avianey.apache-xmlgraphics/batik

/**
 * 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;
}
origin: org.apache.xmlgraphics/batik-extension

public List getTextRuns(TextNode node, AttributedCharacterIterator aci) {
  List textRuns = node.getTextRuns();
  if (textRuns != null) {
    return textRuns;
origin: org.apache.xmlgraphics/batik-bridge

List list = tn.getTextRuns();
if (list == null)
  return elems;
origin: org.apache.xmlgraphics/batik-bridge

/**
 * 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;
}
origin: fr.avianey.apache-xmlgraphics/batik

List list = textNode.getTextRuns();
if (list != null){
  float x = (float)pt.getX();
origin: apache/batik

/**
 * 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;
}
origin: org.apache.xmlgraphics/batik-bridge

List list = tn.getTextRuns();
if (list == null)
  return elems;
origin: apache/fop

/**
 * 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);
}
org.apache.batik.bridgeTextNodegetTextRuns

Javadoc

Returns a list of text runs.

Popular methods of TextNode

  • getAttributedCharacterIterator
    Returns the attributed character iterator of this text node.
  • getHighlightShape
    Returns the shape used to outline this text node.
  • getLocation
    Returns the location of this text node.
  • getMarkerForChar
    Return the marker for the character at index in this nodes AttributedCharacterIterator. Before Char
  • setTextPainter
    Sets the text painter of this text node. If the specified text painter is null, this text node will
  • setTextRuns
    Sets the list of text runs of this text node.
  • <init>
    Constructs a new empty TextNode.
  • contains
  • fireGraphicsNodeChangeCompleted
  • fireGraphicsNodeChangeStarted
  • getBounds
  • getGeometryBounds
    Returns the bounds of the area covered by this node, without taking any of its rendering attribute i
  • getBounds,
  • getGeometryBounds,
  • getGlobalTransform,
  • getPrimitiveBounds,
  • getRenderingHints,
  • getRoot,
  • getText,
  • invalidateGeometryCache,
  • setAttributedCharacterIterator

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now