de.cau.cs.kieler.ksbase.viewmanagement.combinations
Class KSBasECombination

java.lang.Object
  extended by de.cau.cs.kieler.viewmanagement.ACombination
      extended by de.cau.cs.kieler.ksbase.viewmanagement.combinations.KSBasECombination
All Implemented Interfaces:
ITriggerListener, EventListener

public class KSBasECombination
extends ACombination

The KSBasE combination used to execute a set of effects, selected by the user via the preference pages.

Rating proposed yellow
(2010-03-22)

Constructor Summary
KSBasECombination()
          Creates a new KSBasECombination.
 
Method Summary
static void addEffect(String effectName, int index)
          Adds an effect to the list of effects to execute.
static void changeIndex(String effectName, int newIndex)
          Changes the index of an effect.
 boolean evaluate(TriggerEventObject triggerEvent)
          Evaluates if triggerEventObject is valid.
 void execute()
          Executes the registered effects.
static Vector<String> getEffects()
          Gets the registered effects.
 List<ATrigger> getTriggers()
          Returns the list of triggers for this combination.
static void initalizeEffects(IPreferenceStore prefStore)
          Reads the settings from the given preference store.
static void removeEffect(String effectName)
          Removes an effect from the list of effects to execute.
static void storeEffects(IPreferenceStore prefStore)
          Stores the effects in the given preference store.
 
Methods inherited from class de.cau.cs.kieler.viewmanagement.ACombination
getEditPart, getRootEPAsParent, initialize, isActive, notifyTrigger, resetHashedEditParts, setActive, translateToEditPart, undoEffects, wrapup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KSBasECombination

public KSBasECombination()
Creates a new KSBasECombination.

Method Detail

evaluate

public boolean evaluate(TriggerEventObject triggerEvent)
Evaluates if triggerEventObject is valid.

Specified by:
evaluate in class ACombination
Parameters:
triggerEvent - The event to evaluate.
Returns:
True if the eventObject is valid

execute

public void execute()
Executes the registered effects.

Specified by:
execute in class ACombination

getTriggers

public List<ATrigger> getTriggers()
Returns the list of triggers for this combination.

Specified by:
getTriggers in class ACombination
Returns:
a list of ATrigger objects

addEffect

public static final void addEffect(String effectName,
                                   int index)
Adds an effect to the list of effects to execute.

Parameters:
effectName - Name of the effect
index - Index of the effect

removeEffect

public static final void removeEffect(String effectName)
Removes an effect from the list of effects to execute.

Parameters:
effectName - Effect to remove

changeIndex

public static final void changeIndex(String effectName,
                                     int newIndex)
Changes the index of an effect.

Parameters:
effectName - Name of the effect
newIndex - New index

storeEffects

public static final void storeEffects(IPreferenceStore prefStore)
Stores the effects in the given preference store.

Parameters:
prefStore - The store to read from

initalizeEffects

public static final void initalizeEffects(IPreferenceStore prefStore)
Reads the settings from the given preference store. Although it may seem odd to do this here, it is necessary because we want to use stored settings even if the preference page has not been opened yet.

Parameters:
prefStore - The preference store that contains the stored objects

getEffects

public static Vector<String> getEffects()
Gets the registered effects.

Returns:
A vector containing the transformations ordered by their priority