org.jdesktop.jdic.screensaver
Class SimpleScreensaver
java.lang.Object
org.jdesktop.jdic.screensaver.ScreensaverBase
org.jdesktop.jdic.screensaver.SimpleScreensaver
- public abstract class SimpleScreensaver
- extends ScreensaverBase
Base class for simple screensavers who will have their paint()
method invoked on a regular basis to render each frame.
Method Summary |
abstract void |
paint(java.awt.Graphics g)
Override this method in your subclasses to paint a single frame. |
void |
renderFrame()
Called by the native layer to render the next frame. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleScreensaver
public SimpleScreensaver()
paint
public abstract void paint(java.awt.Graphics g)
- Override this method in your subclasses to paint a single frame.
Any exceptions thrown during paint will be sent to the
org.jdesktop.jdic.screensaver J2SE logger.
Tip: Treat this as though it were part of a game loop. In general,
it's a good idea not to allocate ('new') any objects after init
unless they will not be deleted. This will yield smoother animation
and no pauses from the garbage collector.
- Parameters:
g
- Graphics context used to draw to the screensaver window.
renderFrame
public final void renderFrame()
- Called by the native layer to render the next frame.
- Overrides:
renderFrame
in class ScreensaverBase
For more information and documentation on JDIC,
see JDIC website. That documentation
contains more detailed, developer-targeted descriptions, with conceptual
overviews, working code examples, license terms and bug report information.
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is
subject to license terms.