@Override public WindowClosingMode getDefaultCloseOperation() { return awtWindowClosingProtocol.getDefaultCloseOperation(); }
@Override public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) { return awtWindowClosingProtocol.setDefaultCloseOperation(op); }
/** Overridden to track when this component is removed from a container. Subclasses which override this method must call super.removeNotify() in their removeNotify() method in order to function properly. <P> <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ @Override public void removeNotify() { awtWindowClosingProtocol.removeClosingListener(); dispose(null); hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE; hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE; nativePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE; nativePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE; super.removeNotify(); }
/** Overridden to track when this component is added to a container. Subclasses which override this method must call super.addNotify() in their addNotify() method in order to function properly. <P> <DL><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ @Override public void addNotify() { super.addNotify(); awtWindowClosingProtocol.addClosingListener(); // HiDPI support { final int ps = JAWTUtil.getPixelScale(getGraphicsConfiguration()); nativePixelScale[0] = ps; nativePixelScale[1] = ps; } SurfaceScaleUtils.computePixelScale(hasPixelScale, hasPixelScale, reqPixelScale, nativePixelScale, DEBUG ? getClass().getSimpleName() : null); if (DEBUG) { System.err.println(getThreadName()+": GLJPanel.addNotify()"); } }
new AWTWindowClosingProtocol(this, new Runnable() { @Override public void run() {
@Override public void removeNotify() { if( Beans.isDesignTime() ) { super.removeNotify(); } else { if(DEBUG) { System.err.println("NewtCanvasAWT.removeNotify.0 - isApplet "+isApplet+" @ "+currentThreadName()); Thread.dumpStack(); } componentAdded = false; // Bug 910 awtWindowClosingProtocol.removeClosingListener(); destroyImpl(true /* removeNotify */, false /* windowClosing */); super.removeNotify(); if(DEBUG) { System.err.println("NewtCanvasAWT.removeNotify.X @ "+currentThreadName()); } } }
awtWindowClosingProtocol.addClosingListener(); componentAdded = true; // Bug 910 if(DEBUG) {
@Override public WindowClosingMode getDefaultCloseOperation() { return awtWindowClosingProtocol.getDefaultCloseOperation(); }
@Override public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) { return awtWindowClosingProtocol.setDefaultCloseOperation(op); }
/** <p>Overridden to track when this component is removed from a container. Subclasses which override this method must call super.removeNotify() in their removeNotify() method in order to function properly. </p> <p>User shall not call this method outside of EDT, read the AWT/Swing specs about this.</p> <B>Overrides:</B> <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */ @SuppressWarnings("deprecation") @Override public void removeNotify() { if(DEBUG) { System.err.println(getThreadName()+": Info: removeNotify - start"); // Thread.dumpStack(); } awtWindowClosingProtocol.removeClosingListener(); if( Beans.isDesignTime() ) { super.removeNotify(); } else { try { destroyImpl( true ); } finally { super.removeNotify(); } } if(DEBUG) { System.err.println(getThreadName()+": Info: removeNotify - end, peer: "+getPeer()); } }
awtWindowClosingProtocol.addClosingListener();
@Override public WindowClosingMode getDefaultCloseOperation() { return awtWindowClosingProtocol.getDefaultCloseOperation(); }
@Override public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) { return awtWindowClosingProtocol.setDefaultCloseOperation(op); }
@Override public void windowClosing(final WindowEvent e) { final WindowClosingMode op = AWTWindowClosingProtocol.this.getDefaultCloseOperation(); if( WindowClosingMode.DISPOSE_ON_CLOSE == op ) { // we have to issue this call right away, // otherwise the window gets destroyed closingOperationClose.run(); } else if( null != closingOperationNOP ){ closingOperationNOP.run(); } } }