public abstract class ColorDescriptor extends DeviceResourceDescriptor
| Constructor and Description |
|---|
ColorDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
abstract Color |
createColor(Device device)
Returns the Color described by this descriptor.
|
static ColorDescriptor |
createFrom(Color toCreate)
Creates a ColorDescriptor from an existing color.
|
static ColorDescriptor |
createFrom(Color toCreate,
Device originalDevice)
Creates a ColorDescriptor from an existing Color, given the Device associated
with the original Color.
|
static ColorDescriptor |
createFrom(RGB toCreate)
Returns a color descriptor for the given RGB values
|
Object |
createResource(Device device)
Creates the resource described by this descriptor
|
abstract void |
destroyColor(Color toDestroy)
Undoes whatever was done by createColor.
|
void |
destroyResource(Object previouslyCreatedObject)
Undoes everything that was done by a previous call to create(...), given
the object that was returned by create(...).
|
public static ColorDescriptor createFrom(Color toCreate, Device originalDevice)
toCreate - Color to convert into a ColorDescriptor.originalDevice - this must be the same Device that was passed into the
original Color's constructor.public static ColorDescriptor createFrom(Color toCreate)
This is less efficient than createFrom(Color, Device), so this
version should only be used in situations where the device associated
with the color is unknown.
toCreate - Color to generate a ColorDescriptor frompublic static ColorDescriptor createFrom(RGB toCreate)
toCreate - RGB values to createpublic abstract Color createColor(Device device) throws DeviceResourceException
device - SWT device on which to allocate the ColorDeviceResourceException - if unable to allocate the Colorpublic abstract void destroyColor(Color toDestroy)
toDestroy - a Color that was previously allocated by an equal ColorDescriptorpublic final Object createResource(Device device) throws DeviceResourceException
DeviceResourceDescriptorcreateResource in class DeviceResourceDescriptordevice - the Device on which to allocate the resourceDeviceResourceException - if unable to allocate the resourcepublic final void destroyResource(Object previouslyCreatedObject)
DeviceResourceDescriptordestroyResource in class DeviceResourceDescriptorpreviouslyCreatedObject - an object that was returned by an equal
descriptor in a previous call to createResource(...).Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.