Package util.misc

Examples of util.misc.TextLineBreakerFontWidth.breakLines()


    // A normal line break   
    String text = "Es ging der Stiefel und sein Knecht von Kniggeb\u00fchl "
      + "nach Entenbrecht.";
    StringReader reader = new StringReader(text);
    String[] lineArr = breaker.breakLines(reader, 100, 3);
    assertEquals(lineArr.length, 3);
   
    // A long word break with good breaking chars
    text = "Da ist die Teta-Graphen-Hypernations-Maschine";
    reader = new StringReader(text);
View Full Code Here


    assertEquals(lineArr.length, 3);
   
    // A long word break with good breaking chars
    text = "Da ist die Teta-Graphen-Hypernations-Maschine";
    reader = new StringReader(text);
    lineArr = breaker.breakLines(reader, 100, 4);
    assertEquals(lineArr.length, 4);
   
    // A long word break without good breaking chars
    text = "Parabailarlabambaparabailarlabambasenecesitaunacopadicracia";
    reader = new StringReader(text);
View Full Code Here

    assertEquals(lineArr.length, 4);
   
    // A long word break without good breaking chars
    text = "Parabailarlabambaparabailarlabambasenecesitaunacopadicracia";
    reader = new StringReader(text);
    lineArr = breaker.breakLines(reader, 100, 4);
    assertEquals(lineArr.length, 4);
   
    // Word break at slash
    text = "Das sind die Varianten Eins/Zwei/Drei/Vier/Fuenf/Sechs/Sieben";
    reader = new StringReader(text);
View Full Code Here

    assertEquals(lineArr.length, 4);
   
    // Word break at slash
    text = "Das sind die Varianten Eins/Zwei/Drei/Vier/Fuenf/Sechs/Sieben";
    reader = new StringReader(text);
    lineArr = breaker.breakLines(reader, 100, 4);
    assertEquals(lineArr.length, 4);
    assert(lineArr[1].equals("Varianten Eins/"));
    assert(lineArr[2].equals("Zwei/Drei/Vier/"));
   
    /*
 
View Full Code Here

  public void setText(Reader textReader) throws IOException {
    if (textReader == null) {
      mTextLineArr = null;
    } else {
      TextLineBreakerFontWidth breaker = new TextLineBreakerFontWidth(mFont);
      mTextLineArr = breaker.breakLines(textReader, mWidth, mMaxLineCount);
    }
  }
 
 
  // implements Icon
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.