com.ibm.commons.swt.util
Class ColorWrapper

java.lang.Object
  extended by com.ibm.commons.swt.util.Resource
      extended by com.ibm.commons.swt.util.ColorWrapper

public class ColorWrapper
extends com.ibm.commons.swt.util.Resource

SWT Color wrapper. Automatically takes care of disposing of the Color. This class however does NOT extend org.eclipse.swt.graphics.Color, so it is not interchangeable with org.eclipse.swt.graphics.Color.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.commons.swt.util.Resource
com.ibm.commons.swt.util.Resource.Entry, com.ibm.commons.swt.util.Resource.ResourceRegistry
 
Constructor Summary
ColorWrapper(org.eclipse.swt.graphics.Device device, int r, int g, int b)
          Constructs a new instance of the class given the Device, and the Red, Green and Blue values of the desired color.
ColorWrapper(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.RGB data)
          Constructs a new instance of the class given the Device, and the RGB value of the desired color.
ColorWrapper(int r, int g, int b)
          Constructs a new instance of the Red, Green and Blue values of the desired color.
ColorWrapper(org.eclipse.swt.graphics.RGB data)
          Constructs a new instance of the class given the RGB value of the desired color.
 
Method Summary
 void dispose()
           
protected  void finalize()
           
 org.eclipse.swt.graphics.Color getColor()
           
 org.eclipse.swt.graphics.RGB getRGB()
           
 
Methods inherited from class com.ibm.commons.swt.util.Resource
findRegistry
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorWrapper

public ColorWrapper(org.eclipse.swt.graphics.Device device,
                    org.eclipse.swt.graphics.RGB data)
Constructs a new instance of the class given the Device, and the RGB value of the desired color.

Parameters:
device - - org.eclipse.swt.graphics.Device
data - - org.eclipse.swt.graphics.RGB

ColorWrapper

public ColorWrapper(org.eclipse.swt.graphics.Device device,
                    int r,
                    int g,
                    int b)
Constructs a new instance of the class given the Device, and the Red, Green and Blue values of the desired color.

Parameters:
device - - org.eclipse.swt.graphics.Device
r - - red int value
g - - green int value
b - - blue int value

ColorWrapper

public ColorWrapper(org.eclipse.swt.graphics.RGB data)
Constructs a new instance of the class given the RGB value of the desired color.

Parameters:
data - - org.eclipse.swt.graphics.RGB

ColorWrapper

public ColorWrapper(int r,
                    int g,
                    int b)
Constructs a new instance of the Red, Green and Blue values of the desired color.

Parameters:
r - - red int value
g - - green int value
b - - blue int value
Method Detail

dispose

public void dispose()

getRGB

public org.eclipse.swt.graphics.RGB getRGB()

getColor

public org.eclipse.swt.graphics.Color getColor()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable