LineBreaker.Builder
public
static
final
class
LineBreaker.Builder
extends Object
Helper class for creating a LineBreaker
.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
Builder
public Builder ()
Public methods
build
public LineBreaker build ()
Build a new LineBreaker with given parameters.
You can reuse the Builder instance even after calling this method.
setIndents
public LineBreaker.Builder setIndents (int[] indents)
Set indents.
The supplied array provides the total amount of indentation per line, in pixel. This
amount is the sum of both left and right indentations. For lines past the last element in
the array, the indentation amount of the last element is used.
Parameters |
indents |
int : This value may be null . |
setUseBoundsForWidth
public LineBreaker.Builder setUseBoundsForWidth (boolean useBoundsForWidth)
Set true for using width of bounding box as a source of automatic line breaking.
If this value is false, the automatic line breaking uses total amount of advances as text
widths. By setting true, it uses joined all glyph bound's width as a width of the text.
If the font has glyphs that have negative bearing X or its xMax is greater than advance,
the glyph clipping can happen because the drawing area may be bigger. By setting this to
true, the line breaker will break line based on bounding box, so clipping can be
prevented.
Parameters |
useBoundsForWidth |
boolean : True for using bounding box, false for advances. |