Package org.axsl.text.line

Examples of org.axsl.text.line.LineContent


     */
    public LbContent next() {
        if (! hasNext()) {
            throw new NoSuchElementException("No more elements in " + this.getClass().getName());
        }
        final LineContent lineContent = this.lineContentList.get(this.lineContentIndex);
        if (lineContent instanceof LineNonText) {
            final LineNonText lineNonText = (LineNonText) lineContent;
            final int optimum = lineNonText.inlineSizeOptimum(1);
            final int minimum = lineNonText.inlineSizeMinimum(1);
            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);
        }
        throw new IllegalStateException("Unknown LineContent item: " + lineContent.getClass().getName());
    }
View Full Code Here

TOP

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

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.