-
Notifications
You must be signed in to change notification settings - Fork 13
GTKPainterClass
Eric Bodden edited this page Mar 15, 2015
·
1 revision
void paintIcon(SynthContext context, Graphics g,
Method paintMethod, int x, int y, int w, int h, Object direction) {
int state = context.getComponentState();
synchronized (UNIXToolkit.GTK_LOCK) {
if (! ENGINE.paintCachedImage(g,
x, y, w, h, state, paintMethod, direction)) {
ENGINE.startPainting(g,
x, y, w, h, state, paintMethod, direction);
try {
paintMethod.invoke(this, context,
g, state, x, y, w, h, direction);
} catch (IllegalAccessException iae) {
assert false;
} catch (InvocationTargetException ite) {
assert false;
}
ENGINE.finishPainting();
}
}
}
package com.sun.java.swing.plaf.gtk;
GTKPainter.class
void paintIcon(SynthContext context, Graphics g,
Method paintMethod, int x, int y, int w, int h) {
int state = context.getComponentState();
synchronized (UNIXToolkit.GTK_LOCK) {
if (! ENGINE.paintCachedImage(g, x, y, w, h, state, paintMethod)) {
ENGINE.startPainting(g, x, y, w, h, state, paintMethod);
try {
paintMethod.invoke(this, context, g, state, x, y, w, h);
} catch (IllegalAccessException iae) {
assert false;
} catch (InvocationTargetException ite) {
assert false;
}
ENGINE.finishPainting();
}
}
}
// to ensure children are painted // this solves the AWT problem mentioned previously where a failure to invoke super.paint() prevented any lightweight children from appearing. => Avoiding system problems