org.gnu.gnome

Class ColorPicker

public class ColorPicker extends Button

Deprecated:

The ColorPicker button pops up a ColorSelectionDialog and allows a color to be selected. The button changes color to match the currently selected color. The colors can be set using doubles - values between 0.0 and 1.0, 8 bit integers - values between 0 and 255, and 16 bit integers - values between 0 and 65535.

See Also: org.gnu.gtk.ColorSelectionDialog

Constructor Summary
ColorPicker()
Creates a new instance of ColorPicker
ColorPicker(Handle handle)
Construct a ColorPicker using a handle to a native resource.
Method Summary
voidaddListener(ColorPickerListener listener)
Register an object to handle ColorPicker events.
intgetAlpha16Bit()
Get the alpha of the color as a 16 bit value between 0 and 65535.
intgetAlpha8Bit()
Get the alpha of the color as a 8 bit value between 0 and 255.
doublegetAlphaDouble()
Get the alpha of the color as a double value between 0.0 and 1.0.
booleangetAlphaEnabled()
Returns whether ColorPicker uses alpha.
intgetBlue16Bit()
Get the blue element of the color as a 16 bit value between 0 and 65535.
intgetBlue8Bit()
Get the blue element of the color as a 8 bit value between 0 and 255.
doublegetBlueDouble()
Get the blue element of the color as a double value between 0.0 and 1.0.
booleangetDitherEnabled()
Returns whether ColorPicker uses dither.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
intgetGreen16Bit()
Get the green element of the color as a double value between 0 and 65535.
intgetGreen8Bit()
Get the green element of the color as a double value between 0 and 255.
doublegetGreenDouble()
Get the green element of the color as a double value between 0.0 and 1.0.
intgetRed16Bit()
Get the red element of the color as a double value between 0 and 65535.
intgetRed8Bit()
Get the red element of the color as a double value between 0 and 255.
doublegetRedDouble()
Get the red element of the color as a double value between 0.0 and 1.0.
StringgetTitle()
Gets the title of the color picker.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidremoveListener(ColorPickerListener listener)
Removes a listener
voidsetAlpha16Bit(int alpha)
Set the alpha of the color as a 16 bit value between 0 and 65535.
voidsetAlpha8Bit(int alpha)
Set the alpha of the color as a 8 bit value between 0 and 255.
voidsetAlphaDouble(double alpha)
Set the alpha of the color as a double value between 0.0 and 1.0.
voidsetAlphaEnabled(boolean enable)
Sets whether ColorPicker is to use alpha.
voidsetBlue16Bit(int color)
Set the blue element of the color as a 16 bit value between 0 and 65535.
voidsetBlue8Bit(int color)
Set the blue element of the color as a 8 bit value between 0 and 255.
voidsetBlueDouble(double color)
Set the blue element of the color as a double value between 0.0 and 1.0.
voidsetColor16Bit(int alpha, int blue, int green, int red)
A shortcut method to set all the color values with one call.
voidsetColor8Bit(int alpha, int blue, int green, int red)
A shortcut method to set all the color values with one call.
voidsetColorDouble(double alpha, double blue, double green, double red)
A shortcut method to set all the color values with one call.
voidsetDitherEnabled(boolean enable)
Sets whether ColorPicker is to use dither.
voidsetGreen16Bit(int color)
Set the green element of the color as a integer value between 0 and 65535.
voidsetGreen8Bit(int color)
Set the green element of the color as a integer value between 0 and 255.
voidsetGreenDouble(double color)
Set the green element of the color as a double value between 0.0 and 1.0.
voidsetRed16Bit(int color)
Set the red element of the color as a integer value between 0 and 65535.
voidsetRed8Bit(int color)
Set the red element of the color as a integer value between 0 and 255.
voidsetRedDouble(double color)
Set the red element of the color as a double value between 0.0 and 1.0.
voidsetTitle(String title)
Sets the title of the color picker.

Constructor Detail

ColorPicker

public ColorPicker()
Creates a new instance of ColorPicker

ColorPicker

public ColorPicker(Handle handle)
Construct a ColorPicker using a handle to a native resource.

Method Detail

addListener

public void addListener(ColorPickerListener listener)
Register an object to handle ColorPicker events.

See Also: ColorPickerListener

getAlpha16Bit

public int getAlpha16Bit()
Get the alpha of the color as a 16 bit value between 0 and 65535.

Returns: The alpha of the color.

getAlpha8Bit

public int getAlpha8Bit()
Get the alpha of the color as a 8 bit value between 0 and 255.

Returns: The alpha of the color.

getAlphaDouble

public double getAlphaDouble()
Get the alpha of the color as a double value between 0.0 and 1.0.

Returns: The alpha of the color.

getAlphaEnabled

public boolean getAlphaEnabled()
Returns whether ColorPicker uses alpha.

Returns: True if alpha is used. Otherwise, false.

getBlue16Bit

public int getBlue16Bit()
Get the blue element of the color as a 16 bit value between 0 and 65535.

Returns: The blue element of the color.

getBlue8Bit

public int getBlue8Bit()
Get the blue element of the color as a 8 bit value between 0 and 255.

Returns: The blue element of the color.

getBlueDouble

