uic.widgets
Class GuiHelper

java.lang.Object
  extended byuic.widgets.GuiHelper

public class GuiHelper
extends Object

various static method to provide functionality not immidiately available in Swing.


Constructor Summary
GuiHelper()
           
 
Method Summary
static void drawFocusRectangle(Graphics g, int x, int y, int width, int height)
          Draw a focus rectangle, Focus color must be set before calling this function
static String encodeColor(Color color)
          This is the reverse of Color.decode()
static int getWidthAsComponent(Object theObject)
           
static int getWidthAsComponent(Object theObject, Font useFont)
          Returns the width of the object when it would be drawn as a component (in a JTable).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiHelper

public GuiHelper()
Method Detail

getWidthAsComponent

public static int getWidthAsComponent(Object theObject)

getWidthAsComponent

public static int getWidthAsComponent(Object theObject,
                                      Font useFont)
Returns the width of the object when it would be drawn as a component (in a JTable).

Parameters:
theObject - this is the content. A String or an icon can be given.
useFont - provide a Font object that will be used to calculate the width when it turns out to be something that has to be rendered using a font (i.e. not an icon etc).
Returns:
width When a widget is given the width of the widget is used; if unknown* the width of the toString will be returned.

encodeColor

public static String encodeColor(Color color)
This is the reverse of Color.decode()


drawFocusRectangle

public static void drawFocusRectangle(Graphics g,
                                      int x,
                                      int y,
                                      int width,
                                      int height)
Draw a focus rectangle, Focus color must be set before calling this function



Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence