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


Java WComponentPeer.getTarget方法代码示例

本文整理汇总了Java中sun.awt.windows.WComponentPeer.getTarget方法的典型用法代码示例。如果您正苦于以下问题:Java WComponentPeer.getTarget方法的具体用法?Java WComponentPeer.getTarget怎么用?Java WComponentPeer.getTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.windows.WComponentPeer的用法示例。


在下文中一共展示了WComponentPeer.getTarget方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBackBuffer

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Creates a D3D-based backbuffer for the given peer and returns the
 * image wrapper.
 */
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
    Component target = (Component)peer.getTarget();
    // it is possible for the component to have size 0x0, adjust it to
    // be at least 1x1 to avoid IAE
    int w = Math.max(1, target.getWidth());
    int h = Math.max(1, target.getHeight());
    return new SunVolatileImage(target, w, h, Boolean.TRUE);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:D3DGraphicsConfig.java

示例2: canUseD3DOnScreen

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Determines if we can use a d3d surface for onscreen rendering for this
 * peer.
 * We only create onscreen d3d surfaces if the following conditions are met:
 *  - d3d is enabled on this device and onscreen emulation is enabled
 *  - window is big enough to bother (either dimension > MIN_WIN_SIZE)
 *  - this heavyweight doesn't have a BufferStrategy
 *  - if we are in full-screen mode then it must be the peer of the
 *    full-screen window (since there could be only one SwapChain in fs)
 *    and it must not have any heavyweight children
 *    (as Present() doesn't respect component clipping in fullscreen mode)
 *  - it's one of the classes likely to have custom rendering worth
 *    accelerating
 *
 * @returns true if we can use a d3d surface for this peer's onscreen
 *          rendering
 */
public static boolean canUseD3DOnScreen(final WComponentPeer peer,
                                        final Win32GraphicsConfig gc,
                                        final int bbNum)
{
    if (!(gc instanceof D3DGraphicsConfig)) {
        return false;
    }
    D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc;
    D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice();
    String peerName = peer.getClass().getName();
    Rectangle r = peer.getBounds();
    Component target = (Component)peer.getTarget();
    Window fsw = d3dgd.getFullScreenWindow();

    return
        WindowsFlags.isD3DOnScreenEnabled() &&
        d3dgd.isD3DEnabledOnDevice() &&
        peer.isAccelCapable() &&
        (r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) &&
        bbNum == 0 &&
        (fsw == null || (fsw == target && !hasHWChildren(target))) &&
        (peerName.equals("sun.awt.windows.WCanvasPeer") ||
         peerName.equals("sun.awt.windows.WDialogPeer") ||
         peerName.equals("sun.awt.windows.WPanelPeer")  ||
         peerName.equals("sun.awt.windows.WWindowPeer") ||
         peerName.equals("sun.awt.windows.WFramePeer")  ||
         peerName.equals("sun.awt.windows.WEmbeddedFramePeer"));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:D3DScreenUpdateManager.java

示例3: repaintPeerTarget

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Posts a repaint event for the peer's target to the EDT
 * @param peer for which target's the repaint should be issued
 */
private void repaintPeerTarget(WComponentPeer peer) {
    Component target = (Component)peer.getTarget();
    Rectangle bounds = AWTAccessor.getComponentAccessor().getBounds(target);
    // the system-level painting operations should call the handlePaint()
    // method of the WComponentPeer class to repaint the component;
    // calling repaint() forces AWT to make call to update()
    peer.handlePaint(0, 0, bounds.width, bounds.height);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:D3DScreenUpdateManager.java

示例4: createBackBuffer

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Creates a WGL-based backbuffer for the given peer and returns the
 * image wrapper.
 */
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
    Component target = (Component)peer.getTarget();
    return new SunVolatileImage(target,
                                target.getWidth(), target.getHeight(),
                                Boolean.TRUE);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:WGLGraphicsConfig.java

示例5: createBackBuffer

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Creates a WGL-based backbuffer for the given peer and returns the
 * image wrapper.
 */
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
    Component target = (Component)peer.getTarget();
    // it is possible for the component to have size 0x0, adjust it to
    // be at least 1x1 to avoid IAE
    int w = Math.max(1, target.getWidth());
    int h = Math.max(1, target.getHeight());
    return new SunVolatileImage(target,
                                w, h,
                                Boolean.TRUE);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:WGLGraphicsConfig.java

示例6: canUseD3DOnScreen

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * Determines if we can use a d3d surface for onscreen rendering for this
 * peer.
 * We only create onscreen d3d surfaces if the following conditions are met:
 *  - d3d is enabled on this device and onscreen emulation is enabled
 *  - window is big enough to bother (either dimension > MIN_WIN_SIZE)
 *  - this heavyweight doesn't have a BufferStrategy
 *  - if we are in full-screen mode then it must be the peer of the
 *    full-screen window (since there could be only one SwapChain in fs)
 *    and it must not have any heavyweight children
 *    (as Present() doesn't respect component clipping in fullscreen mode)
 *  - it's one of the classes likely to have custom rendering worth
 *    accelerating
 *
 * @return true if we can use a d3d surface for this peer's onscreen
 *         rendering
 */
public static boolean canUseD3DOnScreen(final WComponentPeer peer,
                                        final Win32GraphicsConfig gc,
                                        final int bbNum)
{
    if (!(gc instanceof D3DGraphicsConfig)) {
        return false;
    }
    D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc;
    D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice();
    String peerName = peer.getClass().getName();
    Rectangle r = peer.getBounds();
    Component target = (Component)peer.getTarget();
    Window fsw = d3dgd.getFullScreenWindow();

    return
        WindowsFlags.isD3DOnScreenEnabled() &&
        d3dgd.isD3DEnabledOnDevice() &&
        peer.isAccelCapable() &&
        (r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) &&
        bbNum == 0 &&
        (fsw == null || (fsw == target && !hasHWChildren(target))) &&
        (peerName.equals("sun.awt.windows.WCanvasPeer") ||
         peerName.equals("sun.awt.windows.WDialogPeer") ||
         peerName.equals("sun.awt.windows.WPanelPeer")  ||
         peerName.equals("sun.awt.windows.WWindowPeer") ||
         peerName.equals("sun.awt.windows.WFramePeer")  ||
         peerName.equals("sun.awt.windows.WEmbeddedFramePeer"));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:46,代码来源:D3DScreenUpdateManager.java

示例7: createBackBuffer

import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
 * This method is called from WComponentPeer when a surface data is replaced
 * REMIND: while the default pipeline doesn't support flipping, it may
 * happen that the accelerated device may have this graphics config
 * (like if the device restoration failed when one device exits fs mode
 * while others remain).
 */
public VolatileImage createBackBuffer(WComponentPeer peer) {
    Component target = (Component)peer.getTarget();
    return new SunVolatileImage(target,
                                target.getWidth(), target.getHeight(),
                                Boolean.TRUE);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Win32GraphicsConfig.java


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