本文整理汇总了Java中sun.awt.X11GraphicsDevice类的典型用法代码示例。如果您正苦于以下问题:Java X11GraphicsDevice类的具体用法?Java X11GraphicsDevice怎么用?Java X11GraphicsDevice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
X11GraphicsDevice类属于sun.awt包,在下文中一共展示了X11GraphicsDevice类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleReparentNotify
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
public void handleReparentNotify(XEvent xev) {
XReparentEvent re = xev.get_xreparent();
long newParent = re.get_parent();
if (active) {
// unregister accelerators, etc. for old parent
embedded.notifyStopped();
// check if newParent is a root window
X11GraphicsConfig gc = (X11GraphicsConfig)embedded.getGraphicsConfiguration();
X11GraphicsDevice gd = (X11GraphicsDevice)gc.getDevice();
if ((newParent == XlibUtil.getRootWindow(gd.getScreen())) ||
(newParent == XToolkit.getDefaultRootWindow()))
{
// reparenting to root means XEmbed termination
active = false;
} else {
// continue XEmbed with a new parent
server = newParent;
embedded.notifyStarted();
}
}
}
示例2: handleReparentNotify
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
public void handleReparentNotify(XEvent xev) {
XReparentEvent re = xev.get_xreparent();
long newParent = re.get_parent();
if (active) {
// unregister accelerators, etc. for old parent
embedded.notifyStopped();
// check if newParent is a root window
X11GraphicsConfig gc = (X11GraphicsConfig)embedded.getGraphicsConfiguration();
X11GraphicsDevice gd = gc.getDevice();
if ((newParent == XlibUtil.getRootWindow(gd.getScreen())) ||
(newParent == XToolkit.getDefaultRootWindow()))
{
// reparenting to root means XEmbed termination
active = false;
} else {
// continue XEmbed with a new parent
server = newParent;
embedded.notifyStarted();
}
}
}
示例3: GLXGraphicsConfig
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
private GLXGraphicsConfig(X11GraphicsDevice device, int visualnum,
long configInfo, ContextCapabilities oglCaps)
{
super(device, visualnum, 0, 0,
(oglCaps.getCaps() & CAPS_DOUBLEBUFFERED) != 0);
pConfigInfo = configInfo;
initConfig(getAData(), configInfo);
this.oglCaps = oglCaps;
context = new OGLContext(OGLRenderQueue.getInstance(), this);
}
示例4: getConfig
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
int visualnum)
{
if (!X11GraphicsEnvironment.isGLXAvailable()) {
return null;
}
long cfginfo = 0;
final String ids[] = new String[1];
OGLRenderQueue rq = OGLRenderQueue.getInstance();
rq.lock();
try {
// getGLXConfigInfo() creates and destroys temporary
// surfaces/contexts, so we should first invalidate the current
// Java-level context and flush the queue...
OGLContext.invalidateCurrentContext();
GLXGetConfigInfo action =
new GLXGetConfigInfo(device.getScreen(), visualnum);
rq.flushAndInvokeNow(action);
cfginfo = action.getConfigInfo();
if (cfginfo != 0L) {
OGLContext.setScratchSurface(cfginfo);
rq.flushAndInvokeNow(new Runnable() {
public void run() {
ids[0] = OGLContext.getOGLIdString();
}
});
}
} finally {
rq.unlock();
}
if (cfginfo == 0) {
return null;
}
int oglCaps = getOGLCapabilities(cfginfo);
ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);
return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
示例5: collectJavaToplevels
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
static Vector<XWindowPeer> collectJavaToplevels() {
Vector<XWindowPeer> javaToplevels = new Vector<XWindowPeer>();
Vector<Long> v = new Vector<Long>();
X11GraphicsEnvironment ge =
(X11GraphicsEnvironment)GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gds = ge.getScreenDevices();
if (!ge.runningXinerama() && (gds.length > 1)) {
for (GraphicsDevice gd : gds) {
int screen = ((X11GraphicsDevice)gd).getScreen();
long rootWindow = XlibWrapper.RootWindow(XToolkit.getDisplay(), screen);
v.add(rootWindow);
}
} else {
v.add(XToolkit.getDefaultRootWindow());
}
final int windowsCount = windows.size();
while ((v.size() > 0) && (javaToplevels.size() < windowsCount)) {
long win = v.remove(0);
XQueryTree qt = new XQueryTree(win);
try {
if (qt.execute() != 0) {
int nchildren = qt.get_nchildren();
long children = qt.get_children();
// XQueryTree returns window children ordered by z-order
for (int i = 0; i < nchildren; i++) {
long child = Native.getWindow(children, i);
XBaseWindow childWindow = XToolkit.windowToXWindow(child);
// filter out Java non-toplevels
if ((childWindow != null) && !(childWindow instanceof XWindowPeer)) {
continue;
} else {
v.add(child);
}
if (childWindow instanceof XWindowPeer) {
XWindowPeer np = (XWindowPeer)childWindow;
javaToplevels.add(np);
// XQueryTree returns windows sorted by their z-order. However,
// if WM has not handled transient for hint for a child window,
// it may appear in javaToplevels before its owner. Move such
// children after their owners.
int k = 0;
XWindowPeer toCheck = javaToplevels.get(k);
while (toCheck != np) {
XWindowPeer toCheckOwnerPeer = toCheck.getOwnerPeer();
if (toCheckOwnerPeer == np) {
javaToplevels.remove(k);
javaToplevels.add(toCheck);
} else {
k++;
}
toCheck = javaToplevels.get(k);
}
}
}
}
} finally {
qt.dispose();
}
}
return javaToplevels;
}
示例6: isGraphicsConfigSupported
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
@Override
boolean isGraphicsConfigSupported(GraphicsConfigTemplate3D template,
GraphicsConfiguration gc) {
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
if (!X11NativeScreenInfo.isGLX13()) {
return false;
}
long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int[] attrList; // holds the list of attributes to be tramslated
// for glxChooseVisual call
attrList = new int[NUM_ITEMS];
// assign template values to array
attrList[RED_SIZE] = template.getRedSize();
attrList[GREEN_SIZE] = template.getGreenSize();
attrList[BLUE_SIZE] = template.getBlueSize();
attrList[DEPTH_SIZE] = template.getDepthSize();
attrList[DOUBLEBUFFER] = template.getDoubleBuffer();
attrList[STEREO] = template.getStereo();
attrList[ANTIALIASING] = template.getSceneAntialiasing();
attrList[STENCIL_SIZE] = template.getStencilSize();
// System.out.println("X11NativeConfigTemplate3D : getStencilSize " +
// attrList[STENCIL_SIZE]);
long[] fbConfig = new long[1];
int visID = chooseOglVisual(display, screen, attrList, fbConfig);
if (visID == 0 || fbConfig[0] == 0)
return false; // no valid visual was found
else
return true;
}
示例7: hasStereo
import sun.awt.X11GraphicsDevice; //导入依赖的package包/类
@Override
boolean hasStereo(Canvas3D c3d) {
GraphicsConfiguration gc = c3d.graphicsConfiguration;
X11GraphicsDevice gd =
(X11GraphicsDevice)((X11GraphicsConfig)gc).getDevice();
long display = NativeScreenInfo.getNativeScreenInfo().getDisplay();
int screen = NativeScreenInfo.getNativeScreenInfo().getScreen(gd);
int vid = ((X11GraphicsConfig)gc).getVisual();
return isStereoAvailable(display, screen, vid);
}