AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCaps, glCaps);
private QueryCanvas(AWTGraphicsConfiguration awtConfig, ExtendedCapabilitiesChooser chooser) { // The platform-specific GLDrawableFactory will only provide a // non-null GraphicsConfiguration on platforms where this is // necessary (currently only X11, as Windows allows the pixel // format of the window to be set later and Mac OS X seems to // handle this very differently than all other platforms). On // other platforms this method returns null; it is the case (at // least in the Sun AWT implementation) that this will result in // equivalent behavior to calling the no-arg super() constructor // for Canvas. super(awtConfig.getAWTGraphicsConfiguration()); this.awtConfig = awtConfig; this.chooser = chooser; }
@Override public final AbstractGraphicsConfiguration getGraphicsConfiguration() { return config.getNativeGraphicsConfiguration(); }
awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), chooser, gc.getDevice()); final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null; if(Window.DEBUG_IMPLEMENTATION) { final Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName()); System.err.println("Created Config (n): HAVE CF "+awtConfig); System.err.println("Created Config (n): Choosen CF "+config); System.err.println("Created Config (n): EQUALS CAPS "+config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())); if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) { displayConfigChanged=true;
@Override public GLCapabilitiesImmutable getChosenGLCapabilities() { if( Beans.isDesignTime() ) { return capsReqUser; } else if( null == awtConfig ) { throw new GLException("No AWTGraphicsConfiguration: "+this); } return (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(); }
capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc); return new AWTGraphicsConfiguration(awtScreen, capsChosen, capsRequested, awtGfxConfig);
@Override public String toString() { return getClass().getSimpleName()+"[" + getScreen() + ",\n\tchosen " + capabilitiesChosen+ ",\n\trequested " + capabilitiesRequested+ ",\n\t" + config + ",\n\tencapsulated "+encapsulated+"]"; } }
return new AWTGraphicsConfiguration(awtScreen, macConfig.getChosenCapabilities(), macConfig.getRequestedCapabilities(), gc, macConfig);
@Override public GLCapabilitiesImmutable getRequestedGLCapabilities() { if( null == awtConfig ) { return capsReqUser; } return (GLCapabilitiesImmutable)awtConfig.getRequestedCapabilities(); }
@Override public final void setChosenCapabilities(final CapabilitiesImmutable caps) { ((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps); config.setChosenCapabilities(caps); }
GraphicsConfiguration chosen = null != awtConfig ? awtConfig.getAWTGraphicsConfiguration() : null; final AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(), (GLCapabilitiesImmutable)awtConfig.getRequestedCapabilities(), chooser, gc.getDevice()); final GraphicsConfiguration compatible = config.getAWTGraphicsConfiguration(); final boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities()); if(DEBUG) { System.err.println(getThreadName()+": Info:");
GLCapabilities canvasCaps = (GLCapabilities)awtConfig.getChosenCapabilities();
System.err.println("Found matching AWT visual: 0x"+Integer.toHexString(visualID) +" -> "+aConfig); return new AWTGraphicsConfiguration(awtScreen, aConfig.getChosenCapabilities(), aConfig.getRequestedCapabilities(), gc, aConfig); capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsChosen, gc); aConfig = factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen, nativeVisualID); if (aConfig == null) { System.err.println("Found matching default AWT visual: 0x"+Integer.toHexString(visualID) +" -> "+aConfig); return new AWTGraphicsConfiguration(awtScreen, aConfig.getChosenCapabilities(), aConfig.getRequestedCapabilities(), gc, aConfig); return new AWTGraphicsConfiguration(awtScreen, aConfig.getChosenCapabilities(), aConfig.getRequestedCapabilities(), gc, aConfig);
@Override public boolean hasDeviceChanged() { final boolean res = awtCanvas.hasDeviceChanged(); if(res) { final AWTGraphicsConfiguration cfg = awtCanvas.getAWTGraphicsConfiguration(); if (null == cfg) { throw new NativeWindowException("Error Device change null GraphicsConfiguration: "+this); } setGraphicsConfiguration(cfg); // propagate new info .. ((ScreenDriver)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)cfg.getScreen()); ((DisplayDriver)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)cfg.getScreen().getDevice()); ((ScreenDriver)getScreen()).updateVirtualScreenOriginAndSize(); } return res; }
throw new GLException("Unable to determine GraphicsConfiguration: "+winConfig); return new AWTGraphicsConfiguration(awtScreen, winConfig.getChosenCapabilities(), winConfig.getRequestedCapabilities(), chosenGC, winConfig);
public static int graphicsConfigurationGetVisualID(final AbstractGraphicsConfiguration config) { try { if (config instanceof AWTGraphicsConfiguration) { return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getAWTGraphicsConfiguration()); } return 0; } catch (final Exception e) { return 0; } }
public static JAWTWindow getNativeWindow(final java.awt.Component awtComp, final CapabilitiesImmutable capsRequested) { final AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested); final NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow if(! ( nw instanceof JAWTWindow ) ) { throw new NativeWindowException("Not an AWT NativeWindow: "+nw); } if(DEBUG_IMPLEMENTATION) { System.err.println("NewtFactoryAWT.getNativeWindow: "+awtComp+" -> "+nw); } return (JAWTWindow)nw; }
private void dispose() { if( null != jawtWindow ) { jawtWindow.destroy(); if(Window.DEBUG_IMPLEMENTATION) { System.err.println(getThreadName()+": AWTCanvas.disposeJAWTWindowAndAWTDeviceOnEDT(): post JAWTWindow: "+jawtWindow); } jawtWindow=null; } if(null != awtConfig) { final AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice(); String adeviceMsg=null; if(Window.DEBUG_IMPLEMENTATION) { adeviceMsg = adevice.toString(); } final boolean closed = adevice.close(); if(Window.DEBUG_IMPLEMENTATION) { System.err.println(getThreadName()+": AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed); } } }
@Override GraphicsConfiguration getGraphicsConfig(GraphicsConfiguration gconfig) { if (VERBOSE) System.err.println("JoglPipeline.getGraphicsConfig()"); GraphicsConfigInfo gcInf0 = Canvas3D.graphicsConfigTable.get(gconfig); AWTGraphicsConfiguration awtConfig = (AWTGraphicsConfiguration)gcInf0.getPrivateData(); return awtConfig.getAWTGraphicsConfiguration(); }
final AbstractGraphicsConfiguration aconfig = awtConfig.getNativeGraphicsConfiguration(); final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); final String adeviceMsg;