|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.swt.graphics.Color
Safe:
Field Summary | |
(package private) Device |
device
the device where this color was created |
int |
handle
Suppressed: the handle to the OS color resource (Warning: This field is platform dependent) |
Constructor Summary | |
(package private) |
Color()
Prevents uninitialized instances from being created outside the package. |
|
Color(Device device,
int red,
int green,
int blue)
Enabled: Constructs a new instance of this class given a device and the desired red, green and blue values expressed as ints in the range 0 to 255 (where 0 is black and 255 is full brightness). |
|
Color(Device device,
RGB rgb)
Enabled: Constructs a new instance of this class given a device and an RGB describing the desired red, green and blue values. |
Method Summary | |
void |
dispose()
Enabled: Disposes of the operating system resources associated with the color. |
boolean |
equals(Object object)
Suppressed: Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
int |
getBlue()
Enabled: Returns the amount of blue in the color, from 0 to 255. |
int |
getGreen()
Enabled: Returns the amount of green in the color, from 0 to 255. |
int |
getRed()
Enabled: Returns the amount of red in the color, from 0 to 255. |
RGB |
getRGB()
Enabled: Returns an RGB representing the receiver. |
int |
hashCode()
Suppressed: Returns an integer hash code for the receiver. |
(package private) void |
init(Device device,
int red,
int green,
int blue)
Allocates the operating system resources associated with the receiver. |
boolean |
isDisposed()
Enabled: Returns true if the color has been disposed,
and false otherwise. |
String |
toString()
Suppressed: Returns a string containing a concise, human-readable description of the receiver. |
static Color |
win32_new(Device device,
int handle)
Suppressed: Invokes platform specific functionality to allocate a new color. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int handle
Device device
Constructor Detail |
Color()
public Color(Device device, int red, int green, int blue)
You must dispose the color when it is no longer required.
device
- the device on which to allocate the colorred
- the amount of red in the colorgreen
- the amount of green in the colorblue
- the amount of blue in the colordispose()
public Color(Device device, RGB rgb)
RGB
describing the desired red, green and blue values.
On limited color devices, the color instance created by this call
may not have the same RGB values as the ones specified by the
argument. The RGB values on the returned instance will be the color
values of the operating system color.
You must dispose the color when it is no longer required.
device
- the device on which to allocate the colordispose()
Method Detail |
public void dispose()
public boolean equals(Object object)
equals
in class Object
object
- the object to compare with this object
true
if the object is the same as this object and false
otherwisehashCode()
public int getBlue()
public int getGreen()
public int getRed()
public RGB getRGB()
RGB
representing the receiver.
public int hashCode()
true
when passed to
equals
must return the same value for this
method.
hashCode
in class Object
equals(java.lang.Object)
void init(Device device, int red, int green, int blue)
device
- the device on which to allocate the colorred
- the amount of red in the colorgreen
- the amount of green in the colorblue
- the amount of blue in the colordispose()
public boolean isDisposed()
true
if the color has been disposed,
and false
otherwise.
This method gets the dispose state for the color. When a color has been disposed, it is an error to invoke any other method using the color.
true
when the color is disposed and false
otherwisepublic String toString()
toString
in class Object
public static Color win32_new(Device device, int handle)
IMPORTANT: This method is not part of the public
API for Color
. It is marked public only so that it
can be shared within the packages provided by SWT. It is not
available on all platforms, and should never be called from
application code.
device
- the device on which to allocate the colorhandle
- the handle for the color
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |