Class LabelWrapper

java.lang.Object
edu.uci.ics.jung.visualization.util.LabelWrapper
All Implemented Interfaces:
com.google.common.base.Function<String,String>, Function<String,String>

public class LabelWrapper extends Object implements com.google.common.base.Function<String,String>
A utility to wrap long lines, creating html strings with line breaks at a settable max line length
  • Field Details

  • Constructor Details

    • LabelWrapper

      public LabelWrapper()
      Create an instance with default line break length = 10
    • LabelWrapper

      public LabelWrapper(int lineLength)
      Create an instance with passed line break length
      Parameters:
      lineLength - the max length for lines
  • Method Details

    • apply

      public String apply(String str)
      call 'wrap' to transform the passed String
      Specified by:
      apply in interface com.google.common.base.Function<String,String>
      Specified by:
      apply in interface Function<String,String>
    • wrap

      private String wrap(String str)
      line-wrap the passed String as an html string with break Strings inserted.
      Parameters:
      str -
      Returns:
    • main

      public static void main(String[] args)