当前位置: 首页>>代码示例>>Java>>正文


Java LWComponentPeer类代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:CGLGraphicsConfig.java

示例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.");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:CDropTarget.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:CGLGraphicsConfig.java

示例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.");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:CDropTarget.java


注:本文中的sun.lwawt.LWComponentPeer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。