org.gnu.gdk
Class Colormap
This object stores the mapping between the color values stored in memory and
the RGB values that are used to display color values.
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.
|
addEventHandler , addEventHandler , addEventHandler , addEventHandler , addEventHandler , addEventHandler , addListener , collect , freezeNotify , getBooleanProperty , getData , getDoubleProperty , getEventListenerClass , getEventType , getFloatProperty , getGObjectFromHandle , getIntProperty , getJavaObjectProperty , getLongProperty , getPixbufProperty , getProperty , getStringProperty , hasProperty , notify , removeEventHandler , removeListener , setBooleanProperty , setData , setDoubleProperty , setFloatProperty , setIntProperty , setJavaObjectProperty , setLongProperty , setPixbufProperty , setProperty , setStringProperty , thawNotify |
Colormap
public Colormap()
Create a Colormap initialized to the system's default colormap.
Colormap
public Colormap(Handle handle)
Create a new Colormap from a handle to a native resource.
Colormap
public Colormap(Visual v,
boolean allocate)
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.
allocateColor
public boolean allocateColor(Color color,
boolean writable,
boolean bestMatch)
Allocates a single color from a colormap.
color
- The color to allocatewritable
- 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)
Allocates colors from a colormap.
colors
- writable
- bestMatch
-
freeColors
public void freeColors(Color[] colors)
Frees previously allocated Colors.
getColormapFromHandle
public static Colormap getColormapFromHandle(Handle hndl)
Internal static factory method to be used only by Java-Gnome.
getColors
public Color[] getColors()
Retrieve all of the Colors associated with the Colormap.
getScreen
public Screen getScreen()
Returns the screen for which the colormap was created.
getSystem
public static Colormap getSystem()
Returns the system's default colormap.
getType
public Type getType()
getVisual
public Visual getVisual()
Returns the visual for which the colormap was created.
queryColor
public Color queryColor(long pixel)
Locates the RGB color corresponding to the given hardware pixel. The
pixel must be a valid pixel in the colormap.