org.jdesktop.jxlayer.plaf.effect
Class AbstractEffect

java.lang.Object
  extended by org.jdesktop.jxlayer.plaf.effect.AbstractEffect
All Implemented Interfaces:
LayerItem, Effect
Direct Known Subclasses:
AbstractImageOpEffect

public abstract class AbstractEffect
extends java.lang.Object
implements Effect

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

See Also:
AbstractImageOpEffect, ImageOpEffect

Constructor Summary
AbstractEffect()
           
 
Method Summary
 void addLayerItemListener(LayerItemListener l)
          Adds a LayerItemListener to the layer item.
protected  void fireLayerItemChanged()
          Notifies all LayerItemListeners that have been added to this object.
protected  void fireLayerItemChanged(LayerItemChangeEvent event)
          Notifies all LayerItemListeners that have registered interest for notification on this event type.
 LayerItemListener[] getLayerItemListeners()
          Returns an array of all the LayerItemListeners registered on this LayerItem.
 boolean isEnabled()
          Indicates if this LayerItem is in active state. The default return value for this method is true.
 void removeLayerItemListener(LayerItemListener l)
          Removes a LayerItemListener 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.Effect
apply
 

Constructor Detail

AbstractEffect

public AbstractEffect()
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 LayerItem
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

addLayerItemListener

public void addLayerItemListener(LayerItemListener l)
Adds a LayerItemListener to the layer item.

Specified by:
addLayerItemListener in interface LayerItem
Parameters:
l - the listener to add

getLayerItemListeners

public LayerItemListener[] getLayerItemListeners()
Returns an array of all the LayerItemListeners registered on this LayerItem.

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

removeLayerItemListener

public void removeLayerItemListener(LayerItemListener l)
Removes a LayerItemListener from this LayerItem.

Specified by:
removeLayerItemListener in interface LayerItem
Parameters:
l - the listener to remove

fireLayerItemChanged

protected void fireLayerItemChanged()
Notifies all LayerItemListeners that have been added to this object.


fireLayerItemChanged

protected void fireLayerItemChanged(LayerItemChangeEvent event)
Notifies all LayerItemListeners that have registered interest for notification on this event type.

Parameters:
event - the LayerItemChangeEvent to be passed to the LayerItemListeners added to this object