Top Inners Fields Constructors Methods
com.jogamp.nativewindow.awt

public Class AWTWindowClosingProtocol

extends Object
implements WindowClosingProtocol
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.WindowClosingProtocol
Imports
java.awt.Component, .Window, java.awt.event.WindowAdapter, .WindowEvent, .WindowListener, com.jogamp.nativewindow.WindowClosingProtocol, jogamp.nativewindow.awt.AWTMisc

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final Object
private final Runnable
private final Runnable
private final Component
private WindowClosingProtocol.WindowClosingMode
private boolean
private Window
pack-priv WindowListener

Constructor Summary

AccessConstructor and Description
public
AWTWindowClosingProtocol(final Component
mandatory AWT component which AWT Window is being queried by parent traversal
comp
,
final Runnable
mandatory closing operation, triggered if windowClosing and WindowClosingMode#DISPOSE_ON_CLOSE
closingOperationClose
,
final Runnable
optional closing operation, triggered if windowClosing and WindowClosingMode#DO_NOTHING_ON_CLOSE
closingOperationNOP
)

Method Summary

Modifier and TypeMethod and Description
public final boolean

Returns:

true if added, otherwise false.
addClosingListener
()

Adds this closing listener to the components Window if exist and only one time.

public final WindowClosingProtocol.WindowClosingMode

Returns:

the user set close operation if set by setDefaultCloseOperation(int), otherwise return the AWT/Swing close operation value translated to a WindowClosingProtocol value .
getDefaultCloseOperation
()

Implements com.jogamp.nativewindow.WindowClosingProtocol.getDefaultCloseOperation.

public final boolean
public final WindowClosingProtocol.WindowClosingMode
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closingListenerLockback to summary
private final Object closingListenerLock
closingOperationCloseback to summary
private final Runnable closingOperationClose
closingOperationNOPback to summary
private final Runnable closingOperationNOP
compback to summary
private final Component comp
defaultCloseOperationback to summary
private WindowClosingProtocol.WindowClosingMode defaultCloseOperation
defaultCloseOperationSetByUserback to summary
private boolean defaultCloseOperationSetByUser
listenToback to summary
private Window listenTo
windowClosingAdapterback to summary
pack-priv WindowListener windowClosingAdapter

Constructor Detail

AWTWindowClosingProtocolback to summary
public AWTWindowClosingProtocol(final Component comp, final Runnable closingOperationClose, final Runnable closingOperationNOP)
Parameters
comp:Component

mandatory AWT component which AWT Window is being queried by parent traversal

closingOperationClose:Runnable

mandatory closing operation, triggered if windowClosing and WindowClosingMode#DISPOSE_ON_CLOSE

closingOperationNOP:Runnable

optional closing operation, triggered if windowClosing and WindowClosingMode#DO_NOTHING_ON_CLOSE

Method Detail

addClosingListenerback to summary
public final boolean addClosingListener() throws IllegalStateException

Adds this closing listener to the components Window if exist and only one time.

If the closing listener is already added, and IllegalStateException is thrown.

Returns:boolean

true if added, otherwise false.

getDefaultCloseOperationback to summary
public final WindowClosingProtocol.WindowClosingMode getDefaultCloseOperation()

Implements com.jogamp.nativewindow.WindowClosingProtocol.getDefaultCloseOperation.

Returns:WindowClosingProtocol.WindowClosingMode

the user set close operation if set by setDefaultCloseOperation(int), otherwise return the AWT/Swing close operation value translated to a WindowClosingProtocol value .

Annotations
@Override
removeClosingListenerback to summary
public final boolean removeClosingListener()
setDefaultCloseOperationback to summary
public final WindowClosingProtocol.WindowClosingMode setDefaultCloseOperation(final WindowClosingProtocol.WindowClosingMode op)

Implements com.jogamp.nativewindow.WindowClosingProtocol.setDefaultCloseOperation.

Parameters
op:WindowClosingProtocol.WindowClosingMode

Doc from com.jogamp.nativewindow.WindowClosingProtocol.setDefaultCloseOperation.

the new close operation value

Returns:WindowClosingProtocol.WindowClosingMode

Doc from com.jogamp.nativewindow.WindowClosingProtocol.setDefaultCloseOperation.

the previous close operation value

Annotations
@Override
com.jogamp.nativewindow.awt back to summary

pack-priv Class AWTWindowClosingProtocol.WindowClosingAdapter

extends WindowAdapter
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
windowClosing(final WindowEvent
the event to be processed
e
)

Overrides java.awt.event.WindowAdapter.windowClosing.

Implements java.awt.event.WindowListener.windowClosing.

Invoked when a window is in the process of being closed.
Inherited from java.awt.event.WindowAdapter:
windowActivatedwindowClosedwindowDeactivatedwindowDeiconifiedwindowGainedFocuswindowIconifiedwindowLostFocuswindowOpenedwindowStateChanged

Constructor Detail

WindowClosingAdapterback to summary
pack-priv WindowClosingAdapter()

Method Detail

windowClosingback to summary
public void windowClosing(final WindowEvent e)

Overrides java.awt.event.WindowAdapter.windowClosing.

Implements java.awt.event.WindowListener.windowClosing.

Doc from java.awt.event.WindowAdapter.windowClosing.

Invoked when a window is in the process of being closed. The close operation can be overridden at this point.

Parameters
e:WindowEvent

Doc from java.awt.event.WindowListener.windowClosing.

the event to be processed

Annotations
@Override