org.gnu.gtk

Class ColorButton

public class ColorButton extends Button

The ColorButton is a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a ColorSelection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.
Constructor Summary
ColorButton()
Create a new ColorButton.
ColorButton(Color color)
Create a new ColorButton initialized with the provided color.
ColorButton(Handle handle)
For internal use by Java-Gnome only.
Method Summary
voidaddListener(ColorButtonListener listener)
Register an object to handle dialog events.
intgetAlpha()
Returns the current alpha value.
ColorgetColor()
Returns the current color value.
static ColorButtongetColorButton(Handle handle)
For internal use by Java-Gnome only.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
StringgetTitle()
Returns the title from the ColorSelectionDialog.
booleangetUseAlpha()
Returns whether or not the ColorButton is using the alpha channel.
voidremoveListener(ColorButtonListener listener)
Removes a listener
voidsetAlpha(int alpha)
Sets the current opacity to be alpha
voidsetColor(Color color)
Set the current color for the widget.
voidsetTitle(String title)
Sets the color for the ColorSelectionDialog.
voidsetUseAlpha(boolean useAlpha)
Sets whether or not the ColorButton should use the alpha channel.

Constructor Detail

ColorButton

public ColorButton()
Create a new ColorButton.

ColorButton

public ColorButton(Color color)
Create a new ColorButton initialized with the provided color.

Parameters: color A Color to set the current color with.

ColorButton

public ColorButton(Handle handle)
For internal use by Java-Gnome only.

Method Detail

addListener

public void addListener(ColorButtonListener listener)
Register an object to handle dialog events.

See Also: ColorButtonListener

getAlpha

public int getAlpha()
Returns the current alpha value.

getColor

public Color getColor()
Returns the current color value.

getColorButton

public static ColorButton getColorButton(Handle handle)
For internal use by Java-Gnome only.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getTitle

public String getTitle()
Returns the title from the ColorSelectionDialog.

getUseAlpha

public boolean getUseAlpha()
Returns whether or not the ColorButton is using the alpha channel.

removeListener

public void removeListener(ColorButtonListener listener)
Removes a listener

See Also: addListener

setAlpha

public void setAlpha(int alpha)
Sets the current opacity to be alpha

Parameters: alpha

setColor

public void setColor(Color color)
Set the current color for the widget.

Parameters: color

setTitle

public void setTitle(String title)
Sets the color for the ColorSelectionDialog.

Parameters: title

setUseAlpha

public void setUseAlpha(boolean useAlpha)
Sets whether or not the ColorButton should use the alpha channel.

Parameters: useAlpha