Examples of charsWidth()


Examples of java.awt.FontMetrics.charsWidth()

              stableX += fm.charsWidth(text, start, i-start+1);
              stableX = e.nextTabStop(stableX, 0);
              start = i+1;    // Do charsWidth() from next char.
              break;
            case ' ':
              stableX += fm.charsWidth(text, start, i-start+1);
              start = i + 1;
              break;
            default:
              break;
          }
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

              break;
            default:
              break;
          }
        }
        stableX += fm.charsWidth(text, start, i-start);
      }

      last += token.textCount;
      token = token.getNextToken();
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

      switch (text[i]) {

        case '\t':

          // Fill in background.
          nextX = x+fm.charsWidth(text, flushIndex,flushLen);
          float nextNextX = e.nextTabStop(nextX, 0);
          if (bg!=null) {
            paintBackground(x,y, nextNextX-x,height, g,
                    ascent, host, bg);
          }
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

          // But, we assume the approximation is close enough for
          // our drawing a dot for the space.

          // "flushLen+1" ensures text is aligned correctly (or,
          // aligned the same as in getWidth()).
          nextX = x+fm.charsWidth(text, flushIndex,flushLen+1);
          int width = fm.charWidth(' ');

          // Paint background.
          if (bg!=null) {
            paintBackground(x,y, nextX-x,height, g,
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

          nextX = e.nextTabStop(nextX, 0);
          stableX = nextX;  // Cache ending x-coord. of tab.
          start = i+1;    // Do charsWidth() from next char.
        }
        else {
          nextX = stableX + fm.charsWidth(text, start, i-start+1);
        }
        if (x>=currX && x<nextX) {
          if ((x-currX) < (nextX-x)) {
            return last + i-token.textOffset;
          }
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

          // adjacent whitespace into a single token, there
          // aren't usually any characters to compute a width
          // for here, so we check before calling.
          w = i-currentStart;
          if (w>0)
            width += fm.charsWidth(text, currentStart, w);
          currentStart = i+1;
          width = e.nextTabStop(width, 0);
        }
      }
      // Most (non-whitespace) tokens will have characters at this
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

      }
      // Most (non-whitespace) tokens will have characters at this
      // point to get the widths for, so we don't check for w>0 (mini-
      // optimization).
      w = endBefore-currentStart;
      width += fm.charsWidth(text, currentStart, w);
    }
    return width - x0;
  }

View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

    for (int i=textOffset; i<end; i++) {
      switch (text[i]) {
        case '\t':
          nextX = e.nextTabStop(
            x+fm.charsWidth(text, flushIndex,flushLen), 0);
          if (bg!=null) {
            paintBackground(x,y, nextX-x,fm.getHeight(),
                    g, fm.getAscent(), host, bg);
          }
          if (flushLen > 0) {
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

          flushLen += 1;
          break;
      }
    }

    nextX = x+fm.charsWidth(text, flushIndex,flushLen);

    if (flushLen>0 && nextX>=clipStart) {
      if (bg!=null) {
        paintBackground(x,y, nextX-x,fm.getHeight(),
                g, fm.getAscent(), host, bg);
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

      switch (text[i]) {

        case '\t':

          // Fill in background.
          nextX = x+fm.charsWidth(text, flushIndex,flushLen);
          float nextNextX = e.nextTabStop(nextX, 0);
          if (bg!=null) {
            paintBackground(x,y, nextNextX-x,height, g,
                    ascent, host, bg);
          }
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.