Examples of substringWidth()


Examples of javax.microedition.lcdui.Font.substringWidth()

            return str.length();
        }
        final int widthForTruncatedText = width - font.charWidth(truncationMark);
        int availableLength;
        for (availableLength = str.length() - 1 ;
             font.substringWidth(str,0,availableLength) > widthForTruncatedText;
             availableLength-- ) {};
        return availableLength;
    }

    /**
 
View Full Code Here

Examples of javax.microedition.lcdui.Font.substringWidth()

          int start = indices[i];
          int len = indices[i + 1];

          if (focus) {
            Skin.get().fillFocusRect(g, dx + indices[i + 2], y,
                font.substringWidth(text, start, len), font.getHeight());
          }
          g.setColor(textColor);
          g.setFont(font);
          g.drawSubstring(text, start, len, dx + indices[i + 2], y, Graphics.TOP | Graphics.LEFT);
        }
View Full Code Here

Examples of javax.microedition.lcdui.Font.substringWidth()

        y += firstLineYOffset;
       
        for (int i = 0; i < indices.length; i += 3) {
          g.setColor(0x0000ff);
          g.drawRect(dx + indices[i + 2], y,
              font.substringWidth(text, indices[i], indices[i + 1]), fh - 1);
          y += fh;
          if (i == 0) {
            g.setColor(0x0ff0000);
            g.drawLine(dx + 2, y, dx + 2, y + mainYOffset);
            y += mainYOffset;
View Full Code Here

Examples of javax.microedition.lcdui.Font.substringWidth()

      }

      buf.append((char) lastBreak);
      buf.append((char) (end - lastBreak));
     
      int w = Math.min(font.substringWidth(text, lastBreak, end - lastBreak),  maxWidth);
     
      if (lineStartIndex != insertionIndex) {
        ((BlockWidget) getParent()).adjustLine(lineStartIndex,
            insertionIndex, borders);
        lineStartIndex = insertionIndex;
View Full Code Here

Examples of javax.microedition.lcdui.Font.substringWidth()

      h += fontHeight;
    } while (breakPos <= len);

    buf.append((char) lastBreak);
    buf.append((char) (text.length() - lastBreak));
    int w = Math.min(font.substringWidth(text, lastBreak,
        text.length() - lastBreak), borders.getHorizontalSpace(fontHeight));
   
    borders.placeBox(w, fontHeight, Style.NONE, 0);
    buf.append((char) borders.getBoxX());
   
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.