From 935523a8c58efced1c0845bd60e08e2acb9e5aee Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 2 May 2012 01:20:46 +0200 Subject: NEWT API Change 'WindowClosingProtocol': Use 'enum WindowClosingMode' instead of static final int values. --- .../media/nativewindow/WindowClosingProtocol.java | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'src/nativewindow/classes/javax') diff --git a/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java index 949aee79c..884c916e4 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java +++ b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java @@ -32,35 +32,38 @@ package javax.media.nativewindow; * Protocol for handling window closing events. *

* The implementation shall obey either the user value set by this interface,
- * an underlying toolkit set user value or it's default, eg. {@link #DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment.
+ * an underlying toolkit set user value or it's default, eg. {@link WindowClosingMode#DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment.
* If none of the above determines the operation, - * this protocol default behavior {@link #DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.

+ * this protocol default behavior {@link WindowClosingMode#DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.

*/ public interface WindowClosingProtocol { - /** - * Dispose resources on native window close operation.
- * This is the default behavior in case no underlying toolkit defines otherwise. - */ - int DISPOSE_ON_CLOSE = 1; + public enum WindowClosingMode { + /** + * Do nothing on native window close operation.
+ * This is the default behavior within an AWT environment. + */ + DO_NOTHING_ON_CLOSE, + + /** + * Dispose resources on native window close operation.
+ * This is the default behavior in case no underlying toolkit defines otherwise. + */ + DISPOSE_ON_CLOSE; + } - /** - * Do nothing on native window close operation.
- * This is the default behavior within an AWT environment. - */ - int DO_NOTHING_ON_CLOSE = 0; /** * @return the current close operation value - * @see #DISPOSE_ON_CLOSE - * @see #DO_NOTHING_ON_CLOSE + * @see WindowClosingMode#DISPOSE_ON_CLOSE + * @see WindowClosingMode#DO_NOTHING_ON_CLOSE */ - int getDefaultCloseOperation(); + WindowClosingMode getDefaultCloseOperation(); /** * @param op the new close operation value * @return the previous close operation value - * @see #DISPOSE_ON_CLOSE - * @see #DO_NOTHING_ON_CLOSE + * @see WindowClosingMode#DISPOSE_ON_CLOSE + * @see WindowClosingMode#DO_NOTHING_ON_CLOSE */ - int setDefaultCloseOperation(int op); + WindowClosingMode setDefaultCloseOperation(WindowClosingMode op); } -- cgit v1.2.3