org.jdesktop.swing.animation.rendering
Class JRendererFactory

java.lang.Object
  extended by org.jdesktop.swing.animation.rendering.JRendererFactory

@Utility
public final class JRendererFactory
extends Object

Used to construct a Swing renderer based upon the users preference for active or passive rendering.

Active rendering is used if the org.jdesktop.renderer.active property is defined. For example with the following passed to the Java interpreter.

 -Dorg.jdesktop.renderer.active=true
 

Author:
Tim Halloran

Field Summary
static String PROPERTY
           
 
Method Summary
static org.jdesktop.core.animation.rendering.JRenderer getDefaultRenderer(JRendererPanel on, org.jdesktop.core.animation.rendering.JRendererTarget<GraphicsConfiguration,Graphics2D> target, boolean hasChildren)
          Gets a renderer based upon the users preference for active or passive rendering.
static boolean useActiveRenderer()
          Gets if active rendering is desired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY

public static final String PROPERTY
See Also:
Constant Field Values
Method Detail

getDefaultRenderer

public static org.jdesktop.core.animation.rendering.JRenderer getDefaultRenderer(JRendererPanel on,
                                                                                 org.jdesktop.core.animation.rendering.JRendererTarget<GraphicsConfiguration,Graphics2D> target,
                                                                                 boolean hasChildren)
Gets a renderer based upon the users preference for active or passive rendering.

Active rendering is used if the org.jdesktop.renderer.active property is defined. For example with the following passed to the Java interpreter.

 -Dorg.jdesktop.renderer.active=true
 
This method constructs and starts an SwingTimerTimingSource or a ManualTimingSource and sets it as the default for all animations. A handle to this timing source can be obtained by invoking JRenderer.getTimingSource(), for example, if it needs to be disposed.

Parameters:
on - the panel to render on.
target - the rendering implementation to callback to.
hasChildren - if on manages child Swing components. true if it does. false if it does not. This helps the renderer improve performance if no child components are ever used.
Returns:
a renderer for on.

useActiveRenderer

public static boolean useActiveRenderer()
Gets if active rendering is desired.

Returns:
true if active rendering is desired, false otherwise.


Copyright © 2012. All Rights Reserved.