org.gicentre.utils.text

## Class WrappedToken

- java.lang.Object
- - org.gicentre.utils.text.WrappedToken

-     public class WrappedToken
      extends java.lang.Object

  Holds details of wrapped tokens from org.gicentre.utils.text.wordWrapAndTokenise() and can return the screen bounds of the token, using the current textFont, textSize and textAlign.
  Version:
    3.4, 5th February, 2016.
  Author:
    Aidan Slingsby, giCentre, City University London.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.awt.Rectangle` | `bounds` Bounding rectangle of the token.
    `java.lang.String` | `id` ID of the text token.
    `java.lang.String` | `text` Text token to wrap
    `float` | `x` x-position of the token.
    `float` | `y` y-position of the token.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WrappedToken()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.Rectangle` | `getBounds(processing.core.PApplet sketch)` Returns a rectangle describing the screen bounds of this token (if drawn correctly) Corrects for the different textAlign modes of the sketch.
    `java.awt.Rectangle` | `getBounds(processing.core.PGraphics pGraphics)` Returns a rectangle describing the screen bounds of this token (if drawn correctly) Corrects for the different textAlign modes of the pGraphics.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### text

          public java.lang.String text

      Text token to wrap

    - #### id

          public java.lang.String id

      ID of the text token.

    - #### x

          public float x

      x-position of the token.

    - #### y

          public float y

      y-position of the token.

    - #### bounds

          public java.awt.Rectangle bounds

      Bounding rectangle of the token.

  - ### Constructor Detail

    - #### WrappedToken

          public WrappedToken()

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getBounds

          public java.awt.Rectangle getBounds(processing.core.PApplet sketch)

      Returns a rectangle describing the screen bounds of this token (if drawn correctly) Corrects for the different textAlign modes of the sketch.
      Parameters:
        `sketch` - Sketch doing the drawing.
      Returns:
        Bounds of this token in screen coordinates.

    - #### getBounds

          public java.awt.Rectangle getBounds(processing.core.PGraphics pGraphics)

      Returns a rectangle describing the screen bounds of this token (if drawn correctly) Corrects for the different textAlign modes of the pGraphics.
      Parameters:
        `pGraphics` - The graphics context within which the text drawing takes place.
      Returns:
        Bounds of this token in screen coordinates.