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)
Deprecated.
|
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(...).
|
@Deprecated public static ColorDescriptor createFrom(Color toCreate, Device originalDevice)
createFrom(Color)
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)
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
DeviceResourceDescriptor
createResource
in class DeviceResourceDescriptor
device
- the Device on which to allocate the resourceDeviceResourceException
- if unable to allocate the resourcepublic final void destroyResource(Object previouslyCreatedObject)
DeviceResourceDescriptor
destroyResource
in class DeviceResourceDescriptor
previouslyCreatedObject
- an object that was returned by an equal
descriptor in a previous call to createResource(...).
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.