org.jvnet.lafwidget.animation.effects
Class IconGlowListener

java.lang.Object
  extended by org.jvnet.lafwidget.animation.effects.IconGlowListener

public class IconGlowListener
extends java.lang.Object

Listener for the "glow" effects on icons.

Author:
Kirill Grouchnikov
See Also:
FadeKind.ICON_GLOW

Field Summary
protected  javax.swing.ButtonModel buttonModel
          The associated model.
protected  java.awt.Component comp
          The associated component.
protected  long glowLoopAnimationId
          Animation ID of the glow icon loop.
protected  javax.swing.event.ChangeListener modelListener
          Listener on the model changes.
protected  java.util.Map<FadeKind,java.lang.Boolean> prevStateMap
          Key - FadeKind, value - Boolean
 
Constructor Summary
IconGlowListener(java.awt.Component comp, javax.swing.ButtonModel buttonModel)
          Creates a new listener on model changes that can cause fade animation transitions.
 
Method Summary
 void registerListeners()
          Registers listeners on the relevant model changes.
protected  void trackModelChange(FadeKind fadeKind, boolean newState)
          Tracks a single change to the model.
 void unregisterListeners()
          Unregisters all listeners on model changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelListener

protected javax.swing.event.ChangeListener modelListener
Listener on the model changes.


comp

protected java.awt.Component comp
The associated component.


glowLoopAnimationId

protected long glowLoopAnimationId
Animation ID of the glow icon loop.


buttonModel

protected javax.swing.ButtonModel buttonModel
The associated model.


prevStateMap

protected java.util.Map<FadeKind,java.lang.Boolean> prevStateMap
Key - FadeKind, value - Boolean

Constructor Detail

IconGlowListener

public IconGlowListener(java.awt.Component comp,
                        javax.swing.ButtonModel buttonModel)
Creates a new listener on model changes that can cause fade animation transitions.

Parameters:
comp - Component.
buttonModel - Model for the component.
callback - Optional application callback.
Method Detail

trackModelChange

protected void trackModelChange(FadeKind fadeKind,
                                boolean newState)
Tracks a single change to the model.

Parameters:
fadeKind - Fade animation kind.
newState - New value of the relevant attribute of the model.

registerListeners

public void registerListeners()
Registers listeners on the relevant model changes.


unregisterListeners

public void unregisterListeners()
Unregisters all listeners on model changes.