Class Util


  • public final class Util
    extends java.lang.Object
    A utility class providing generic methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Point getExtentInGC​(Font font, java.lang.String text)
      Gets the text extent with given font in GC.
      static int getIndexDefinedInSWT​(LineStyle lineStyle)
      Gets the index defined in SWT.
      • Methods inherited from class java.lang.Object

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

      • Util

        public Util()
    • Method Detail

      • getExtentInGC

        public static Point getExtentInGC​(Font font,
                                          java.lang.String text)
        Gets the text extent with given font in GC. If the given font is null or already disposed, point containing size zero will be returned.
        Parameters:
        font - the font
        text - the text
        Returns:
        a point containing text extent
      • getIndexDefinedInSWT

        public static int getIndexDefinedInSWT​(LineStyle lineStyle)
        Gets the index defined in SWT.
        Parameters:
        lineStyle - the line style
        Returns:
        the index defined in SWT.