Examples of charsWidth()


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()

      // bounding box...
      if (token.containsPosition(pos)) {
        end = start + (pos-token.offset);
        for (i=start; i<end; i++) {
          if (text[i] == '\t') {
            stableX += fm.charsWidth(text, start, i-start+1);
            stableX = e.nextTabStop(stableX, 0);
            start = i+1// Do charsWidth() from next char.
          }
        }
        int temp = fm.charsWidth(text, start, i-start);
View Full Code Here

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.
          }
        }
        int temp = fm.charsWidth(text, start, i-start);
        rect.x = (int)stableX + temp;
        if (text[i]=='\t')
          rect.width = fm.charWidth(' ');
        else
          rect.width = fm.charsWidth(text, start,i-start+1) - temp;
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

        int temp = fm.charsWidth(text, start, i-start);
        rect.x = (int)stableX + temp;
        if (text[i]=='\t')
          rect.width = fm.charWidth(' ');
        else
          rect.width = fm.charsWidth(text, start,i-start+1) - temp;
        return rect;
      }

      // If this token does not contain the position for which to get
      // the bounding box...
View Full Code Here

Examples of java.awt.FontMetrics.charsWidth()

      // If this token does not contain the position for which to get
      // the bounding box...
      else {
        for (i=start; i<end; i++) {
          if (text[i] == '\t') {
            stableX += fm.charsWidth(text, start, i-start+1);
            stableX = e.nextTabStop(stableX, 0);
            start = i+1// Do charsWidth() from next char.
          }
        }
        stableX += fm.charsWidth(text, start, i-start);
View Full Code Here

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.
          }
        }
        stableX += fm.charsWidth(text, start, i-start);
      }

      token = token.getNextToken();

    }
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
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.