X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FStringJustifier.java;fp=src%2Fbe%2Fnikiroo%2Futils%2FStringJustifier.java;h=d968098aa9e02f5fc895e578bd42b79c8619d163;hb=6a493e0518e4b88cc68f6d4aae1faea08aa3afce;hp=4aab2e78ad1fcb3bf1c2cfbb1c4647c771138366;hpb=cc3e72914add9c950f563bf37c6615e8721ad32e;p=fanfix.git diff --git a/src/be/nikiroo/utils/StringJustifier.java b/src/be/nikiroo/utils/StringJustifier.java index 4aab2e7..d968098 100644 --- a/src/be/nikiroo/utils/StringJustifier.java +++ b/src/be/nikiroo/utils/StringJustifier.java @@ -37,6 +37,22 @@ import java.util.List; * into justified text paragraphs. */ class StringJustifier { + /** + * Process the given text into a list of left-justified lines of a given + * max-width. + * + * @param data + * the text to justify + * @param width + * the maximum width of a line + * + * @return the list of justified lines + */ + static List left2(final String data, final int width) { + List result = new LinkedList(); + + return result; + } /** * Left-justify a string into a list of lines. @@ -104,7 +120,7 @@ class StringJustifier { inWord = true; } } - } // for (int j = 0; j < rawLines[i].length(); j++) + } // next j if (word.length() + line.length() > n) { // This word will exceed the line length. Wrap at it @@ -118,7 +134,7 @@ class StringJustifier { line.append(word); } result.add(line.toString()); - } // for (int i = 0; i < rawLines.length; i++) { + } // next i return result; }