Package org.pushingpixels.lafwidget.animation.effects

# Class GhostingListener

java.lang.Object
org.pushingpixels.lafwidget.animation.effects.GhostingListener

public class GhostingListener extends Object
Listener for the "ghosting image" effects on buttons.

See Also:
  - `AnimationFacet.GHOSTING_BUTTON_PRESS`
  - `AnimationFacet.GHOSTING_ICON_ROLLOVER`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected ButtonModel`
`buttonModel`
The associated model.
`protected JComponent`
`comp`
The associated component.
`protected ChangeListener`
`modelListener`
Listener on the model changes.
`protected Map<AnimationFacet,Boolean>`
`prevStateMap`
Key - `AnimationFacet`, value - `Boolean`

## Constructor Summary

Constructors
Constructor
Description
`GhostingListener(JComponent comp, ButtonModel buttonModel)`
Creates a new listener on model changes that can cause ghost animation transitions.

## Method Summary

Modifier and Type
Method
Description
`org.pushingpixels.trident.Timeline`
`getGhostComponentPressedTimeline()`
`org.pushingpixels.trident.Timeline`
`getGhostIconRolloverTimeline()`
`static Map<JComponent,org.pushingpixels.trident.Timeline>`
`getRunningGhostPressTimelines()`
`static Map<JComponent,org.pushingpixels.trident.Timeline>`
`getRunningGhostRolloverTimelines()`
`void`
`registerListeners()`
Registers listeners on the relevant model changes.
`protected void`
`trackModelChange(AnimationFacet animationFacet, 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 Details

### modelListener

protected ChangeListener modelListener
Listener on the model changes.

### comp

protected JComponent comp
The associated component.

### buttonModel

protected ButtonModel buttonModel
The associated model.

### prevStateMap

protected Map<AnimationFacet,Boolean> prevStateMap
Key - `AnimationFacet`, value - `Boolean`

## Constructor Details

### GhostingListener

public GhostingListener(JComponent comp, ButtonModel buttonModel)
Creates a new listener on model changes that can cause ghost animation transitions.

Parameters:
  `comp` - Component.
  `buttonModel` - Model for the component.

## Method Details

### trackModelChange

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

Parameters:
  `animationFacet` - Animation facet.
  `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.

### getRunningGhostRolloverTimelines

public static Map<JComponent,org.pushingpixels.trident.Timeline> getRunningGhostRolloverTimelines()

### getRunningGhostPressTimelines

public static Map<JComponent,org.pushingpixels.trident.Timeline> getRunningGhostPressTimelines()

### getGhostComponentPressedTimeline

public org.pushingpixels.trident.Timeline getGhostComponentPressedTimeline()

### getGhostIconRolloverTimeline

public org.pushingpixels.trident.Timeline getGhostIconRolloverTimeline()