本文整理汇总了Java中sun.awt.PaintEventDispatcher类的典型用法代码示例。如果您正苦于以下问题:Java PaintEventDispatcher类的具体用法?Java PaintEventDispatcher怎么用?Java PaintEventDispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PaintEventDispatcher类属于sun.awt包,在下文中一共展示了PaintEventDispatcher类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceSurfaceDataLater
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
public void replaceSurfaceDataLater() {
Runnable r = new Runnable() {
@Override
public void run() {
// Shouldn't do anything if object is disposed in meanwhile
// No need for sync as disposeAction in Window is performed
// on EDT
if (!isDisposed()) {
try {
replaceSurfaceData();
} catch (InvalidPipeException e) {
// REMIND : what do we do if our surface creation failed?
}
}
}
};
Component c = (Component)target;
// Fix 6255371.
if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
postEvent(new InvocationEvent(c, r));
}
}
示例2: initialize
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
@Override
void initialize() {
eraseBackground = !SunToolkit.getSunAwtNoerasebackground();
boolean eraseBackgroundOnResize = SunToolkit.getSunAwtErasebackgroundonresize();
// Optimization: the default value in the native code is true, so we
// call setNativeBackgroundErase only when the value changes to false
if (!PaintEventDispatcher.getPaintEventDispatcher().
shouldDoNativeBackgroundErase((Component)target)) {
eraseBackground = false;
}
setNativeBackgroundErase(eraseBackground, eraseBackgroundOnResize);
super.initialize();
Color bg = ((Component)target).getBackground();
if (bg != null) {
setBackground(bg);
}
}
示例3: replaceSurfaceDataLater
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
public void replaceSurfaceDataLater() {
Runnable r = new Runnable() {
public void run() {
// Shouldn't do anything if object is disposed in meanwhile
// No need for sync as disposeAction in Window is performed
// on EDT
if (!isDisposed()) {
try {
replaceSurfaceData();
} catch (InvalidPipeException e) {
// REMIND : what do we do if our surface creation failed?
}
}
}
};
// Fix 6255371.
if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing((Component)target, r)) {
postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), r));
}
}
示例4: initialize
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
void initialize() {
eraseBackground = !SunToolkit.getSunAwtNoerasebackground();
boolean eraseBackgroundOnResize = SunToolkit.getSunAwtErasebackgroundonresize();
// Optimization: the default value in the native code is true, so we
// call setNativeBackgroundErase only when the value changes to false
if (!PaintEventDispatcher.getPaintEventDispatcher().
shouldDoNativeBackgroundErase((Component)target)) {
eraseBackground = false;
}
setNativeBackgroundErase(eraseBackground, eraseBackgroundOnResize);
super.initialize();
Color bg = ((Component)target).getBackground();
if (bg != null) {
setBackground(bg);
}
}
示例5: replaceSurfaceDataLater
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
public void replaceSurfaceDataLater() {
Runnable r = new Runnable() {
public void run() {
// Shouldn't do anything if object is disposed in meanwhile
// No need for sync as disposeAction in Window is performed
// on EDT
if (!isDisposed()) {
try {
replaceSurfaceData();
} catch (InvalidPipeException e) {
// REMIND : what do we do if our surface creation failed?
}
}
}
};
Component c = (Component)target;
// Fix 6255371.
if (!PaintEventDispatcher.getPaintEventDispatcher().queueSurfaceDataReplacing(c, r)) {
postEvent(new InvocationEvent(c, r));
}
}
示例6: postPaintIfNecessary
import sun.awt.PaintEventDispatcher; //导入依赖的package包/类
private void postPaintIfNecessary(int x, int y, int w, int h) {
if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) {
PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().
createPaintEvent((Component)target, x, y, w, h);
if (event != null) {
postEvent(event);
}
}
}