gnu.gcj.xlib

Class Colormap


public final class Colormap
extends XID

An X11 color map resource.

Field Summary

static byte
FLAG_NOT_SHARED
static byte
FLAG_SHARED

Fields inherited from class gnu.gcj.xlib.XID

display, xid

Constructor Summary

Colormap(Screen screen, int xid)

Method Summary

XColor
allocateColor(int r, int g, int b)
Allocate a color consisting of the given RGB-triplet.
long
allocateColorPixel(XColor color)
Allocate color pixel.
XColor[]
getSharedColors()
Get an array of all colors that currently resides in shared (read only) color-cells in this color map.
XColor[]
getXColors()
Get all colors currently residing in this color map.

Methods inherited from class gnu.gcj.xlib.XID

getClientData, getDisplay, getXID, params, setClientData, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

FLAG_NOT_SHARED

public static final byte FLAG_NOT_SHARED
Field Value:
2

FLAG_SHARED

public static final byte FLAG_SHARED
Field Value:
1

Constructor Details

Colormap

public Colormap(Screen screen,
                int xid)

Method Details

allocateColor

public XColor allocateColor(int r,
                            int g,
                            int b)
Allocate a color consisting of the given RGB-triplet.
Returns:
a color object describing the allocated color.

allocateColorPixel

public long allocateColorPixel(XColor color)
Allocate color pixel.
Parameters:
color - The color to be allocated. If allocation is successful, this object will be modified to reflect the actual color that was allocated.
Returns:
the pixel value of the allocated color.

getSharedColors

public XColor[] getSharedColors()
Get an array of all colors that currently resides in shared (read only) color-cells in this color map.

getXColors

public XColor[] getXColors()
Get all colors currently residing in this color map. Colors that are shared (read only) are marked as such by the color flags. The indexes of the returned array will correspond to the colorcells of the color map. Given a color XColor color from a given color-cell, the expression color.getFlags() == Colormap.FLAG_SHARED will check whether the color-cell is shared.

Copyright (C) 2000 Free Software Foundation This file is part of libgcj. This software is copyrighted work licensed under the terms of the Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details.