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


Java BufferCapabilities.FlipContents方法代码示例

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


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

示例1: flip

import java.awt.BufferCapabilities; //导入方法依赖的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: createData

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static D3DSurfaceData createData(WComponentPeer peer, Image image) {
    D3DGraphicsConfig gc = getGC(peer);
    if (gc == null || !peer.isAccelCapable()) {
        return null;
    }
    BufferCapabilities caps = peer.getBackBufferCaps();
    VSyncType vSyncType = VSYNC_DEFAULT;
    if (caps instanceof ExtendedBufferCapabilities) {
        vSyncType = ((ExtendedBufferCapabilities)caps).getVSync();
    }
    Rectangle r = peer.getBounds();
    BufferCapabilities.FlipContents flip = caps.getFlipContents();
    int swapEffect;
    if (flip == FlipContents.COPIED) {
        swapEffect = SWAP_COPY;
    } else if (flip == FlipContents.PRIOR) {
        swapEffect = SWAP_FLIP;
    } else { // flip == FlipContents.UNDEFINED || .BACKGROUND
        swapEffect = SWAP_DISCARD;
    }
    return new D3DSurfaceData(peer, gc, r.width, r.height,
                              image, peer.getColorModel(),
                              peer.getBackBuffersNum(),
                              swapEffect, vSyncType, FLIP_BACKBUFFER);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:D3DSurfaceData.java

示例3: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
public void flip (BufferCapabilities.FlipContents contents)
{
  getGraphics().drawImage(backBuffer,
                          awtComponent.getWidth(),
                          awtComponent.getHeight(),
                          null);

  // create new back buffer and clear it to the background color.
  if (contents == BufferCapabilities.FlipContents.BACKGROUND)
      {
        backBuffer = createVolatileImage(awtComponent.getWidth(),
                                         awtComponent.getHeight());
        backBuffer.getGraphics().clearRect(0, 0,
                                           awtComponent.getWidth(),
                                           awtComponent.getHeight());
      }
  // FIXME: support BufferCapabilities.FlipContents.PRIOR
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:GtkComponentPeer.java

示例4: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Performs the native XDBE flip operation for the given target Component.
 */
public void flip(X11ComponentPeer peer,
                 Component target, VolatileImage xBackBuffer,
                 int x1, int y1, int x2, int y2,
                 BufferCapabilities.FlipContents flipAction)
{
    long window = peer.getContentWindow();
    int swapAction = getSwapAction(flipAction);
    swapBuffers(window, swapAction);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:X11GraphicsConfig.java

示例5: getSwapAction

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Maps the given FlipContents constant to the associated XDBE swap
 * action constant.
 */
private static int getSwapAction(
    BufferCapabilities.FlipContents flipAction) {
    if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) {
        return 0x01;
    } else if (flipAction == BufferCapabilities.FlipContents.PRIOR) {
        return 0x02;
    } else if (flipAction == BufferCapabilities.FlipContents.COPIED) {
        return 0x03;
    } else {
        return 0x00; // UNDEFINED
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:X11GraphicsConfig.java

示例6: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
public void flip(int x1, int y1, int x2, int y2,
                 BufferCapabilities.FlipContents flipAction)
{
    if (buffersLog.isLoggable(PlatformLogger.Level.FINE)) {
        buffersLog.fine("flip(" + flipAction + ")");
    }
    if (backBuffer == 0) {
        throw new IllegalStateException("Buffers have not been created");
    }
    graphicsConfig.flip(this, target, xBackBuffer,
                        x1, y1, x2, y2, flipAction);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:XComponentPeer.java

示例7: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
public void flip(int x1, int y1, int x2, int y2,
                 BufferCapabilities.FlipContents flipAction)
{
    throw new IllegalStateException(
        "Page-flipping is not allowed on a lightweight component");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:NullComponentPeer.java

示例8: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
public void flip(BufferCapabilities.FlipContents contents)
{
  // Nothing to do here for lightweights.
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:GLightweightPeer.java

示例9: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
public void flip(BufferCapabilities.FlipContents contents)
{
}
 
开发者ID:vilie,项目名称:javify,代码行数:4,代码来源:QtComponentPeer.java

示例10: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Performs the native flip operation for the given target Component. Our
 * flip is implemented through normal drawImage() to the graphic object,
 * because of our components uses a graphic object of the container(in this
 * case we also apply necessary constrains)
 */
void flip(LWComponentPeer<?, ?> peer, Image backBuffer, int x1, int y1,
          int x2, int y2, BufferCapabilities.FlipContents flipAction);
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:LWGraphicsConfig.java

示例11: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Perform a page flip, leaving the contents of the back buffer in
 * the specified state.
 *
 * @param contents the state in which to leave the back buffer
 *
 * @since 1.2
 */
void flip(BufferCapabilities.FlipContents contents);
 
开发者ID:vilie,项目名称:javify,代码行数:10,代码来源:ComponentPeer.java

示例12: flip

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
void flip(int x1, int y1, int x2, int y2, BufferCapabilities.FlipContents flipAction); 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:2,代码来源:ComponentPeer.java


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