|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.GObject
org.gnu.gdk.GC
All drawing operations in GDK take a GC argument. A graphics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics context, the number of arguments to each drawing call is reduced, and communication overhead is minimized.
Field Summary |
Fields inherited from class org.gnu.glib.GObject |
eventsInitialized |
Constructor Summary | |
GC(Handle handle)
|
|
GC(Window window)
|
Method Summary | |
void |
copy(GC source)
Copy the set of values (settings) from another graphics context. |
protected static void |
gdk_gc_copy(Handle dstGC,
Handle srcGC)
|
protected static Handle |
gdk_gc_get_colormap(Handle gc)
|
protected static Handle |
gdk_gc_get_screen(Handle gc)
|
protected static int |
gdk_gc_get_type()
|
protected static Handle |
gdk_gc_new(Handle drawable)
|
protected static void |
gdk_gc_offset(Handle gc,
int xOffset,
int yOffset)
|
protected static void |
gdk_gc_set_background(Handle gc,
Handle color)
|
protected static void |
gdk_gc_set_clip_mask(Handle gc,
Handle mask)
|
protected static void |
gdk_gc_set_clip_origin(Handle gc,
int x,
int y)
|
protected static void |
gdk_gc_set_clip_rectangle(Handle gc,
Handle rectangle)
|
protected static void |
gdk_gc_set_clip_region(Handle gc,
Handle region)
|
protected static void |
gdk_gc_set_colormap(Handle gc,
Handle colormap)
|
protected static void |
gdk_gc_set_dashes(Handle gc,
int dashOffset,
int[] dashList,
int n)
|
protected static void |
gdk_gc_set_exposures(Handle gc,
boolean exposures)
|
protected static void |
gdk_gc_set_fill(Handle gc,
int fill)
|
protected static void |
gdk_gc_set_foreground(Handle gc,
Handle color)
|
protected static void |
gdk_gc_set_function(Handle gc,
int function)
|
protected static void |
gdk_gc_set_line_attributes(Handle gc,
int lineWidth,
int lineStyle,
int capStyle,
int joinStyle)
|
protected static void |
gdk_gc_set_rgb_bg_color(Handle gc,
Handle color)
|
protected static void |
gdk_gc_set_rgb_fg_color(Handle gc,
Handle color)
|
protected static void |
gdk_gc_set_stipple(Handle gc,
Handle stipple)
|
protected static void |
gdk_gc_set_subwindow(Handle gc,
int mode)
|
protected static void |
gdk_gc_set_tile(Handle gc,
Handle tile)
|
protected static void |
gdk_gc_set_ts_origin(Handle gc,
int x,
int y)
|
int |
getClipXOrigin()
Getst he x origin of the clip mask. |
protected static int |
getClipXOrigin(Handle obj)
|
int |
getClipYOrigin()
Gets the y origin of the clip mask. |
protected static int |
getClipYOrigin(Handle obj)
|
Colormap |
getColormap()
Gets the colormap, if it exists. |
static GC |
getDefaultGC(Drawable d)
|
Screen |
getScreen()
|
int |
getTsXOrigin()
Gets the x origin of the tile or stipple. |
protected static int |
getTsXOrigin(Handle obj)
|
int |
getTsYOrigin()
Gets the y origin of the tile or stipple. |
protected static int |
getTsYOrigin(Handle obj)
|
void |
offset(int xOffset,
int yOffset)
Offset attributes such as the clip and tile-stipple origins of the GC so that drawing at X - x_offset, y - y_offset with the offset GC has the same effect as drawing at x, y with the original GC. |
void |
setBackground(Color color)
Sets the background color for the graphics context. |
void |
setClipMask(Bitmap mask)
Sets the clip mask for a graphics context from a bitmap. |
void |
setClipOrigin(int x,
int y)
Sets the origin of the clip mask. |
void |
setClipRectangle(Rectangle rect)
Sets the clip mask for a graphics context from a rectangle. |
void |
setClipRegion(Region reg)
Sets the clip mask for a graphics context from a region. |
void |
setColormap(Colormap colormap)
Sets the colormap to the given colormap. |
void |
setDashes(int dashOffset,
int[] dashList)
Sets the way dashed-lines are drawn. |
void |
setExposures(boolean exposures)
Sets whether copying non-visible portions of a drawable using this graphics context generate exposure events for the corresponding regions of the destination drawable. |
void |
setFillMode(Fill mode)
Sets the fill mode for the graphic context. |
void |
setForeground(Color color)
Sets the foreground color for the graphics context. |
void |
setFunction(Function func)
Determines how the current pixel values and the pixel values being drawn are combined to produce the final pixel values. |
void |
setLineAttributes(int lineWidth,
LineStyle lineStyle,
CapStyle capStyle,
JoinStyle joinStyle)
Sets various attributes of how lines are drawn. |
void |
setOrigin(int x,
int y)
Sets the origin when using tiles or stipples with the GC. |
void |
setRGBBackground(Color color)
Sets the background color using an unallocated color. |
void |
setRGBForeground(Color color)
Sets the foreground color using an unallocated color. |
void |
setStipple(Pixmap stipple)
Sets the stipple bitmap for a graphics context. |
void |
setSubwindow(SubwindowMode mode)
Sets how drawing with this GC on a window will affect child windows. |
void |
setTile(Pixmap tile)
Sets the tile pixmap for the graphics context. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GC(Handle handle)
public GC(Window window)
Method Detail |
public static GC getDefaultGC(Drawable d)
public int getClipXOrigin()
public int getClipYOrigin()
public int getTsXOrigin()
public int getTsYOrigin()
public void setForeground(Color color)
public void setBackground(Color color)
public void setRGBForeground(Color color)
Calling this function for a GC without a colormap is an error.
public void setRGBBackground(Color color)
Calling this function for a GC without a colormap is an error.
public void setFunction(Function func)
public void setFillMode(Fill mode)
public void setTile(Pixmap tile)
public void setStipple(Pixmap stipple)
public void setOrigin(int x, int y)
public void setClipOrigin(int x, int y)
public void setClipRectangle(Rectangle rect)
public void setClipRegion(Region reg)
public void setClipMask(Bitmap mask)
public void setSubwindow(SubwindowMode mode)
public void setExposures(boolean exposures)
Drawable.drawDrawable(org.gnu.gdk.GC, org.gnu.gdk.Drawable, int, int, int, int, int, int)
public void setLineAttributes(int lineWidth, LineStyle lineStyle, CapStyle capStyle, JoinStyle joinStyle)
lineWidth
- the width of lines.lineStyle
- the dash-style for lines.capStyle
- the manner in which the ends of lines are drawn.joinStyle
- the manner in which lines are joined together.public void setDashes(int dashOffset, int[] dashList)
dashOffset
- the phase of the pattern for the dashed
line-style you want to seedashList
- the dash-list for the dashed line-style you
want to set.setLineAttributes(int, org.gnu.gdk.LineStyle, org.gnu.gdk.CapStyle, org.gnu.gdk.JoinStyle)
public void offset(int xOffset, int yOffset)
xOffset
- amount by which to offset the GC in the X directionyOffset
- amount by which to offset the GC in the Y directionpublic void copy(GC source)
source
- the source graphics context.public void setColormap(Colormap colormap)
public Colormap getColormap()
public Screen getScreen()
protected static final int getClipXOrigin(Handle obj)
protected static final int getClipYOrigin(Handle obj)
protected static final int getTsXOrigin(Handle obj)
protected static final int getTsYOrigin(Handle obj)
protected static final int gdk_gc_get_type()
protected static final Handle gdk_gc_new(Handle drawable)
protected static final Handle gdk_gc_get_screen(Handle gc)
protected static final void gdk_gc_set_foreground(Handle gc, Handle color)
protected static final void gdk_gc_set_background(Handle gc, Handle color)
protected static final void gdk_gc_set_rgb_fg_color(Handle gc, Handle color)
protected static final void gdk_gc_set_rgb_bg_color(Handle gc, Handle color)
protected static final void gdk_gc_set_function(Handle gc, int function)
protected static final void gdk_gc_set_fill(Handle gc, int fill)
protected static final void gdk_gc_set_tile(Handle gc, Handle tile)
protected static final void gdk_gc_set_stipple(Handle gc, Handle stipple)
protected static final void gdk_gc_set_ts_origin(Handle gc, int x, int y)
protected static final void gdk_gc_set_clip_origin(Handle gc, int x, int y)
protected static final void gdk_gc_set_clip_mask(Handle gc, Handle mask)
protected static final void gdk_gc_set_clip_rectangle(Handle gc, Handle rectangle)
protected static final void gdk_gc_set_clip_region(Handle gc, Handle region)
protected static final void gdk_gc_set_subwindow(Handle gc, int mode)
protected static final void gdk_gc_set_exposures(Handle gc, boolean exposures)
protected static final void gdk_gc_set_line_attributes(Handle gc, int lineWidth, int lineStyle, int capStyle, int joinStyle)
protected static final void gdk_gc_set_dashes(Handle gc, int dashOffset, int[] dashList, int n)
protected static final void gdk_gc_copy(Handle dstGC, Handle srcGC)
protected static final void gdk_gc_set_colormap(Handle gc, Handle colormap)
protected static final Handle gdk_gc_get_colormap(Handle gc)
protected static final void gdk_gc_offset(Handle gc, int xOffset, int yOffset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |