i3mclient.i3m
Class ResourceManager

java.lang.Object
  |
  +--i3mclient.i3m.ResourceManager

public class ResourceManager
extends Object

Manage all object, which needed to disposed.

Author:
Dirk Plate

Field Summary
static int COLOR
          Identifies a color resource
static int CURSOR
          Identifies a cursor resource
static int FONT
          Identifies a font resource
static int GC
          Identifies a gc resource
static int IMAGE
          Identifies an image resource
 
Constructor Summary
ResourceManager()
          Constructor.
 
Method Summary
 Color addColor(Object group, Color object)
          Add a color resource to a group.
 Cursor addCursor(Object group, Cursor object)
          Add a cursor resource to a group.
 Font addFont(Object group, Font object)
          Add a font resource to a group.
 GC addGC(Object group, GC object)
          Add a gc resource to a group.
 Image addImage(Object group, Image object)
          Add a image resource to a group.
 Object addResource(int type, Object group, Object object)
          Add a resource to a group.
 void disposeAll()
          Dispose all resources of all groups.
 void disposeGroup(Object group)
          Dispose all resources of a group.
static ResourceManager getInstance()
          Returns an instance of this class (singleton construction)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE

public static final int IMAGE
Identifies an image resource

See Also:
Constant Field Values

CURSOR

public static final int CURSOR
Identifies a cursor resource

See Also:
Constant Field Values

COLOR

public static final int COLOR
Identifies a color resource

See Also:
Constant Field Values

FONT

public static final int FONT
Identifies a font resource

See Also:
Constant Field Values

GC

public static final int GC
Identifies a gc resource

See Also:
Constant Field Values
Constructor Detail

ResourceManager

public ResourceManager()
Constructor.

Method Detail

getInstance

public static ResourceManager getInstance()
Returns an instance of this class (singleton construction)

Returns:
The unique instance of this class

addResource

public Object addResource(int type,
                          Object group,
                          Object object)
Add a resource to a group.

Parameters:
type - The type of the new resource
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)
See Also:
addColor(Object,Color), addCursor(Object,Cursor), addFont(Object,Font), addGC(Object,GC), addImage(Object,Image)

addImage

public Image addImage(Object group,
                      Image object)
Add a image resource to a group.

Parameters:
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)

addCursor

public Cursor addCursor(Object group,
                        Cursor object)
Add a cursor resource to a group.

Parameters:
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)

addColor

public Color addColor(Object group,
                      Color object)
Add a color resource to a group.

Parameters:
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)

addFont

public Font addFont(Object group,
                    Font object)
Add a font resource to a group.

Parameters:
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)

addGC

public GC addGC(Object group,
                GC object)
Add a gc resource to a group.

Parameters:
group - In which group should the resource inserted
object - The resource
Returns:
The same resource (for easier handling of this function)

disposeGroup

public void disposeGroup(Object group)
Dispose all resources of a group.

Parameters:
group - All resources of the group will be disposed

disposeAll

public void disposeAll()
Dispose all resources of all groups.