Examples of nextLayout()


Examples of java.awt.font.LineBreakMeasurer.nextLayout()

              .addAttribute(TextAttribute.FONT, font);
          LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(
              attributedDescription.getIterator(), frc);
          int currOffset = 0;
          while (true) {
            TextLayout tl = lineBreakMeasurer
                .nextLayout(footerLabelWidth);
            if (tl == null)
              break;
            int charCount = tl.getCharacterCount();
            String line = footerText.substring(currOffset,
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

      AttributedCharacterIterator textIterator = attributedText.getIterator();
      FontRenderContext fontRendering = g.getFontRenderContext();
      LineBreakMeasurer measurer = new LineBreakMeasurer(textIterator, fontRendering);
      WrappedLines lines = new WrappedLines();
      while(measurer.getPosition() < textIterator.getEndIndex()) {
        TextLayout layout = measurer.nextLayout(maxWidth);
        lines.add(layout);
      }
      return lines;
    }
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

        height = 0;
        if (length() > 0) {
            LineBreakMeasurer lbm = new LineBreakMeasurer(getIterator(), frc);
            if (lbm.getPosition() < length()) {
                while (true) {
                    TextLayout layout = lbm.nextLayout((float)width);
                    height += layout.getAscent() + layout.getDescent();
                    if (lbm.getPosition() >= length()) {
                        break;
                    }
                    height += layout.getLeading();
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

        if (length() > 0) {
            LineBreakMeasurer lbm = new LineBreakMeasurer(getIterator(),
                    g.getFontRenderContext());
            if (lbm.getPosition() < length()) {
                while (true) {
                    TextLayout layout = lbm.nextLayout((float)width);
                    double xx = x;
                    if (align == ALIGN_RIGHT) {
                        xx += width-layout.getAdvance();
                    } else if (align == ALIGN_CENTER) {
                        xx += (width-layout.getAdvance())/2;
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

                    textBuilder.getIterator(), frc);
            float width = getWidth()-15;
            float x = 8;
            float y = 0;
            while (lbm.getPosition() < textBuilder.length()) {
                TextLayout layout = lbm.nextLayout(width);
                if (lbm.getPosition() < textBuilder.length()) {
                    layout = layout.getJustifiedLayout(width);
                }
                y += layout.getAscent();
                layout.draw(g2d, x, y);
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

            if (_shape.getWordWrap() == TextShape.WrapNone) {
                wrappingWidth = _shape.getSheet().getSlideShow().getPageSize().width;
            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout(textWidth,
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout(textWidth,
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
            if(textLayout == null){
                logger.log(POILogger.WARN, "Failed to break text into lines: wrappingWidth: "+wrappingWidth+
                        "; text: " + rt.getText());
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

                // Get lines until the entire paragraph has been displayed.
                while (lmCopy.getPosition() < paragraphEnd) {

                    // Retrieve next layout. A cleverer program would also cache
                    // these layouts until the component is re-sized.
                    TextLayout layout = lmCopy.nextLayout(breakWidth);

                    // Compute pen x position. If the paragraph is right-to-left we
                    // will align the TextLayouts to the right edge of the panel.
                    // Note: this won't occur for the English text in this sample.
                    // Note: drawPosX is always where the LEFT of the text is placed.
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

                AttributedString styledText = new AttributedString(line);
                LineBreakMeasurer measurer = new LineBreakMeasurer(styledText.getIterator(), frc);

                while (measurer.getPosition() < line.length()) {

                    TextLayout layout = measurer.nextLayout(lineWidth);

                    cursor.y += (layout.getAscent());
                    float dx = layout.isLeftToRight() ? 0 : (lineWidth - layout.getAdvance());

                    layout.draw(g, cursor.x + dx, cursor.y);
View Full Code Here

Examples of java.awt.font.LineBreakMeasurer.nextLayout()

            if (_shape.getWordWrap() == TextShape.WrapNone) {
                wrappingWidth = _shape.getSheet().getSlideShow().getPageSize().width;
            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout(textWidth,
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.