de.tu_berlin.cs.tfs.muvitorkit.ui.utils
Class SWTResourceManager

java.lang.Object
  extended by de.tu_berlin.cs.tfs.muvitorkit.ui.utils.SWTResourceManager

public class SWTResourceManager
extends Object

Class to manage SWT resources (Font, Color, Image and Cursor) There are no restrictions on the use of this code. You may change this code and your changes will not be overwritten, but if you change the version number below then this class will be completely overwritten by Jigloo. #SWTResourceManager:version4.0.0#

Rating red

Constructor Summary
SWTResourceManager()
           
 
Method Summary
static void dispose()
           
static Color getColor(int red, int green, int blue)
           
static Color getColor(RGB rgb)
           
static Cursor getCursor(int type)
           
static Font getFont(String name, int size, int style)
           
static Font getFont(String name, int size, int style, boolean strikeout, boolean underline)
           
static Image getImage(String urlPar)
           
static Image getImage(String url, Control widget)
           
static void registerResourceUser(Widget widget)
          This method should be called by *all* Widgets which use resources provided by this SWTResourceManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTResourceManager

public SWTResourceManager()
Method Detail

registerResourceUser

public static void registerResourceUser(Widget widget)
This method should be called by *all* Widgets which use resources provided by this SWTResourceManager. When widgets are disposed, they are removed from the "users" Vector, and when no more registered Widgets are left, all resources are disposed.

If this method is not called for all Widgets then it should not be called at all, and the "dispose" method should be explicitly called after all resources are no longer being used.


dispose

public static void dispose()

getFont

public static Font getFont(String name,
                           int size,
                           int style)

getFont

public static Font getFont(String name,
                           int size,
                           int style,
                           boolean strikeout,
                           boolean underline)

getImage

public static Image getImage(String url,
                             Control widget)

getImage

public static Image getImage(String urlPar)

getColor

public static Color getColor(RGB rgb)

getColor

public static Color getColor(int red,
                             int green,
                             int blue)

getCursor

public static Cursor getCursor(int type)