168 " length: " + paragraphLength +
169 " for embeddings of length: " + text.length);
170 }
171
172 bidiBase = new BidiBase(text, textStart, embeddings, embStart, paragraphLength, flags);
173 }
174
175 /**
176 * Create a Bidi object representing the bidi information on a line of text within
177 * the paragraph represented by the current Bidi. This call is not required if the
178 * entire paragraph fits on one line.
179 *
180 * @param lineStart the offset from the start of the paragraph to the start of the line.
181 * @param lineLimit the offset from the start of the paragraph to the limit of the line.
182 * @return a {@code Bidi} object
183 */
184 public Bidi createLineBidi(int lineStart, int lineLimit) {
185 AttributedString astr = new AttributedString("");
186 Bidi newBidi = new Bidi(astr.getIterator());
187
188 return bidiBase.setLine(this, bidiBase, newBidi, newBidi.bidiBase,lineStart, lineLimit);
189 }
190
191 /**
192 * Return true if the line is not left-to-right or right-to-left. This means it either has mixed runs of left-to-right
193 * and right-to-left text, or the base direction differs from the direction of the only run of text.
194 *
195 * @return true if the line is not left-to-right or right-to-left.
196 */
197 public boolean isMixed() {
198 return bidiBase.isMixed();
199 }
200
201 /**
202 * Return true if the line is all left-to-right text and the base direction is left-to-right.
203 *
204 * @return true if the line is all left-to-right text and the base direction is left-to-right
205 */
206 public boolean isLeftToRight() {
207 return bidiBase.isLeftToRight();
208 }
|
168 " length: " + paragraphLength +
169 " for embeddings of length: " + text.length);
170 }
171
172 bidiBase = new BidiBase(text, textStart, embeddings, embStart, paragraphLength, flags);
173 }
174
175 /**
176 * Create a Bidi object representing the bidi information on a line of text within
177 * the paragraph represented by the current Bidi. This call is not required if the
178 * entire paragraph fits on one line.
179 *
180 * @param lineStart the offset from the start of the paragraph to the start of the line.
181 * @param lineLimit the offset from the start of the paragraph to the limit of the line.
182 * @return a {@code Bidi} object
183 */
184 public Bidi createLineBidi(int lineStart, int lineLimit) {
185 AttributedString astr = new AttributedString("");
186 Bidi newBidi = new Bidi(astr.getIterator());
187
188 return bidiBase.setLine(this, bidiBase, newBidi, newBidi.bidiBase, lineStart, lineLimit);
189 }
190
191 /**
192 * Return true if the line is not left-to-right or right-to-left. This means it either has mixed runs of left-to-right
193 * and right-to-left text, or the base direction differs from the direction of the only run of text.
194 *
195 * @return true if the line is not left-to-right or right-to-left.
196 */
197 public boolean isMixed() {
198 return bidiBase.isMixed();
199 }
200
201 /**
202 * Return true if the line is all left-to-right text and the base direction is left-to-right.
203 *
204 * @return true if the line is all left-to-right text and the base direction is left-to-right
205 */
206 public boolean isLeftToRight() {
207 return bidiBase.isLeftToRight();
208 }
|