diff options
author | Sven Gothel <[email protected]> | 2012-06-27 05:06:07 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-27 05:06:07 +0200 |
commit | 6bff43023b630d7e9f413e39821ebf89c40a399a (patch) | |
tree | 77a17f649e94c5cee38d1b206b533a318710d4cf | |
parent | a06e40cce89615eb8c4b080842997c9c3ad1130b (diff) |
Misc cleanup: add @Override
5 files changed, 90 insertions, 78 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java index d65967da1..46fc1d991 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java +++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java @@ -208,6 +208,6 @@ public abstract class AnimatorBase implements GLAnimatorControl { } public String toString() { - return getClass().getName()+"[started "+isStarted()+", animating "+isAnimating()+", paused "+isPaused()+", drawable "+drawables.size()+"]"; + return getClass().getName()+"[started "+isStarted()+", animating "+isAnimating()+", paused "+isPaused()+", drawable "+drawables.size()+", totals[dt "+getTotalFPSDuration()+", frames "+getTotalFPSFrames()+", fps "+getTotalFPS()+"]]"; } } diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/com/jogamp/nativewindow/WrappedSurface.java index f2993abab..04f616daf 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/WrappedSurface.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/WrappedSurface.java @@ -44,30 +44,36 @@ public class WrappedSurface extends ProxySurface implements SurfaceChangeable { super(cfg); surfaceHandle=handle; } - + + @Override protected final void invalidateImpl() { surfaceHandle = 0; } + @Override final public long getSurfaceHandle() { return surfaceHandle; } + @Override final public void setSurfaceHandle(long surfaceHandle) { this.surfaceHandle=surfaceHandle; } + @Override final protected int lockSurfaceImpl() { return LOCK_SUCCESS; } + @Override final protected void unlockSurfaceImpl() { } + @Override public String toString() { - return "WrappedSurface[config " + getPrivateGraphicsConfiguration()+ - ", displayHandle 0x" + Long.toHexString(getDisplayHandle()) + - ", surfaceHandle 0x" + Long.toHexString(getSurfaceHandle()) + + return "WrappedSurface[config " + getPrivateGraphicsConfiguration()+ + ", displayHandle 0x" + Long.toHexString(getDisplayHandle()) + + ", surfaceHandle 0x" + Long.toHexString(getSurfaceHandle()) + ", size " + getWidth() + "x" + getHeight() + ", surfaceLock "+surfaceLock+"]"; } diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java index 2bc352116..12e202975 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -52,8 +52,8 @@ import javax.media.nativewindow.util.Point; which can create NativeWindow objects for its components. <P> */ public interface NativeWindow extends NativeSurface { - - /** + + /** * destroys the window and releases * windowing related resources. */ @@ -67,63 +67,63 @@ public interface NativeWindow extends NativeSurface { /** * Returns the window handle for this NativeWindow. <P> * - * The window handle shall reflect the platform one + * The window handle shall reflect the platform one * for all window related operations, e.g. open, close, resize. <P> * * On X11 this returns an entity of type Window. <BR> - * On Microsoft Windows this returns an entity of type HWND. + * On Microsoft Windows this returns an entity of type HWND. */ public long getWindowHandle(); - /** + /** * Returns the insets defined as the width and height of the window decoration * on the left, right, top and bottom.<br> * Insets are zero if the window is undecorated, including child windows. - * + * * <p> * Insets are available only after the native window has been created, * ie. the native window has been made visible.<br> - * + * * The top-level window area's top-left corner is located at * <pre> * getX() - getInsets().{@link InsetsImmutable#getLeftWidth() getLeftWidth()} * getY() - getInsets().{@link InsetsImmutable#getTopHeight() getTopHeight()} - * </pre> - * + * </pre> + * * The top-level window size is * <pre> - * getWidth() + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()} + * getWidth() + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()} * getHeight() + getInsets().{@link InsetsImmutable#getTotalHeight() getTotalHeight()} - * </pre> - * + * </pre> + * * @return insets */ public InsetsImmutable getInsets(); - + /** Returns the current x position of this window, relative to it's parent. */ - - /** + + /** * @return the current x position of the top-left corner - * of the client area relative to it's parent. + * of the client area relative to it's parent. * Since the position reflects the client area, it does not include the insets. * @see #getInsets() */ public int getX(); - /** + /** * @return the current y position of the top-left corner - * of the client area relative to it's parent. + * of the client area relative to it's parent. * Since the position reflects the client area, it does not include the insets. * @see #getInsets() */ public int getY(); - /** - * Returns the current position of the top-left corner + /** + * Returns the current position of the top-left corner * of the client area in screen coordinates. * <p> * Since the position reflects the client area, it does not include the insets. - * </p> + * </p> * @param point if not null, * {@link javax.media.nativewindow.util.Point#translate(javax.media.nativewindow.util.Point)} * the passed {@link javax.media.nativewindow.util.Point} by this location on the screen and return it. @@ -131,8 +131,8 @@ public interface NativeWindow extends NativeSurface { * or a new instance with the screen location of this NativeWindow. */ public Point getLocationOnScreen(Point point); - + /** Returns true if this native window owns the focus, otherwise false. */ boolean hasFocus(); - + } diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java index bc02ac5dc..4da48bdae 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java @@ -51,11 +51,13 @@ public class GDISurface extends ProxySurface { this.windowHandle=windowHandle; } + @Override protected final void invalidateImpl() { windowHandle=0; surfaceHandle=0; } + @Override final protected int lockSurfaceImpl() { if (0 != surfaceHandle) { throw new InternalError("surface not released"); @@ -70,6 +72,7 @@ public class GDISurface extends ProxySurface { return (0 != surfaceHandle) ? LOCK_SUCCESS : LOCK_SURFACE_NOT_READY; } + @Override final protected void unlockSurfaceImpl() { if (0 == surfaceHandle) { throw new InternalError("surface not acquired: "+this+", thread: "+Thread.currentThread().getName()); @@ -80,10 +83,12 @@ public class GDISurface extends ProxySurface { surfaceHandle=0; } + @Override final public long getSurfaceHandle() { return surfaceHandle; } + @Override final public String toString() { return "GDISurface[config "+getPrivateGraphicsConfiguration()+ ", displayHandle 0x"+Long.toHexString(getDisplayHandle())+ diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index 136c19ff8..71e86d520 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -71,7 +71,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { /** * Set the CapabilitiesChooser to help determine the native visual type. - * + * * @param chooser the new CapabilitiesChooser * @return the previous CapabilitiesChooser */ @@ -86,7 +86,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { /** * Gets an immutable set of chosen capabilities. - * + * * @return the chosen capabilities */ CapabilitiesImmutable getChosenCapabilities(); @@ -103,6 +103,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { * @see #destroy() * @see #setVisible(boolean) */ + @Override void destroy(); /** @@ -135,14 +136,14 @@ public interface Window extends NativeWindow, WindowClosingProtocol { boolean isVisible(); - /** - * If the implementation uses delegation, return the delegated {@link Window} instance, + /** + * If the implementation uses delegation, return the delegated {@link Window} instance, * otherwise return <code>this</code> instance. */ Window getDelegatedWindow(); - + // // Child Window Management - // + // boolean addChild(NativeWindow win); @@ -154,7 +155,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { /** * Sets the size of the window's client area, excluding decorations. - * + * * <p> * Zero size semantics are respected, see {@link #setVisible(boolean)}:<br> * <pre> @@ -171,72 +172,72 @@ public interface Window extends NativeWindow, WindowClosingProtocol { * * @param width of the window's client area * @param height of the window's client area - * + * * @see #getInsets() */ void setSize(int width, int height); /** * Sets the size of the top-level window including insets (window decorations). - * + * * <p> * Note: Insets (if supported) are available only after the window is set visible and hence has been created. * </p> * * @param width of the top-level window area * @param height of the top-level window area - * + * * @see #setSize(int, int) * @see #getInsets() */ void setTopLevelSize(int width, int height); - + /** * Sets the location of the window's client area, excluding insets (window decorations).<br> - * + * * This call is ignored if in fullscreen mode.<br> * * @param x coord of the client-area's top left corner * @param y coord of the client-area's top left corner - * + * * @see #getInsets() */ void setPosition(int x, int y); - + /** * Sets the location of the top-level window inclusive insets (window decorations).<br> - * + * * <p> * Note: Insets (if supported) are available only after the window is set visible and hence has been created. * </p> - * + * * This call is ignored if in fullscreen mode.<br> * * @param x coord of the top-level left corner * @param y coord of the top-level left corner - * + * * @see #setPosition(int, int) * @see #getInsets() */ void setTopLevelPosition(int x, int y); void setUndecorated(boolean value); - + boolean isUndecorated(); - + void setAlwaysOnTop(boolean value); - + boolean isAlwaysOnTop(); - + void setTitle(String title); String getTitle(); boolean isPointerVisible(); - + /** * Makes the pointer visible or invisible. - * + * * @param pointerVisible defaults to <code>true</code> for platforms w/ visible pointer, * otherwise defaults to <code>true</code>, eg. Android. * @see #confinePointer(boolean) @@ -244,32 +245,32 @@ public interface Window extends NativeWindow, WindowClosingProtocol { void setPointerVisible(boolean pointerVisible); boolean isPointerConfined(); - + /** * Confine the pointer to this window, ie. pointer jail. * <p> - * Before jailing the mouse pointer, + * Before jailing the mouse pointer, * the window request the focus and the pointer is centered in the window. * </p> * <p> - * In combination w/ {@link #warpPointer(int, int)} + * In combination w/ {@link #warpPointer(int, int)} * and maybe {@link #setPointerVisible(boolean)} a simple mouse * navigation can be realized.</p> - * + * * @param confine defaults to <code>false</code>. */ void confinePointer(boolean confine); - + /** * Moves the pointer to x/y relative to this window's origin. - * + * * @param x relative pointer x position within this window * @param y relative pointer y position within this window - * + * * @see #confinePointer(boolean) */ void warpPointer(int x, int y); - + /** Reparenting operation types */ public enum ReparentOperation { /** No native reparenting valid */ @@ -285,7 +286,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { ACTION_NATIVE_CREATION, /** Change Window tree only, native creation is pending */ - ACTION_NATIVE_CREATION_PENDING; + ACTION_NATIVE_CREATION_PENDING; } /** @@ -305,7 +306,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { ReparentOperation reparentWindow(NativeWindow newParent, boolean forceDestroyCreate); boolean setFullscreen(boolean fullscreen); - + boolean isFullscreen(); static interface FocusRunnable { @@ -317,7 +318,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { } /** - * Sets a {@link FocusRunnable}, + * Sets a {@link FocusRunnable}, * which {@link FocusRunnable#run()} method is executed before the native focus is requested. * <p> * This allows notifying a covered window toolkit like AWT that the focus is requested, @@ -325,7 +326,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { * </p> */ void setFocusAction(FocusRunnable focusAction); - + /** * Sets a {@link KeyListener} allowing focus traversal with a covered window toolkit like AWT. * <p> @@ -336,27 +337,27 @@ public interface Window extends NativeWindow, WindowClosingProtocol { */ void setKeyboardFocusHandler(KeyListener l); - /** + /** * Request focus for this native window * <p> * The request is handled on this Window EDT and blocked until finished. * </p> - * + * * @see #requestFocus(boolean) */ void requestFocus(); - /** + /** * Request focus for this native window * <p> - * The request is handled on this Window EDT. + * The request is handled on this Window EDT. * </p> - * + * * @param wait true if waiting until the request is executed, otherwise false * @see #requestFocus() */ void requestFocus(boolean wait); - + void windowRepaint(int x, int y, int width, int height); void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event); @@ -410,7 +411,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { */ void setKeyboardVisible(boolean visible); - /** + /** * Return <code>true</code> if the virtual on-screen keyboard is visible, otherwise <code>false</code>. * <p> * Currently on <code>Android</code>, the only supported platform right now, @@ -420,7 +421,7 @@ public interface Window extends NativeWindow, WindowClosingProtocol { * @see #setKeyboardVisible(boolean) */ boolean isKeyboardVisible(); - + /** * * Appends the given {@link com.jogamp.newt.event.KeyListener} to the end of |