Package org.axsl.text.line

Examples of org.axsl.text.line.LineText


            throws TextException {
        checkLayoutTarget(lineOutput);
        final LineArea lineArea = (LineArea) lineOutput;
        GraftingPoint graftingPoint = null;

        LineText textToUse = text;
        if (textToUse instanceof org.axsl.fo.FoLineText) {
            final FoLineText foLineText = (FoLineText) textToUse;
            graftingPoint = foLineText.getGraftingPoint();
            textToUse = foLineText.getWrapped();
        }
View Full Code Here


     * @return The index through which layout was actually completed.
     */
    private int sizeFirstWordNextText(final LineText lineText, final int start,
            final int end) {
        int size = 0;
        LineText nextText = lineText;
        int whitespaceWidth = getCharWidth(nextText, ' ');
        /* First see if there is additional text in the current item. Remember
         * that faux small-caps breaks up the text item. */
        CharSequence text = nextText.inlineText();
        for (int i = end + 1; i < text.length(); i++) {
            final char c = text.charAt(i);
            if (forcesLineBreak(c) || allowsLineBreak(c)) {
                return size;
            }
            size += charWidth(nextText, c, whitespaceWidth);
        }
        while (true) {
            nextText = nextText.nextContiguousLineText();
            if (nextText == null) {
                return size;
            }
            text = nextText.inlineText();
            whitespaceWidth = getCharWidth(nextText, ' ');
            for (int i = 0; i < text.length(); i++) {
                final char c = text.charAt(i);
                if (forcesLineBreak(c) || allowsLineBreak(c)) {
                    return size;
View Full Code Here

     * results.
     */
    private void createLineContent(final int startIndex, final int endIndex,
            final int sizeInline, final boolean isHyphenated)
            throws TextException {
        final LineText lineText = (LineText) this.getLineContent();
        final boolean everythingWritten = endIndex >=
                lineText.inlineText().length();
        boolean isLastItemOnLine = true;
        if (everythingWritten) {
            /* If everything was written, this may not be the last item on
             * the line, unless this is the last item in the block. */
            if (! lineText.isLastItemInBlock()) {
                isLastItemOnLine = false;
            }
        }
        final boolean isFauxSmallCaps = this.isInLowerCase();
        getHandler().handleLineBreakText(getCurrentLine(), lineText,
View Full Code Here

    /**
     * Returns the underlying text of the first descendant text item.
     * @return The underlying text of the first descendant text item.
     */
    public CharSequence firstTextSegment() {
        final LineText firstLineText = firstLineText();
        if (firstLineText == null) {
            return null;
        }
        return firstLineText.inlineText();
    }
View Full Code Here

        for (int i = 0; i < this.getChildCount(); i++) {
            final Object child = this.getChildren().get(i);
            if (child instanceof LineText) {
                return (LineText) child;
            }
            LineText firstDescendant = null;
            if (child instanceof FObj) {
                firstDescendant = ((FObj) child).firstLineText();
            }
            if (firstDescendant != null) {
                return firstDescendant;
View Full Code Here

            return false;
        }
        if (this.lineContentIndex == this.lineContentList.size() - 1) {
            /* The current item is the last item. If it is a text item, we need to see whether we are at the end of
             * the sequence. */
            final LineText lineText = getCurrentLineText();
            if (lineText != null
                    && this.currentLineTextItemIndex >= lineText.inlineText().length()) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

            final int maximum = lineNonText.inlineSizeMaximum(1);
            this.lineContentIndex ++;
            return new LbGlue4a(optimum, maximum - optimum, optimum - minimum);
        }
        if (lineContent instanceof LineText) {
            final LineText lineText = (LineText) lineContent;
            final int codePoint = lineText.inlineText().charAt(this.currentLineTextItemIndex);
            final int width = lineText.inlinePrimaryFont().getFont().width(codePoint, lineText.inlineFontSize());
            this.currentLineTextItemIndex ++;
            if (this.currentLineTextItemIndex >= lineText.inlineText().length()) {
                this.currentLineTextItemIndex = -1;
                this.lineContentIndex ++;
            }
            return new LbBox4a(width);
        }
View Full Code Here

     */
    protected int processInput(final LineContent lineContent, final int start,
            final int end) throws TextException {
        int status = 0;
        if (lineContent instanceof LineText) {
            final LineText lineText = (LineText) lineContent;
            final CharSequence text = lineText.inlineText();
            if (text.length() < 1) {
                return -1;
            }
            if (lineText.inlineIsFauxSmallCaps()) {
                /* If this is small caps, break the text up into pieces,
                 * starting a new piece when the case of the text changes. */
                int subsetStart = start;
                this.setInLowerCase(isLowerCase(text.charAt(start)));
                for (int i = start; i < end; i++) {
View Full Code Here

TOP

Related Classes of org.axsl.text.line.LineText

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.