Provides support for drawing points, lines, arcs, and text onto what we
call 'drawables'. Drawables, as the name suggests, are things which support
drawing onto them and are either org.gnu.gdk.Window or org.gnu.gdk.Pixmap
objects.
drawArc
public void drawArc(boolean filled,
int x,
int y,
int width,
int height,
int angle1,
int angle2)
Draws an arc or a filled 'pie slice'. The arc is defined by the
bounding rectangle of the entire elipse, and the start and end
angles of the part of the elipse to be drawn.
filled
- x
- y
- width
- height
- angle1
- angle2
-
drawArc
public void drawArc(GC gc,
boolean filled,
int x,
int y,
int width,
int height,
int angle1,
int angle2)
Draws an arc or a filled 'pie slice'. The arc is defined by the
bounding rectangle of the entire elipse, and the start and end
angles of the part of the elipse to be drawn.
gc
- filled
- x
- y
- width
- height
- angle1
- angle2
-
drawDrawable
public void drawDrawable(Drawable src,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
Convience method that copies the width x height region of
the Drawable at coordinates (xsrc,ysrc) to coordinates
(xdest,ydest) using the default GC.
src
- xsrc
- ysrc
- xdest
- ydest
- width
- height
-
drawDrawable
public void drawDrawable(GC gc,
Drawable src,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
Copies the width x height region of the Drawable at coordinates
(xsrc,ysrc) to coordinates (xdest,ydest).
gc
- src
- xsrc
- ysrc
- xdest
- ydest
- width
- height
-
drawGlyphs
public void drawGlyphs(GC gc,
Font font,
int x,
int y,
GlyphString glyphs)
This is a low-level function. Normally, 99 percent of text rendering should
be down using drawLayout() instead.
A glyph is a single image in a font. This method draws a
sequence of glyphs.
gc
- font
- x
- y
- glyphs
-
drawGlyphs
public void drawGlyphs(Font font,
int x,
int y,
GlyphString glyphs)
This is a low-level function. Normally, 99 percent of text rendering should
be down using drawLayout() instead.
A glyph is a single image in a font. This method draws a
sequence of glyphs.
font
- x
- y
- glyphs
-
drawGrayImage
public void drawGrayImage(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawGrayImage
public void drawGrayImage(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawImage
public void drawImage(GC gc,
Image image,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
Draw an Image onto this Drawable. The depth of the Image must
match the depth of this Drawable.
gc
- image
- xsrc
- ysrc
- xdest
- ydest
- width
- height
-
drawImage
public void drawImage(Image image,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
Draw an Image onto this Drawable using the default GC.
The depth of the Image must match the depth of this Drawable.
image
- xsrc
- ysrc
- xdest
- ydest
- width
- height
-
drawIndexedImage
public void drawIndexedImage(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
RgbCmap cmap)
drawIndexedImage
public void drawIndexedImage(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
RgbCmap cmap)
drawLayout
public void drawLayout(int x,
int y,
Layout layout)
Render a Layout onto this Drawable using the default GC.
x
- y
- layout
-
drawLayout
public void drawLayout(GC gc,
int x,
int y,
Layout layout)
Render a Layout onto this Drawable.
gc
- x
- y
- layout
-
drawLayoutLine
public void drawLayoutLine(int x,
int y,
LayoutLine line)
Render a LayoutLine onto this Drawable using the default GC.
x
- y
- line
-
drawLayoutLine
public void drawLayoutLine(GC gc,
int x,
int y,
LayoutLine line)
Render a LayoutLine onto this Drawable.
gc
- x
- y
- line
-
drawLayoutLineWithColors
public void drawLayoutLineWithColors(int x,
int y,
LayoutLine line,
Color foreground,
Color background)
Render a LayoutLne onto this Drawable overriding the layout's normal
colors with the provided forground and background and using the default
GC.
x
- y
- line
- foreground
- background
-
drawLayoutLineWithColors
public void drawLayoutLineWithColors(GC gc,
int x,
int y,
LayoutLine line,
Color foreground,
Color background)
Render a LayoutLne onto this Drawable overriding the layout's normal
colors with the provided forground and background.
gc
- x
- y
- line
- foreground
- background
-
drawLayoutWithColors
public void drawLayoutWithColors(int x,
int y,
Layout layout,
Color foreground,
Color background)
Render a Layout onto this Drawable overriding the layout's normal
colors with the provided forground and background using the
default GC.
x
- y
- layout
- foreground
- background
-
drawLayoutWithColors
public void drawLayoutWithColors(GC gc,
int x,
int y,
Layout layout,
Color foreground,
Color background)
Render a Layout onto this Drawable overriding the layout's normal
colors with the provided forground and background.
gc
- x
- y
- layout
- foreground
- background
-
drawLine
public void drawLine(int x1,
int y1,
int x2,
int y2)
Draw a line using the foreground color and other attributes
of the default GC.
x1
- y1
- x2
- y2
-
drawLine
public void drawLine(GC gc,
int x1,
int y1,
int x2,
int y2)
Draw a line using the foreground color and other attributes
of the GC.
gc
- x1
- y1
- x2
- y2
-
drawLines
public void drawLines(GC gc,
Point points)
Draw a series of lines connecting the given points. The
way in which joins between lines are drawn is determined
by the CapStyle value in GC.
gc
- points
-
drawLines
public void drawLines(Point points)
Draw a series of lines connecting the given points. The
way in which joins between lines are drawn is determined
by the CapStyle value in the default GC.
points
-
drawPixbuf
public void drawPixbuf(GC gc,
Pixbuf pixbuf,
int srcx,
int srcy,
int destx,
int desty,
int width,
int height,
RgbDither dither,
int xdither,
int ydither)
Render a rectangular portion of a Pixbuf to this Drawable.
gc
- pixbuf
- srcx
- srcy
- destx
- desty
- width
- height
- dither
- xdither
- ydither
-
drawPixbuf
public void drawPixbuf(Pixbuf pixbuf,
int srcx,
int srcy,
int destx,
int desty,
int width,
int height,
RgbDither dither,
int xdither,
int ydither)
Render a rectangular portion of a Pixbuf to this Drawable.
pixbuf
- srcx
- srcy
- destx
- desty
- width
- height
- dither
- xdither
- ydither
-
drawPoint
public void drawPoint(int x,
int y)
Draw a point using the foreground color and other attributes
of the default GC.
x
- y
-
drawPoint
public void drawPoint(GC gc,
int x,
int y)
Draw a point using the foreground color and other attributes
of the GC.
gc
- x
- y
-
drawPoints
public void drawPoints(GC gc,
Point points)
Draw a number of points using the forground color and other
attributes of the GC.
gc
- points
-
drawPoints
public void drawPoints(Point points)
Draw a number of points using the forground color and other
attributes of the default GC.
points
-
drawPolygon
public void drawPolygon(boolean filled,
Point points)
Convience method that draws an outlined or filled polygon
using the default GC.
filled
- points
-
drawPolygon
public void drawPolygon(GC gc,
boolean filled,
Point points)
Draws an outlined or filled polygon.
gc
- filled
- points
-
drawRGB32Image
public void drawRGB32Image(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawRGB32Image
public void drawRGB32Image(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawRGB32ImageDitherAlign
public void drawRGB32ImageDitherAlign(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
int xdith,
int ydith)
drawRGB32ImageDitherAlign
public void drawRGB32ImageDitherAlign(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
int xdith,
int ydith)
drawRGBImage
public void drawRGBImage(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawRGBImage
public void drawRGBImage(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride)
drawRGBImageDitherAlign
public void drawRGBImageDitherAlign(int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
int xdith,
int ydith)
drawRGBImageDitherAlign
public void drawRGBImageDitherAlign(GC gc,
int x,
int y,
int width,
int height,
RgbDither dither,
byte[] buffer,
int rowStride,
int xdith,
int ydith)
drawRectangle
public void drawRectangle(boolean filled,
int x,
int y,
int width,
int height)
Draws a rectangle outlined or filled using the forground color
and other attributes of the default GC.
filled
- x
- y
- width
- height
-
drawRectangle
public void drawRectangle(GC gc,
boolean filled,
int x,
int y,
int width,
int height)
Draws a rectangle outlined or filled using the forground color
and other attributes of the GC.
gc
- filled
- x
- y
- width
- height
-
drawSegments
public void drawSegments(GC gc,
Segment segments)
Draw a number of unconnected lines.
gc
- segments
-
drawSegments
public void drawSegments(Segment segments)
Draw a number of unconnected lines using the default
GC.
segments
-
gdk_draw_arc
protected static final void gdk_draw_arc(Handle drawable,
Handle gc,
boolean filled,
int x,
int y,
int width,
int height,
int angle1,
int angle2)
gdk_draw_drawable
protected static final void gdk_draw_drawable(Handle drawable,
Handle gc,
Handle src,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
gdk_draw_glyphs
protected static final void gdk_draw_glyphs(Handle drawable,
Handle gc,
Handle font,
int x,
int y,
Handle glyphs)
gdk_draw_gray_image
protected static final void gdk_draw_gray_image(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] rgbBuf,
int rowstride)
gdk_draw_image
protected static final void gdk_draw_image(Handle drawable,
Handle gc,
Handle image,
int xsrc,
int ysrc,
int xdest,
int ydest,
int width,
int height)
gdk_draw_indexed_image
protected static final void gdk_draw_indexed_image(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] buf,
int rowstride,
Handle cmap)
gdk_draw_layout
protected static final void gdk_draw_layout(Handle drawable,
Handle gc,
int x,
int y,
Handle layout)
gdk_draw_layout_line
protected static final void gdk_draw_layout_line(Handle drawable,
Handle gc,
int x,
int y,
Handle line)
gdk_draw_layout_line_with_colors
protected static final void gdk_draw_layout_line_with_colors(Handle drawable,
Handle gc,
int x,
int y,
Handle line,
Handle foreground,
Handle background)
gdk_draw_layout_with_colors
protected static final void gdk_draw_layout_with_colors(Handle drawable,
Handle gc,
int x,
int y,
Handle layout,
Handle foreground,
Handle background)
gdk_draw_line
protected static final void gdk_draw_line(Handle drawable,
Handle gc,
int x1,
int y1,
int x2,
int y2)
gdk_draw_lines
protected static final void gdk_draw_lines(Handle drawable,
Handle gc,
Handle[] points)
gdk_draw_pixbuf
protected static final void gdk_draw_pixbuf(Handle drawable,
Handle gc,
Handle pixbuf,
int srcx,
int srcy,
int destx,
int desty,
int width,
int height,
int dither,
int xdith,
int ydith)
gdk_draw_point
protected static final void gdk_draw_point(Handle drawable,
Handle gc,
int x,
int y)
gdk_draw_points
protected static final void gdk_draw_points(Handle drawable,
Handle gc,
Handle[] points)
gdk_draw_polygon
protected static final void gdk_draw_polygon(Handle drawable,
Handle gc,
boolean filled,
Handle[] points)
gdk_draw_rectangle
protected static final void gdk_draw_rectangle(Handle drawable,
Handle gc,
boolean filled,
int x,
int y,
int width,
int height)
gdk_draw_rgb_32_image
protected static final void gdk_draw_rgb_32_image(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] rgbBuf,
int rowstride)
gdk_draw_rgb_32_image_dithalign
protected static final void gdk_draw_rgb_32_image_dithalign(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] rgbBuf,
int rowstride,
int xDith,
int yDith)
gdk_draw_rgb_image
protected static final void gdk_draw_rgb_image(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] rgbBuf,
int rowstride)
gdk_draw_rgb_image_dithalign
protected static final void gdk_draw_rgb_image_dithalign(Handle drawable,
Handle gc,
int x,
int y,
int width,
int height,
int dith,
byte[] rgbBuf,
int rowstride,
int xDith,
int yDith)
gdk_draw_segments
protected static final void gdk_draw_segments(Handle drawable,
Handle gc,
Handle[] segments)
gdk_drawable_get_clip_region
protected static final Handle gdk_drawable_get_clip_region(Handle drawable)
gdk_drawable_get_colormap
protected static final Handle gdk_drawable_get_colormap(Handle drawable)
gdk_drawable_get_depth
protected static final int gdk_drawable_get_depth(Handle drawable)
gdk_drawable_get_display
protected static final Handle gdk_drawable_get_display(Handle drawable)
gdk_drawable_get_image
protected static final Handle gdk_drawable_get_image(Handle drawable,
int x,
int y,
int width,
int height)
gdk_drawable_get_screen
protected static final Handle gdk_drawable_get_screen(Handle drawable)
gdk_drawable_get_size
protected static final void gdk_drawable_get_size(Handle drawable,
int[] width,
int[] height)
gdk_drawable_get_type
protected static final int gdk_drawable_get_type()
gdk_drawable_get_visible_region
protected static final Handle gdk_drawable_get_visible_region(Handle drawable)
gdk_drawable_get_visual
protected static final Handle gdk_drawable_get_visual(Handle drawable)
gdk_drawable_set_colormap
protected static final void gdk_drawable_set_colormap(Handle drawable,
Handle colormap)
getClipRegion
public Region getClipRegion()
Computes the Region of a Drawable that potentially can be written to
by drawing primitives. This Region will not take into account the
clip region for the GC, and may also not take into account other factors
such as if the Window is obscured by other Windows.
getColormap
public Colormap getColormap()
Gets the Colormap for the Drawable if one is set; returns null
otherwise.
getDepth
public int getDepth()
Obtains the bit depth of the Drawable, this is, the number
of bits that make up a pixel.
getDisplay
public Display getDisplay()
Get the Display associated with the Drawable.
getImage
public Image getImage(int x,
int y,
int width,
int height)
Obtains the pixels from a server-side Drawable as a client-side Image.
The format of the Image depends on the Visual for the current display
which makes manipulating Image extremely difficult.
x
- y
- width
- height
-
getScreen
public Screen getScreen()
Get the Screen associated with the Drawable.
getSize
public Dimension getSize()
Returns the size of the Drawable.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
getVisibleRegion
public Region getVisibleRegion()
Computes the Region of a Drawable that is potentially visible.
getVisual
public Visual getVisual()
Gets the Visual describing the pixel format of this Drawable.
setColormap
public void setColormap(Colormap cmap)
Sets the Colormap associated with the Drawable. Normally this happens
automatically when the Drawable is created.
cmap
-