org.gnu.gdk

Class Colormap

public class Colormap extends GObject

Deprecated: This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may exist in java-gnome 4.0; look out for org.gnome.gdk.Colormap.

This object stores the mapping between the color values stored in memory and the RGB values that are used to display color values.
Constructor Summary
Colormap()
Create a Colormap initialized to the system's default colormap.
Colormap(Handle handle)
Create a new Colormap from a handle to a native resource.
Colormap(Visual v, boolean allocate)
Creates a new colormap for the given visual.
Method Summary
booleanallocateColor(Color color, boolean writable, boolean bestMatch)
Allocates a single color from a colormap.
boolean[]allocateColors(Color[] colors, boolean writable, boolean bestMatch)
Allocates colors from a colormap.
voidfreeColors(Color[] colors)
Frees previously allocated Colors.
static ColormapgetColormapFromHandle(Handle hndl)
Internal static factory method to be used only by Java-Gnome.
Color[]getColors()
Retrieve all of the Colors associated with the Colormap.
ScreengetScreen()
Returns the screen for which the colormap was created.
static ColormapgetSystem()
Returns the system's default colormap.
TypegetType()
VisualgetVisual()
Returns the visual for which the colormap was created.
ColorqueryColor(long pixel)
Locates the RGB color corresponding to the given hardware pixel.

Constructor Detail

Colormap

public Colormap()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a Colormap initialized to the system's default colormap.

Colormap

public Colormap(Handle handle)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a new Colormap from a handle to a native resource.

Colormap

public Colormap(Visual v, boolean allocate)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Creates a new colormap for the given visual. If allocate is true the newly created colormap will be a private colormap, and all colors in it will be allocated for the application use.

Method Detail

allocateColor

public boolean allocateColor(Color color, boolean writable, boolean bestMatch)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Allocates a single color from a colormap.

Parameters: color The color to allocate writable If true the color is allocated writable. bestMatch If true GDK will attempt to do matching against existing colors if the color cannot be allocated as requested.

allocateColors

public boolean[] allocateColors(Color[] colors, boolean writable, boolean bestMatch)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Allocates colors from a colormap.

Parameters: colors writable bestMatch

freeColors

public void freeColors(Color[] colors)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Frees previously allocated Colors.

Parameters: colors

getColormapFromHandle

public static Colormap getColormapFromHandle(Handle hndl)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Internal static factory method to be used only by Java-Gnome.

getColors

public Color[] getColors()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Retrieve all of the Colors associated with the Colormap.

getScreen

public Screen getScreen()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Returns the screen for which the colormap was created.

getSystem

public static Colormap getSystem()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Returns the system's default colormap.

getType

public Type getType()

getVisual

public Visual getVisual()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Returns the visual for which the colormap was created.

queryColor

public Color queryColor(long pixel)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Locates the RGB color corresponding to the given hardware pixel. The pixel must be a valid pixel in the colormap.

Parameters: pixel