APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.java.swing.plaf.gtk

pack-priv Class GTKEngine

extends Object
Class Inheritance
Imports
java.awt.*, java.awt.image.*, java.util.HashMap, javax.swing.*, javax.swing.plaf.synth.*, com.sun.java.swing.plaf.gtk.GTKConstants.ArrowType, .GTKConstants.ExpanderStyle, .GTKConstants.Orientation, .GTKConstants.PositionType, .GTKConstants.ShadowType, .GTKConstants.TextDirection, sun.awt.image.SunWritableRaster, sun.swing.ImageCache

GTKEngine delegates all painting job to native GTK libraries. Painting with GTKEngine looks like this: First, startPainting() is called. It prepares an offscreen buffer of the required size. Then, any number of paintXXX() methods can be called. They effectively ignore the Graphics parameter and draw to the offscreen buffer. Finally, finishPainting() should be called. It fills the data buffer passed in with the image data.
Author
Josh Outwater

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static enum
GTKEngine.Settings

Representation of GtkSettings properties.

pack-priv static enum
GTKEngine.WidgetType

This enum mirrors that in gtk_interface.h

Field Summary

Modifier and TypeField and Description
private static final int[][]
private ImageCache
private static final int
CACHE_SIZE

Size of the image cache

private Object[]
private static final ColorModel[]
private Graphics
private int
pack-priv static final GTKEngine
private static HashMap<Region, Object>
private int
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private ColorModel
colorModelFor(int transparency)

public BufferedImage
finishPainting()

Convenience method that delegates to finishPainting() with caching enabled.

public BufferedImage
finishPainting(boolean useCache)

Called to indicate that painting is finished.

public Object
private static int
pack-priv static GTKEngine.WidgetType
getWidgetType(JComponent c, Region id)

Translate Region and JComponent into WidgetType ordinals

private native Object
native_get_gtk_setting(int property)

private native void
native_paint_arrow(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int arrowType)

private native void
native_paint_background(int widgetType, int state, int x, int y, int width, int height)

private native void
native_paint_box(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int synthState, int dir)

private native void
native_paint_box_gap(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int gapSide, int gapX, int gapWidth)

private native void
native_paint_check(int widgetType, int synthState, String detail, int x, int y, int width, int height)

private native void
native_paint_expander(int widgetType, int state, String detail, int x, int y, int width, int height, int expanderStyle)

private native void
native_paint_extension(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int placement)

private native void
native_paint_flat_box(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, boolean hasFocus)

private native void
native_paint_focus(int widgetType, int state, String detail, int x, int y, int width, int height)

private native void
native_paint_handle(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int orientation)

private native void
native_paint_hline(int widgetType, int state, String detail, int x, int y, int width, int height)

private native void
native_paint_option(int widgetType, int synthState, String detail, int x, int y, int width, int height)

private native void
native_paint_shadow(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int synthState, int dir)

private native void
native_paint_slider(int widgetType, int state, int shadowType, String detail, int x, int y, int width, int height, int orientation, boolean hasFocus)

private native void
native_paint_vline(int widgetType, int state, String detail, int x, int y, int width, int height)

private native void
private native int
nativeFinishPainting(int[] buffer, int width, int height)

private native void
nativeSetRangeValue(int widgetType, double value, double min, double max, double visible)

private native void
nativeStartPainting(int w, int h)

public void
paintArrow(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, GTKConstants.ArrowType direction, String detail, int x, int y, int w, int h)

public void
paintBackground(Graphics g, SynthContext context, Region id, int state, Color color, int x, int y, int w, int h)

public void
paintBox(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h)

public void
paintBoxGap(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h, GTKConstants.PositionType boxGapType, int tabBegin, int size)

public boolean

Returns:

true if a cached image has been painted, false otherwise
paintCachedImage
(Graphics g, int x, int y, int w, int h, Object... args)

Paint a cached image identified by its size and a set of additional arguments, if there's one.

public void
paintCheck(Graphics g, SynthContext context, Region id, String detail, int x, int y, int w, int h)

public void
paintExpander(Graphics g, SynthContext context, Region id, int state, GTKConstants.ExpanderStyle expanderStyle, String detail, int x, int y, int w, int h)

public void
paintExtension(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h, GTKConstants.PositionType placement, int tabIndex)

public void
paintFlatBox(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h, ColorType colorType)

public void
paintFocus(Graphics g, SynthContext context, Region id, int state, String detail, int x, int y, int w, int h)

public void
paintHandle(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h, GTKConstants.Orientation orientation)

public void
paintHline(Graphics g, SynthContext context, Region id, int state, String detail, int x, int y, int w, int h)

public void
paintOption(Graphics g, SynthContext context, Region id, String detail, int x, int y, int w, int h)

public void
paintShadow(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h)

public void
paintSlider(Graphics g, SynthContext context, Region id, int state, GTKConstants.ShadowType shadowType, String detail, int x, int y, int w, int h, GTKConstants.Orientation orientation, boolean hasFocus)

public void
paintVline(Graphics g, SynthContext context, Region id, int state, String detail, int x, int y, int w, int h)

pack-priv void
setRangeValue(SynthContext context, Region id, double value, double min, double max, double visible)

Sets up the GtkAdjustment values for the native GtkRange widget associated with the given region (e.g. SLIDER, SCROLL_BAR).

public void
startPainting(Graphics g, int x, int y, int w, int h, Object... args)

public void
themeChanged()

Notify native layer of theme change, and flush cache

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait