org.swtchart.internal
Class Util

java.lang.Object
  extended by org.swtchart.internal.Util

public final class Util
extends java.lang.Object

A utility class providing generic methods.


Constructor Summary
Util()
           
 
Method Summary
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 text or 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.