Class LabelUtil


  • public class LabelUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String collapseEnd​(java.lang.String text, java.awt.FontMetrics metrics, int availableWidth)  
      static java.lang.String collapseFront​(java.lang.String text, java.awt.FontMetrics metrics, int availableWidth)  
      static java.lang.String collapseMiddle​(java.lang.String text, java.awt.FontMetrics metrics, int availableWidth)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • collapseFront

        public static java.lang.String collapseFront​(java.lang.String text,
                                                     java.awt.FontMetrics metrics,
                                                     int availableWidth)
        Returns:
        text, shortened with "..." in the front if the available width is exceeded using the given metrics.
      • collapseMiddle

        public static java.lang.String collapseMiddle​(java.lang.String text,
                                                      java.awt.FontMetrics metrics,
                                                      int availableWidth)
        Returns:
        text, shortened with "..." in the middle if the available width is exceeded using the given metrics.
      • collapseEnd

        public static java.lang.String collapseEnd​(java.lang.String text,
                                                   java.awt.FontMetrics metrics,
                                                   int availableWidth)
        Returns:
        text, shortened with "..." at the end if the available width is exceeded using the given metrics.