Lines Matching defs:TextLayout

72  * <code>TextLayout</code> is an immutable graphical representation of styled
90 * A <code>TextLayout</code> object can be rendered using
93 * <code>TextLayout</code> can be constructed either directly or through
100 * <code>TextLayout</code> construction logically proceeds as follows:
115 * All graphical information returned from a <code>TextLayout</code>
117 * <code>TextLayout</code>, which is the intersection of the
118 * <code>TextLayout</code> object's baseline with its left edge. Also,
119 * coordinates passed into a <code>TextLayout</code> object's methods
120 * are assumed to be relative to the <code>TextLayout</code> object's
122 * <code>TextLayout</code> object's coordinate system and the coordinate
126 * <code>TextLayout</code> objects are constructed from styled text,
128 * changes in the text previously used to generate a <code>TextLayout</code>
129 * do not affect the <code>TextLayout</code>.
131 * Three methods on a <code>TextLayout</code> object
135 * are relative to the start of the <code>TextLayout</code>, <b>not</b>
136 * to the text used to create the <code>TextLayout</code>. Similarly,
137 * <code>TextLayout</code> methods that accept <code>TextHitInfo</code>
139 * offsets to be relative to the <code>TextLayout</code>, not to any
143 * Constructing and drawing a <code>TextLayout</code> and its bounding
150 * TextLayout layout = new TextLayout("This is a string", font, frc);
162 * Hit-testing a <code>TextLayout</code> (determining which character is at
228 * origin of the TextLayout. Documentation for each relevant API
238 public final class TextLayout implements Cloneable {
253 * TextLayouts are supposedly immutable. If you mutate a TextLayout under
269 // dx and dy specify the distance between the TextLayout's origin
273 // and TextLayout is not guaranteed to work with non-zero dx, dy
276 // They are static now so they don't take up space in TextLayout
288 * boundsRect encloses all of the bits this TextLayout can draw. It
326 * a strong caret in the specified <code>TextLayout</code>.
329 * @param layout the <code>TextLayout</code> in which
337 TextLayout layout) {
355 * Constructs a <code>TextLayout</code> from a <code>String</code>
369 * <code>TextLayout</code> and user space.
371 public TextLayout(String string, Font font, FontRenderContext frc) {
374 throw new IllegalArgumentException("Null font passed to TextLayout constructor.");
378 throw new IllegalArgumentException("Null string passed to TextLayout constructor.");
382 throw new IllegalArgumentException("Zero length string passed to TextLayout constructor.");
403 * Constructs a <code>TextLayout</code> from a <code>String</code>
417 * <code>TextLayout</code> and user space.
419 public TextLayout(String string, Map<? extends Attribute,?> attributes,
423 throw new IllegalArgumentException("Null string passed to TextLayout constructor.");
427 throw new IllegalArgumentException("Null map passed to TextLayout constructor.");
431 throw new IllegalArgumentException("Zero length string passed to TextLayout constructor.");
490 * Constructs a <code>TextLayout</code> from an iterator over styled text.
501 * <code>TextLayout</code> and user space.
503 public TextLayout(AttributedCharacterIterator text, FontRenderContext frc) {
506 throw new IllegalArgumentException("Null iterator passed to TextLayout constructor.");
512 throw new IllegalArgumentException("Zero length iterator passed to TextLayout constructor.");
538 * Creates a <code>TextLayout</code> from a {@link TextLine} and
541 * the resulting <code>TextLayout</code>
544 * <code>TextLayout</code>. This should already be normalized to
546 * @param justifyRatio <code>0</code> if the <code>TextLayout</code>
549 TextLayout(TextLine textLine,
737 * Creates a copy of this <code>TextLayout</code>.
776 * Creates a copy of this <code>TextLayout</code> justified to the
779 * If this <code>TextLayout</code> has already been justified, an
780 * exception is thrown. If this <code>TextLayout</code> object's
781 * justification ratio is zero, a <code>TextLayout</code> identical
782 * to this <code>TextLayout</code> is returned.
786 * @return a <code>TextLayout</code> justified to the specified width.
790 public TextLayout getJustifiedLayout(float justificationWidth) {
793 throw new IllegalArgumentException("justificationWidth <= 0 passed to TextLayout.getJustifiedLayout()");
810 return new TextLayout(newLine, baseline, baselineOffsets, ALREADY_JUSTIFIED);
843 * Returns the baseline for this <code>TextLayout</code>.
848 * @return the baseline of this <code>TextLayout</code>.
858 * <code>TextLayout</code>.
862 * values are relative to this <code>TextLayout</code> object's
864 * Offsets are added to the position of the <code>TextLayout</code>
867 * <code>TextLayout</code>.
878 * Returns the advance of this <code>TextLayout</code>.
882 * @return the advance of this <code>TextLayout</code>.
890 * Returns the advance of this <code>TextLayout</code>, minus trailing
892 * @return the advance of this <code>TextLayout</code> without the
902 * Returns the ascent of this <code>TextLayout</code>.
904 * <code>TextLayout</code> to the baseline. It is always either
909 * TextLayout. It is in baseline-relative coordinates.
910 * @return the ascent of this <code>TextLayout</code>.
918 * Returns the descent of this <code>TextLayout</code>.
920 * the <code>TextLayout</code>. It is always either positive or zero.
924 * the TextLayout. It is in baseline-relative coordinates.
925 * @return the descent of this <code>TextLayout</code>.
933 * Returns the leading of the <code>TextLayout</code>.
935 * <code>TextLayout</code>. This is in baseline-relative
939 * of all glyphvectors in the <code>TextLayout</code>. The algorithm
951 * @return the leading of this <code>TextLayout</code>.
959 * Returns the bounds of this <code>TextLayout</code>.
962 * pixels rendered by the TextLayout.</p>
964 * origin or advance of the <code>TextLayout</code>.
966 * <code>TextLayout</code>.
989 * Returns the pixel bounds of this <code>TextLayout</code> when
994 * <code>TextLayout</code>, and can be null. If it is null, the
995 * <code>FontRenderContext</code> of this <code>TextLayout</code>
998 * @param x the x-coordinate at which to render this <code>TextLayout</code>.
999 * @param y the y-coordinate at which to render this <code>TextLayout</code>.
1009 * Returns <code>true</code> if this <code>TextLayout</code> has
1011 * a right-to-left base direction. The <code>TextLayout</code>
1021 * <code>TextLayout</code> is left-to-right; <code>false</code>
1029 * Returns <code>true</code> if this <code>TextLayout</code> is vertical.
1030 * @return <code>true</code> if this <code>TextLayout</code> is vertical;
1039 * <code>TextLayout</code>.
1040 * @return the number of characters in this <code>TextLayout</code>.
1056 * The characterOffsets in TextHitInfo's used and returned by TextLayout
1062 * A caret is a visual location in the TextLayout indicating where text at
1093 * character's direction is the same as the direction of the TextLayout.
1096 * TextLayout.
1100 * caret display. TextLayout.getCaretShapes(TextHitInfo) will return an
1201 * @param hit a hit on a character in this <code>TextLayout</code>
1206 * @see #getCaretShapes(int, Rectangle2D, TextLayout.CaretPolicy)
1306 * uses the natural bounds of this <code>TextLayout</code>.
1307 * @param hit a hit on a character in this <code>TextLayout</code>
1321 * @param hit a hit on a character in this <code>TextLayout</code>
1426 * @param offset an insertion offset in this <code>TextLayout</code>.
1427 * Cannot be less than 0 or greater than this <code>TextLayout</code>
1436 throw new IllegalArgumentException("Offset out of bounds in TextLayout.getNextRightHit()");
1440 throw new IllegalArgumentException("Null CaretPolicy passed to TextLayout.getNextRightHit()");
1464 * @param offset an insertion offset in this <code>TextLayout</code>.
1465 * Cannot be less than 0 or greater than the <code>TextLayout</code>
1480 * @param hit a hit on a character in this <code>TextLayout</code>.
1508 * @param offset an insertion offset in this <code>TextLayout</code>.
1509 * Cannot be less than 0 or greater than this <code>TextLayout</code>
1518 throw new IllegalArgumentException("Null CaretPolicy passed to TextLayout.getNextLeftHit()");
1522 throw new IllegalArgumentException("Offset out of bounds in TextLayout.getNextLeftHit()");
1546 * @param offset an insertion offset in this <code>TextLayout</code>.
1547 * Cannot be less than 0 or greater than this <code>TextLayout</code>
1771 * @param bounds the bounds of the <code>TextLayout</code> to use
1782 throw new IllegalArgumentException("Null Rectangle2D passed to TextLayout.getCaret()");
1790 * hit inside the natural bounds of this <code>TextLayout</code>.
1833 * level of this <code>TextLayout</code>.
1854 * @param offset an offset in this <code>TextLayout</code>
1868 throw new IllegalArgumentException("Offset out of bounds in TextLayout.getCaretShapes()");
1872 throw new IllegalArgumentException("Null Rectangle2D passed to TextLayout.getCaretShapes()");
1876 throw new IllegalArgumentException("Null CaretPolicy passed to TextLayout.getCaretShapes()");
1916 * @param offset an offset in this <code>TextLayout</code>
1931 * that uses the default caret policy and this <code>TextLayout</code>
1933 * @param offset an offset in this <code>TextLayout</code>
2179 throw new IllegalArgumentException("Null Rectangle2D passed to TextLayout.getVisualHighlightShape()");
2215 * uses the natural bounds of this <code>TextLayout</code>.
2232 * the start of this <code>TextLayout</code>. If the range includes
2234 * of <code>bounds</code> after the end of this <code>TextLayout</code>.
2269 throw new IllegalArgumentException("Null Rectangle2D passed to TextLayout.getLogicalHighlightShape()");
2281 throw new IllegalArgumentException("Range is invalid in TextLayout.getLogicalHighlightShape()");
2350 * <code>TextLayout</code>. This method is a convenience overload of
2352 * this <code>TextLayout</code>.
2387 throw new IllegalArgumentException("Invalid range passed to TextLayout.getBlackBoxBounds()");
2442 * Coordinates outside the bounds of the <code>TextLayout</code>
2448 * <code>TextLayout</code>. This is in standard coordinates.
2450 * <code>TextLayout</code>. This is in standard coordinates.
2451 * @param bounds the bounds of the <code>TextLayout</code>. This
2549 * <code>TextLayout</code>.
2551 * <code>TextLayout</code>. This is in standard coordinates.
2553 * <code>TextLayout</code>. This is in standard coordinates.
2563 * Returns the hash code of this <code>TextLayout</code>.
2564 * @return the hash code of this <code>TextLayout</code>.
2576 * <code>TextLayout</code> object and if the specified <code>Object</code>
2577 * equals this <code>TextLayout</code>.
2580 * equals this <code>TextLayout</code>; <code>false</code>
2584 return (obj instanceof TextLayout) && equals((TextLayout)obj);
2590 * @param rhs the <code>TextLayout</code> to compare to this
2591 * <code>TextLayout</code>
2592 * @return <code>true</code> if the specified <code>TextLayout</code>
2593 * equals this <code>TextLayout</code>.
2596 public boolean equals(TextLayout rhs) {
2610 * Returns debugging information for this <code>TextLayout</code>.
2611 * @return the <code>textLine</code> of this <code>TextLayout</code>
2620 * Renders this <code>TextLayout</code> at the specified location in
2628 * @param x the X coordinate of the origin of this <code>TextLayout</code>
2629 * @param y the Y coordinate of the origin of this <code>TextLayout</code>
2635 throw new IllegalArgumentException("Null Graphics2D passed to TextLayout.draw()");
2684 * <code>TextLayout</code>.
2686 * outline of this <code>TextLayout</code>.
2688 * <code>TextLayout</code>. This is in standard coordinates.
2717 * the TextLayout.
2721 * TextLayout.