Methods Summary |
---|
boolean | fillBackground(javax.swing.plaf.synth.SynthContext context, int state)Returns true if the style should fill in the background of the
specified context for the specified state.
Object image = getBackgroundImage(state);
return image == EMPTY_IMAGE_TAG;
|
java.awt.Image | getBackgroundImage(javax.swing.plaf.synth.SynthContext context, int state)Returns the Icon to fill the background in with for the specified
context and state.
Object image = getBackgroundImage(state);
return (image == EMPTY_IMAGE_TAG) ? null : (Image)image;
|
private java.lang.Object | getBackgroundImage(int state)
state = GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
if (images[state] != null) {
return images[state];
}
Dimension size = null;
synchronized(sun.awt.UNIXToolkit.GTK_LOCK) {
size = native_get_image_dimension(widgetType, state);
}
if (size != null) {
BufferedImage image = new BufferedImage(size.width, size.height,
BufferedImage.TYPE_INT_RGB);
// Getting the DataBuffer for an image (as it's done below) defeats
// possible future acceleration.
// Calling setLocalAccelerationEnabled on that image's surface
// manager re-enables it.
boolean accelerated = false;
CachingSurfaceManager csm = null;
SurfaceManager sm = SurfaceManager.getManager(image);
if (sm instanceof CachingSurfaceManager) {
csm = (CachingSurfaceManager)sm;
accelerated = csm.isLocalAccelerationEnabled();
}
DataBufferInt data = (DataBufferInt)image.getRaster().getDataBuffer();
synchronized(sun.awt.UNIXToolkit.GTK_LOCK) {
native_get_image(data.getData(), size.width, size.height,
widgetType, state);
}
if (csm != null && accelerated != csm.isLocalAccelerationEnabled()) {
csm.setLocalAccelerationEnabled(accelerated);
csm.rasterChanged();
}
return images[state] = image;
}
return images[state] = EMPTY_IMAGE_TAG;
|
java.lang.Object | getClassSpecificValue(javax.swing.plaf.synth.Region region, java.lang.String key)Returns the value for a class specific property. A class specific value
is a value that will be picked up based on class hierarchy.
synchronized(sun.awt.UNIXToolkit.GTK_LOCK) {
return native_get_class_value(widgetType, key);
}
|
java.lang.Object | getClassSpecificValue(com.sun.java.swing.plaf.gtk.GTKConstants.WidgetType wt, java.lang.String key)Returns the value for a class specific property for a particular
WidgetType. This method is useful in those cases where we need to
fetch a value for a Region that is not associated with the component
currently in use (e.g. we need to figure out the insets for a
SCROLL_BAR, but certain values can only be extracted from a
SCROLL_PANE region).
synchronized (UNIXToolkit.GTK_LOCK) {
return native_get_class_value(wt.ordinal(), key);
}
|
protected java.awt.Font | getFontForState(javax.swing.JComponent c, javax.swing.plaf.synth.Region id, int state)Returns the font for the specified state.
if (pangoFont != null) {
return pangoFont;
} else {
return super.getFontForState(c, id, state);
}
|
java.lang.String | getFontNameForWidgetType(com.sun.java.swing.plaf.gtk.GTKConstants.WidgetType wt)Returns fontname specific for the given WidgetType
synchronized (sun.awt.UNIXToolkit.GTK_LOCK) {
return native_get_pango_font_name(wt.ordinal());
}
|
java.awt.Color | getStyleSpecificColor(javax.swing.plaf.synth.SynthContext context, int state, javax.swing.plaf.synth.ColorType type)
state = GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
synchronized(sun.awt.UNIXToolkit.GTK_LOCK) {
int rgb = native_get_color_for_state(widgetType, state, type.getID());
return new ColorUIResource(rgb);
}
|
javax.swing.Icon | getStyleSpecificIcon(java.lang.String key, TextDirection direction, int type)
Image img = ((UNIXToolkit)Toolkit.getDefaultToolkit()).
getStockIcon(widgetType, key, type, direction.ordinal(), null);
return (img != null) ? new ImageIcon(img) : null;
|
int | getXThickness()Returns the X thickness to use for this GTKStyle.
return xThickness;
|
int | getYThickness()Returns the Y thickness to use for this GTKStyle.
return yThickness;
|
private native java.lang.Object | native_get_class_value(int widgetType, java.lang.String key)
|
private native int | native_get_color_for_state(int widgetType, int state, int typeID)
|
private native void | native_get_image(int[] buffer, int width, int height, int widgetType, int state)
|
private native java.awt.Dimension | native_get_image_dimension(int widgetType, int state)
|
private native java.lang.String | native_get_pango_font_name(int widgetType)
|
private native int | native_get_xthickness(int widgetType)
|
private native int | native_get_ythickness(int widgetType)
|