SaverBeans API V0.2-beta Release release

org.jdesktop.jdic.screensaver
Class ScreensaverBase

java.lang.Object
  extended byorg.jdesktop.jdic.screensaver.ScreensaverBase
Direct Known Subclasses:
JOGLScreensaver, SimpleScreensaver

public abstract class ScreensaverBase
extends java.lang.Object

Base class for screensavers written in Java. All developers should extend either SimpleScreensaver or JOGLScreensaver. This base class makes it possible to offer different types of screensavers in the future, such as those that can control their own rendering frequency.

See Also:
SimpleScreensaver, JOGLScreensaver

Field Summary
protected  ScreensaverContext context
          Context information for this screensaver (eg window size)
 
Constructor Summary
ScreensaverBase()
           
 
Method Summary
 void baseDestroy()
          Called from native code to destroy the screensaver.
 void baseInit(ScreensaverContext context)
          Called from native code to do initialization.
protected  void destroy()
          Subclasses can optionally override this method to perform any cleanup before the screensaver is destroyed.
 ScreensaverContext getContext()
          Gets the ScreenSaver context object
protected  void init()
          Subclasses can optionally override this method to perform any initialization.
 void renderFrame()
          Called from 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
 

Field Detail

context

protected ScreensaverContext context
Context information for this screensaver (eg window size)

Constructor Detail

ScreensaverBase

public ScreensaverBase()
Method Detail

baseInit

public final void baseInit(ScreensaverContext context)
Called from native code to do initialization. Subclasses should override the init() method to provide any initialization.

Parameters:
context - Context information for this screensaver (eg window size)

baseDestroy

public final void baseDestroy()
Called from native code to destroy the screensaver. Subclasses should override the destroy() method to provide any cleanup behavior.


getContext

public ScreensaverContext getContext()
Gets the ScreenSaver context object

Returns:
The context object for this screen saver.

renderFrame

public void renderFrame()
Called from the native layer to render the next frame


init

protected void init()
Subclasses can optionally override this method to perform any initialization. Default does nothing.

Init will be called once at the beginning, before the first paint, and zero or more times during the running to reset the screensaver (for example if the resolution changed).


destroy

protected void destroy()
Subclasses can optionally override this method to perform any cleanup before the screensaver is destroyed. Default does nothing.

Destroy will be called at most once. After a call to this method, the screensaver should not expect the ScreensaverContext to be valid any longer.


SaverBeans API V0.2-beta Release release

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.