org.gnu.gdk
Class Color

java.lang.Object
  extended byorg.gnu.glib.Boxed
      extended byorg.gnu.gdk.Color

public class Color
extends Boxed

Describes an allocated or unallocated color.


Field Summary
static Color BLACK
           
static Color BLUE
           
static Color GREEN
           
static Color ORANGE
           
static Color RED
           
static Color WHITE
           
static Color YELLOW
           
 
Fields inherited from class org.gnu.glib.Boxed
handle
 
Constructor Summary
Color(Handle handle)
          Construct a Color object from a handle to a native resource.
Color(int red, int green, int blue)
          Creates an sRGB color with the specified red, green, and blue values in the range (0 - 65535).
 
Method Summary
 java.lang.Object clone()
          Makes a copy of this color.
 boolean equals(java.lang.Object color)
          Determines whether another object is equal to this Color.
protected  void finalize()
           
protected static Handle gdk_color_copy(Handle color)
           
protected static boolean gdk_color_equal(Handle colora, Handle colorb)
           
protected static void gdk_color_free(Handle color)
           
protected static int gdk_color_get_type()
           
protected static int gdk_color_hash(Handle colora)
           
protected static int gdk_color_parse(java.lang.String spec, Handle color)
           
 int getBlue()
          Returns the blue component in the range 0-65535 in the default sRGB space.
protected static int getBlue(Handle obj)
           
 int getGreen()
          Returns the green component in the range 0-65535 in the default sRGB space.
protected static int getGreen(Handle obj)
           
protected static int getPixel(Handle obj)
           
 int getRed()
          Returns the red component in the range 0-65535 in the default sRGB space.
protected static int getRed(Handle obj)
           
 int hashCode()
          Returns a hash code value for the object.
static Color parse(java.lang.String spec)
          Parses a textual specification of a color.
protected static void setBlue(Handle obj, int blue)
           
 void setBlue(short value)
          Sets the blue component in the range of 0-65535.
protected static void setGreen(Handle obj, int green)
           
 void setGreen(short value)
          Sets the green component in the range of 0-65535.
protected static void setRed(Handle obj, int red)
           
 void setRed(short value)
          Sets the red component in the range of 0-65535.
 java.lang.String toString()
          Returns a string representation of this Color.
 
Methods inherited from class org.gnu.glib.Boxed
getHandle, setHandle
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RED

public static final Color RED

BLUE

public static final Color BLUE

GREEN

public static final Color GREEN

BLACK

public static final Color BLACK

YELLOW

public static final Color YELLOW

WHITE

public static final Color WHITE

ORANGE

public static final Color ORANGE
Constructor Detail

Color

public Color(Handle handle)
Construct a Color object from a handle to a native resource.


Color

public Color(int red,
             int green,
             int blue)
Creates an sRGB color with the specified red, green, and blue values in the range (0 - 65535).

Method Detail

clone

public java.lang.Object clone()
Makes a copy of this color.


finalize

protected void finalize()

equals

public boolean equals(java.lang.Object color)
Determines whether another object is equal to this Color.

Overrides:
equals in class Boxed
Parameters:
color - the reference object with which to compare.
Returns:
true if both objects refer to the same object.

hashCode

public int hashCode()
Description copied from class: Boxed
Returns a hash code value for the object. This allows for using Boxed objects as keys in hashmaps.

Overrides:
hashCode in class Boxed
Returns:
a hash code value for the object.

getRed

public int getRed()
Returns the red component in the range 0-65535 in the default sRGB space.


setRed

public void setRed(short value)
Sets the red component in the range of 0-65535.


getGreen

public int getGreen()
Returns the green component in the range 0-65535 in the default sRGB space.


setGreen

public void setGreen(short value)
Sets the green component in the range of 0-65535.


getBlue

public int getBlue()
Returns the blue component in the range 0-65535 in the default sRGB space.


setBlue

public void setBlue(short value)
Sets the blue component in the range of 0-65535.


toString

public java.lang.String toString()
Returns a string representation of this Color.


parse

public static Color parse(java.lang.String spec)
Parses a textual specification of a color. The text string can be in any of the forms accepted by XParseColor; these include name for a color from rgb.txt, such as DarkSlateGray or a hex specification such as 305050.

Parameters:
spec -

getPixel

protected static final int getPixel(Handle obj)

getRed

protected static final int getRed(Handle obj)

setRed

protected static final void setRed(Handle obj,
                                   int red)

getGreen

protected static final int getGreen(Handle obj)

setGreen

protected static final void setGreen(Handle obj,
                                     int green)

getBlue

protected static final int getBlue(Handle obj)

setBlue

protected static final void setBlue(Handle obj,
                                    int blue)

gdk_color_get_type

protected static final int gdk_color_get_type()

gdk_color_copy

protected static final Handle gdk_color_copy(Handle color)

gdk_color_free

protected static final void gdk_color_free(Handle color)

gdk_color_parse

protected static final int gdk_color_parse(java.lang.String spec,
                                           Handle color)

gdk_color_hash

protected static final int gdk_color_hash(Handle colora)

gdk_color_equal

protected static final boolean gdk_color_equal(Handle colora,
                                               Handle colorb)