public double getBlueDouble()
Get the blue element of the color as a double value between 0.0 and 1.0.

Returns: The blue element of the color.

getDitherEnabled

public boolean getDitherEnabled()
Returns whether ColorPicker uses dither.

Returns: True if dither is used. Otherwise, false.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getGreen16Bit

public int getGreen16Bit()
Get the green element of the color as a double value between 0 and 65535.

Returns: The green element of the color.

getGreen8Bit

public int getGreen8Bit()
Get the green element of the color as a double value between 0 and 255.

Returns: The green element of the color.

getGreenDouble

public double getGreenDouble()
Get the green element of the color as a double value between 0.0 and 1.0.

Returns: The green element of the color.

getRed16Bit

public int getRed16Bit()
Get the red element of the color as a double value between 0 and 65535.

Returns: The red element of the color.

getRed8Bit

public int getRed8Bit()
Get the red element of the color as a double value between 0 and 255.

Returns: The red element of the color.

getRedDouble

public double getRedDouble()
Get the red element of the color as a double value between 0.0 and 1.0.

Returns: The red element of the color.

getTitle

public String getTitle()
Gets the title of the color picker.

Returns: The title for the color picker.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

removeListener

public void removeListener(ColorPickerListener listener)
Removes a listener

See Also: addListener

setAlpha16Bit

public void setAlpha16Bit(int alpha)
Set the alpha of the color as a 16 bit value between 0 and 65535.

Parameters: alpha The alpha of the color.

Throws: IllegalArgumentException Thrown if alpha is outside of the valid range 0 to 65535.

setAlpha8Bit

public void setAlpha8Bit(int alpha)
Set the alpha of the color as a 8 bit value between 0 and 255.

Parameters: alpha The alpha of the color.

Throws: IllegalArgumentException Thrown if alpha is outside of the valid range 0 to 255.

setAlphaDouble

public void setAlphaDouble(double alpha)
Set the alpha of the color as a double value between 0.0 and 1.0.

Parameters: alpha The alpha of the color.

Throws: IllegalArgumentException Thrown if alpha is outside of the valid range 0.0 to 1.0.

setAlphaEnabled

public void setAlphaEnabled(boolean enable)
Sets whether ColorPicker is to use alpha.

Parameters: enable True to use alpha. Otherwise, false.

setBlue16Bit

public void setBlue16Bit(int color)
Set the blue element of the color as a 16 bit value between 0 and 65535.

Parameters: color The blue element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 65535.

setBlue8Bit

public void setBlue8Bit(int color)
Set the blue element of the color as a 8 bit value between 0 and 255.

Parameters: color The blue element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 255.

setBlueDouble

public void setBlueDouble(double color)
Set the blue element of the color as a double value between 0.0 and 1.0.

Parameters: color The blue element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0.0 to 1.0.

setColor16Bit

public void setColor16Bit(int alpha, int blue, int green, int red)
A shortcut method to set all the color values with one call. All values must be a integer value between 0 and 65535.

Parameters: alpha The alpha of the color. blue The blue element of the color. green The green element of the color. red The red element of the color.

Throws: IllegalArgumentException Thrown if any given value is outside of the valid range 0 to 65535.

setColor8Bit

public void setColor8Bit(int alpha, int blue, int green, int red)
A shortcut method to set all the color values with one call. All values must be a integer value between 0 and 255.

Parameters: alpha The alpha of the color. blue The blue element of the color. green The green element of the color. red The red element of the color.

Throws: IllegalArgumentException Thrown if any given value is outside of the valid range 0 to 255.

setColorDouble

public void setColorDouble(double alpha, double blue, double green, double red)
A shortcut method to set all the color values with one call. All values must be a double value between 0.0 and 1.0.

Parameters: alpha The alpha of the color. blue The blue element of the color. green The green element of the color. red The red element of the color.

Throws: IllegalArgumentException Thrown if any given value is outside of the valid range 0.0 to 1.0.

setDitherEnabled

public void setDitherEnabled(boolean enable)
Sets whether ColorPicker is to use dither.

Parameters: enable True to use dither. Otherwise, false.

setGreen16Bit

public void setGreen16Bit(int color)
Set the green element of the color as a integer value between 0 and 65535.

Parameters: color The green element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 65535.

setGreen8Bit

public void setGreen8Bit(int color)
Set the green element of the color as a integer value between 0 and 255.

Parameters: color The green element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 255.

setGreenDouble

public void setGreenDouble(double color)
Set the green element of the color as a double value between 0.0 and 1.0.

Parameters: color The green element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0.0 to 1.0.

setRed16Bit

public void setRed16Bit(int color)
Set the red element of the color as a integer value between 0 and 65535.

Parameters: color The red element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 65535.

setRed8Bit

public void setRed8Bit(int color)
Set the red element of the color as a integer value between 0 and 255.

Parameters: color The red element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0 to 255.

setRedDouble

public void setRedDouble(double color)
Set the red element of the color as a double value between 0.0 and 1.0.

Parameters: color The red element of the color.

Throws: IllegalArgumentException Thrown if color is outside of the valid range 0.0 to 1.0.

setTitle

public void setTitle(String title)
Sets the title of the color picker.

Parameters: title The title for the color picker.