de.jaret.util.swt
Class TextRenderer

java.lang.Object
  extended by de.jaret.util.swt.TextRenderer

public class TextRenderer
extends Object

Simple utility class for rendering a multiline text.

Version:
$Id: TextRenderer.java 623 2007-11-01 15:23:45Z kliem $
Author:
Peter Kliem

Field Summary
static int BOTTOM
           
static int CENTER
           
static int LEFT
           
static int RIGHT
           
static int TOP
           
 
Constructor Summary
TextRenderer()
           
 
Method Summary
static List<String> breakInLines(org.eclipse.swt.graphics.GC gc, int width, boolean wrap, String text)
           
static int getHeight(org.eclipse.swt.graphics.GC gc, int width, boolean wrap, String text)
           
static void renderText(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rect, boolean wrap, boolean ellipsis, String text)
           
static void renderText(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rect, boolean wrap, boolean ellipsis, String text, int halign, int valign)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values
Constructor Detail

TextRenderer

public TextRenderer()
Method Detail

renderText

public static void renderText(org.eclipse.swt.graphics.GC gc,
                              org.eclipse.swt.graphics.Rectangle rect,
                              boolean wrap,
                              boolean ellipsis,
                              String text)

renderText

public static void renderText(org.eclipse.swt.graphics.GC gc,
                              org.eclipse.swt.graphics.Rectangle rect,
                              boolean wrap,
                              boolean ellipsis,
                              String text,
                              int halign,
                              int valign)

getHeight

public static int getHeight(org.eclipse.swt.graphics.GC gc,
                            int width,
                            boolean wrap,
                            String text)

breakInLines

public static List<String> breakInLines(org.eclipse.swt.graphics.GC gc,
                                        int width,
                                        boolean wrap,
                                        String text)


Copyright © 2013. All Rights Reserved.