本文整理汇总了Java中sun.lwawt.LWComponentPeer类的典型用法代码示例。如果您正苦于以下问题:Java LWComponentPeer类的具体用法?Java LWComponentPeer怎么用?Java LWComponentPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LWComponentPeer类属于sun.lwawt包,在下文中一共展示了LWComponentPeer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flip
import sun.lwawt.LWComponentPeer; //导入依赖的package包/类
@Override
public void flip(final LWComponentPeer<?, ?> peer, final Image backBuffer,
final int x1, final int y1, final int x2, final int y2,
final BufferCapabilities.FlipContents flipAction) {
final Graphics g = peer.getGraphics();
try {
g.drawImage(backBuffer, x1, y1, x2, y2, x1, y1, x2, y2, null);
} finally {
g.dispose();
}
if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
final Graphics2D bg = (Graphics2D) backBuffer.getGraphics();
try {
bg.setBackground(peer.getBackground());
bg.clearRect(0, 0, backBuffer.getWidth(null),
backBuffer.getHeight(null));
} finally {
bg.dispose();
}
}
}
示例2: CDropTarget
import sun.lwawt.LWComponentPeer; //导入依赖的package包/类
private CDropTarget(DropTarget dropTarget, Component component, ComponentPeer peer) {
super();
fDropTarget = dropTarget;
fComponent = component;
fPeer = peer;
long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow());
if (nativePeer == 0L) return; // Unsupported for a window without a native view (plugin)
// Create native dragging destination:
fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
if (fNativeDropTarget == 0) {
throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
}
}
示例3: createBackBuffer
import sun.lwawt.LWComponentPeer; //导入依赖的package包/类
@Override
public Image createBackBuffer(final LWComponentPeer<?, ?> peer) {
final Rectangle r = peer.getBounds();
// It is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
final int w = Math.max(1, r.width);
final int h = Math.max(1, r.height);
final int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT
: Transparency.OPAQUE;
return new SunVolatileImage(this, w, h, transparency, null);
}
示例4: CDropTarget
import sun.lwawt.LWComponentPeer; //导入依赖的package包/类
CDropTarget(DropTarget dropTarget, Component component, LWComponentPeer<?, ?> peer) {
long nativePeer = CPlatformWindow.getNativeViewPtr(peer.getPlatformWindow());
if (nativePeer == 0L) return; // Unsupported for a window without a native view (plugin)
// Create native dragging destination:
fNativeDropTarget = createNativeDropTarget(dropTarget, component, nativePeer);
if (fNativeDropTarget == 0) {
throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
}
}