org.jdesktop.jxlayer.plaf.effect
Class AbstractLayerEffect

java.lang.Object
  extended by org.jdesktop.jxlayer.plaf.effect.AbstractLayerEffect
All Implemented Interfaces:
LayerEffect
Direct Known Subclasses:
AbstractBufferedImageOpEffect

public abstract class AbstractLayerEffect
extends java.lang.Object
implements LayerEffect

The default implementation of the LayerEffect interface. It provides the mutable enabled state as well as LayerItemListener suppport.

See Also:
AbstractBufferedImageOpEffect, BufferedImageOpEffect

Constructor Summary
AbstractLayerEffect()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a LayerItemListener to the layer item.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Notifies all PropertyChangeListeners that have been added to this object.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the PropertyChangeListeners registered on this LayerItem.
 boolean isEnabled()
          Indicates if this LayerItem is in active state. The default return value for this method is true.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a PropertyChangeListener from this LayerItem.
 void setEnabled(boolean isEnabled)
          Enables or disables this AbstractEffect, depending on the value of the parameter isEnabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jdesktop.jxlayer.plaf.effect.LayerEffect
apply
 

Constructor Detail

AbstractLayerEffect

public AbstractLayerEffect()
Method Detail

isEnabled

public boolean isEnabled()
Indicates if this LayerItem is in active state. The default return value for this method is true.

Specified by:
isEnabled in interface LayerEffect
Returns:
true if this LayerItem is in active state

setEnabled

public void setEnabled(boolean isEnabled)
Enables or disables this AbstractEffect, depending on the value of the parameter isEnabled. An enabled item takes part in painting process when a disabled one is not taken into account.

When the enabled state is changed this method notifies all the LayerItemListener which were added to this AbstractEffect.

Parameters:
isEnabled - if true this item is enabled; otherwise this item is disabled

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a LayerItemListener to the layer item.

Specified by:
addPropertyChangeListener in interface LayerEffect
Parameters:
l - the listener to add

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Returns an array of all the PropertyChangeListeners registered on this LayerItem.

Specified by:
getPropertyChangeListeners in interface LayerEffect
Returns:
all of this item's LayerItemListeners or an empty array if no item listeners are currently registered

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from this LayerItem.

Specified by:
removePropertyChangeListener in interface LayerEffect
Parameters:
l - the listener to remove

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Notifies all PropertyChangeListeners that have been added to this object.