de.cau.cs.kieler.core.kivi
Class AbstractEffect

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.AbstractEffect
All Implemented Interfaces:
IEffect
Direct Known Subclasses:
AnalysisEffect, ArrowEffect, CompartmentCollapseExpandEffect, GraphitiHighlightEffect, HighlightEffect, HighlightSJInstructionEffect, HighlightSJMarkerEffect, LayoutEffect, MenuItemEnableStateEffect, PanningEffect, PointerEffect, PrintEffect, RefreshGMFEditPoliciesEffect, ReorderEffect, SetOptionsEffect, ShowHideEffect, TestEffectA, TestEffectSlow, TransformationEffect, UndoEffect, UnlockEffect, UpdateVisibilityEffect

public abstract class AbstractEffect
extends Object
implements IEffect

Abstract base implementation for effects.

Rating red

Constructor Summary
AbstractEffect()
           
 
Method Summary
 boolean isMergeable()
          Determines whether this effect can be merged with previously scheduled effects.
 IEffect merge(IEffect otherEffect)
          Merge this effect with another effect.
 void schedule()
          Schedule the effect for execution.
 void scheduleUndo()
          Schedule the effect to be undone.
 String toString()
           
 void undo()
          Attempt to undo the effect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.cau.cs.kieler.core.kivi.IEffect
execute
 

Constructor Detail

AbstractEffect

public AbstractEffect()
Method Detail

schedule

public void schedule()
Schedule the effect for execution.

Specified by:
schedule in interface IEffect

undo

public void undo()
Attempt to undo the effect.

Specified by:
undo in interface IEffect

scheduleUndo

public void scheduleUndo()
Schedule the effect to be undone.

Specified by:
scheduleUndo in interface IEffect

isMergeable

public boolean isMergeable()
Determines whether this effect can be merged with previously scheduled effects.

Specified by:
isMergeable in interface IEffect
Returns:
true if it can be merged, false if no search through the effect queue is necessary

merge

public IEffect merge(IEffect otherEffect)
Merge this effect with another effect. Will return null if the effects can not be merged.

Specified by:
merge in interface IEffect
Parameters:
otherEffect - the effect to merge with
Returns:
the newly merged effect, or null if no merge was possible.

toString

public String toString()
Overrides:
toString in class Object