de.cau.cs.kieler.viewmanagement
Class RunLogic

java.lang.Object
  extended by de.cau.cs.kieler.viewmanagement.RunLogic

public final class RunLogic
extends Object

The RunLogic is the central administration of the view management. It keeps track of all the available components, triggers, effects and combinations. On startup, it reads all of them and makes instances available to the other components. It can also be asked to give an instance of a specified component, using e.g. the getTrigger method. Finally it provides with finalize() a way to simply shut down the view management.

Rating red

Method Summary
 ACombination getCombination(String name)
          Returns a combination from list combos that matches the given name in the argument.
 HashMap<String,ACombination> getCombos()
           
 AEffect getEffect(String name)
          Returns an effect from list effects that matches the given name in the argument.
 List<String> getEffectsAsText()
          Gives a list of Strings of available effects names
static RunLogic getInstance()
          Returns the instance of the RunLogic.
 boolean getState()
          Returns the state of the RunLogic, true for on, false for off.
 ATrigger getTrigger(String name)
          Returns a trigger from list triggers that matches the given name in the argument.
 void init()
          Initializes lists to be used to store available components no getter/setter in class remove setter
 void registerListeners()
          Method to start the Viewmanagement.
 void unregisterListeners()
          Method to stop the Viewmanagement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RunLogic getInstance()
Returns the instance of the RunLogic.

Returns:
the instance of RunLogic

init

public void init()
Initializes lists to be used to store available components no getter/setter in class remove setter


registerListeners

public void registerListeners()
Method to start the Viewmanagement. Reads all available effects, triggers and combinations, sets the runLogicState.


unregisterListeners

public void unregisterListeners()
Method to stop the Viewmanagement. Removes combinations from the VM Table, calls finalize() for active combos and finalize for active triggers. Sets status runLogicState.


getTrigger

public ATrigger getTrigger(String name)
Returns a trigger from list triggers that matches the given name in the argument.

Parameters:
name - name of trigger to be searched for
Returns:
instance of searched trigger

getCombination

public ACombination getCombination(String name)
Returns a combination from list combos that matches the given name in the argument.

Parameters:
name - name of the combination to be searched for
Returns:
instance of searched combination

getEffect

public AEffect getEffect(String name)
Returns an effect from list effects that matches the given name in the argument.

Parameters:
name - of the effect to be searched for
Returns:
instance of searched trigger

getEffectsAsText

public List<String> getEffectsAsText()
Gives a list of Strings of available effects names

Returns:
list of Strings of available effect names

getState

public boolean getState()
Returns the state of the RunLogic, true for on, false for off. This is used to determine the next action of the button in the VM Control view.

Returns:
the state of the RunLogic

getCombos

public HashMap<String,ACombination> getCombos()
Returns:
the combos