Package com.jogamp.nativewindow.awt
Class AWTWindowClosingProtocol
java.lang.Object
com.jogamp.nativewindow.awt.AWTWindowClosingProtocol
- All Implemented Interfaces:
WindowClosingProtocol
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.WindowClosingProtocol
WindowClosingProtocol.WindowClosingMode -
Constructor Summary
ConstructorsConstructorDescriptionAWTWindowClosingProtocol(Component comp, Runnable closingOperationClose, Runnable closingOperationNOP) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanAdds this closing listener to the components Window if exist and only one time.final boolean
-
Constructor Details
-
AWTWindowClosingProtocol
public AWTWindowClosingProtocol(Component comp, Runnable closingOperationClose, Runnable closingOperationNOP) - Parameters:
comp- mandatory AWT component which AWT Window is being queried by parent traversalclosingOperationClose- mandatory closing operation, triggered if windowClosing andWindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSEclosingOperationNOP- optional closing operation, triggered if windowClosing andWindowClosingProtocol.WindowClosingMode.DO_NOTHING_ON_CLOSE
-
-
Method Details
-
addClosingListener
Adds this closing listener to the components Window if exist and only one time.If the closing listener is already added, and
IllegalStateExceptionis thrown.- Returns:
- true if added, otherwise false.
- Throws:
IllegalStateException
-
removeClosingListener
public final boolean removeClosingListener() -
getDefaultCloseOperation
- Specified by:
getDefaultCloseOperationin interfaceWindowClosingProtocol- Returns:
- the user set close operation if set by
setDefaultCloseOperation(int), otherwise return the AWT/Swing close operation value translated to aWindowClosingProtocolvalue . - See Also:
-
setDefaultCloseOperation
public final WindowClosingProtocol.WindowClosingMode setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode op) - Specified by:
setDefaultCloseOperationin interfaceWindowClosingProtocol- Parameters:
op- the new close operation value- Returns:
- the previous close operation value
- See Also:
-