本文整理汇总了Java中sun.awt.X11ComponentPeer类的典型用法代码示例。如果您正苦于以下问题:Java X11ComponentPeer类的具体用法?Java X11ComponentPeer怎么用?Java X11ComponentPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
X11ComponentPeer类属于sun.awt包,在下文中一共展示了X11ComponentPeer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createData
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
/**
* Creates a SurfaceData object representing the back buffer of a
* double-buffered on-screen Window.
*/
public static GLXOffScreenSurfaceData createData(X11ComponentPeer peer,
Image image,
int type)
{
GLXGraphicsConfig gc = getGC(peer);
Rectangle r = peer.getBounds();
if (type == FLIP_BACKBUFFER) {
return new GLXOffScreenSurfaceData(peer, gc, r.width, r.height,
image, peer.getColorModel(),
FLIP_BACKBUFFER);
} else {
return new GLXVSyncOffScreenSurfaceData(peer, gc, r.width, r.height,
image, peer.getColorModel(),
type);
}
}
示例2: createBackBuffer
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported, an AWTException
* is thrown. Otherwise, if the backbuffer creation is successful, a
* value of 1 is returned.
*/
@Override
public long createBackBuffer(X11ComponentPeer peer,
int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
// non-zero return value means backbuffer creation was successful
// (checked in X11ComponentPeer.flip(), etc.)
return 1;
}
示例3: createBackBuffer
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported, an AWTException
* is thrown. Otherwise, if the backbuffer creation is successful, a
* handle to the native backbuffer is returned.
*/
public long createBackBuffer(X11ComponentPeer peer,
int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (!X11GraphicsDevice.isDBESupported()) {
throw new AWTException("Page flipping is not supported");
}
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
long window = peer.getContentWindow();
int swapAction = getSwapAction(caps.getFlipContents());
return createBackBuffer(window, swapAction);
}
示例4: GLXSurfaceData
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
protected GLXSurfaceData(X11ComponentPeer peer, GLXGraphicsConfig gc,
ColorModel cm, int type)
{
super(gc, cm, type);
this.peer = peer;
this.graphicsConfig = gc;
initOps(peer, graphicsConfig.getAData());
}
示例5: getGC
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
public static GLXGraphicsConfig getGC(X11ComponentPeer peer) {
if (peer != null) {
return (GLXGraphicsConfig)peer.getGraphicsConfiguration();
} else {
// REMIND: this should rarely (never?) happen, but what if
// default config is not GLX?
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = env.getDefaultScreenDevice();
return (GLXGraphicsConfig)gd.getDefaultConfiguration();
}
}
示例6: GLXVSyncOffScreenSurfaceData
import sun.awt.X11ComponentPeer; //导入依赖的package包/类
public GLXVSyncOffScreenSurfaceData(X11ComponentPeer peer,
GLXGraphicsConfig gc,
int width, int height,
Image image, ColorModel cm,
int type)
{
super(peer, gc, width, height, image, cm, type);
flipSurface = GLXSurfaceData.createData(peer, image, FLIP_BACKBUFFER);
}