javax.media.nativewindow.awt
Class AWTWindowClosingProtocol

java.lang.Object
  extended by javax.media.nativewindow.awt.AWTWindowClosingProtocol
All Implemented Interfaces:
WindowClosingProtocol

public class AWTWindowClosingProtocol
extends Object
implements WindowClosingProtocol


Field Summary
 
Fields inherited from interface javax.media.nativewindow.WindowClosingProtocol
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE
 
Constructor Summary
AWTWindowClosingProtocol(Component comp, Runnable closingOperation)
           
 
Method Summary
 boolean addClosingListenerOneShot()
          Adds this closing listener to the components Window if exist and only one time.
Hence you may call this method every time to ensure it has been set, ie in case the Window parent is not available yet.
 int getDefaultCloseOperation()
           
 boolean removeClosingListener()
           
 int setDefaultCloseOperation(int op)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTWindowClosingProtocol

public AWTWindowClosingProtocol(Component comp,
                                Runnable closingOperation)
Method Detail

addClosingListenerOneShot

public final boolean addClosingListenerOneShot()
Adds this closing listener to the components Window if exist and only one time.
Hence you may call this method every time to ensure it has been set, ie in case the Window parent is not available yet.

Returns:

removeClosingListener

public final boolean removeClosingListener()

getDefaultCloseOperation

public final int getDefaultCloseOperation()
Specified by:
getDefaultCloseOperation in interface WindowClosingProtocol
Returns:
the user set close operation if set by setDefaultCloseOperation(int), otherwise return the AWT/Swing close operation value translated to a WindowClosingProtocol value .
See Also:
WindowClosingProtocol.DISPOSE_ON_CLOSE, WindowClosingProtocol.DO_NOTHING_ON_CLOSE

setDefaultCloseOperation

public final int setDefaultCloseOperation(int op)
Specified by:
setDefaultCloseOperation in interface WindowClosingProtocol
Parameters:
op - the new close operation value
Returns:
the previous close operation value
See Also:
WindowClosingProtocol.DISPOSE_ON_CLOSE, WindowClosingProtocol.DO_NOTHING_ON_CLOSE


Copyright 2010 JogAmp Community.