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.3, 1st July 2012
- Author:
- Aidan Slingsby, giCentre, City University London.
Field Summary |
java.awt.Rectangle |
bounds
|
java.lang.String |
id
|
java.lang.String |
text
|
float |
x
|
float |
y
|
Method Summary |
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 |
text
public java.lang.String text
id
public java.lang.String id
x
public float x
y
public float y
bounds
public java.awt.Rectangle bounds
WrappedToken
public WrappedToken()
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.
giCentre Utilities V.3.3, API documentation generated 6th April, 2013