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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    (package private) int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an instance with default line break length = 10
    LabelWrapper(int lineLength)
    Create an instance with passed line break length
  • Method Summary

    Modifier and Type
    Method
    Description
    call 'wrap' to transform the passed String
    static void
    main(String[] args)
     
    private String
    wrap(String str)
    line-wrap the passed String as an html string with break Strings inserted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.common.base.Function

    equals

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • 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)