de.cau.cs.kieler.kvid.datadistributor
Class RuntimeConfiguration

java.lang.Object
  extended by de.cau.cs.kieler.kvid.datadistributor.RuntimeConfiguration

public final class RuntimeConfiguration
extends Object

Class for handling configuration that happens during runtime. Will be lost if program is closed.

Rating red

Field Summary
static String ANIMATION_BEHAVIOR
          Constant for getting animation behavior by name.
static String ANIMATION_STATUS
          Constant for getting animation status by name.
static String DEBUG_MODE
          Constant for getting animation status by name.
static String DEFAULT_PORT
          Constant for getting animation status by name.
static String MAX_TOKEN_SIZE
          Constant for getting maximal token size by name.
 
Method Summary
 void addProperty(int where, Property theproperty)
          ONLY use this to add a new Property to the configuration when a certain position is desired (e.g.
 void addProperty(Property theproperty)
          ONLY use this to add a new Property to the configuration.
 void addPropertyListener(IPropertyListener thelistener)
          Registers a new listener which will be notified when the Properties change.
 String currentValueOfProperty(String propertyName)
          Gives the current value of a Property by it's name.
static RuntimeConfiguration getInstance()
          Gives the single instance of the RuntimeConfiguration.
 List<Property> getKnownProperties()
          Getter for the list of currently known Propertys.
 Property getProperty(String propertyName)
          Getter for a property with a certain name.
 List<Property> getReferedProperties(List<String> selectedParts)
          Getter for the list of Propertys referring to the current selection.
 void removeProperty(Property theproperty)
          Removes a Property from the list of currenty known Properties.
 void removePropertyListener(IPropertyListener thelistener)
          Removes a listener from the listeners list.
 void resetToDefault()
          Resets all known Properties to its' default values.
 void triggerPropertyChanged(Property theproperty)
          Method which notifies listeners when Properties have changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANIMATION_STATUS

public static final String ANIMATION_STATUS
Constant for getting animation status by name.

See Also:
Constant Field Values

ANIMATION_BEHAVIOR

public static final String ANIMATION_BEHAVIOR
Constant for getting animation behavior by name.

See Also:
Constant Field Values

DEBUG_MODE

public static final String DEBUG_MODE
Constant for getting animation status by name.

See Also:
Constant Field Values

MAX_TOKEN_SIZE

public static final String MAX_TOKEN_SIZE
Constant for getting maximal token size by name.

See Also:
Constant Field Values

DEFAULT_PORT

public static final String DEFAULT_PORT
Constant for getting animation status by name.

See Also:
Constant Field Values
Method Detail

getInstance

public static RuntimeConfiguration getInstance()
Gives the single instance of the RuntimeConfiguration.

Returns:
The single instance of the RuntimeConfiguration

currentValueOfProperty

public String currentValueOfProperty(String propertyName)
Gives the current value of a Property by it's name.

Parameters:
propertyName - The name of the Property to look up
Returns:
The current value of the requested Property

getKnownProperties

public List<Property> getKnownProperties()
Getter for the list of currently known Propertys. Only for display purposes, do NOT use for manipulation!

Returns:
The list of currently known Propertys

getProperty

public Property getProperty(String propertyName)
Getter for a property with a certain name.

Parameters:
propertyName - Name of the Property to get
Returns:
The Property with the given name or null if it doesn't exists

getReferedProperties

public List<Property> getReferedProperties(List<String> selectedParts)
Getter for the list of Propertys referring to the current selection. Enter null if there is no selection to get general options.

Parameters:
selectedParts - The currently selected EditParts
Returns:
The Properties referring to the selected EditParts

addProperty

public void addProperty(Property theproperty)
ONLY use this to add a new Property to the configuration. Will make sure Property names are unique.

Parameters:
theproperty - The new Property to add

addProperty

public void addProperty(int where,
                        Property theproperty)
ONLY use this to add a new Property to the configuration when a certain position is desired (e.g. for style reasons). Will make sure Property names are unique.

Parameters:
where - Position in the Properties list where it should be added
theproperty - The new Property to add

removeProperty

public void removeProperty(Property theproperty)
Removes a Property from the list of currenty known Properties.

Parameters:
theproperty - The Property to remove from the list

addPropertyListener

public void addPropertyListener(IPropertyListener thelistener)
Registers a new listener which will be notified when the Properties change.

Parameters:
thelistener - The IPropertyListener to add

removePropertyListener

public void removePropertyListener(IPropertyListener thelistener)
Removes a listener from the listeners list.

Parameters:
thelistener - The IPropertyListener to remove

triggerPropertyChanged

public void triggerPropertyChanged(Property theproperty)
Method which notifies listeners when Properties have changed. Also takes care, when some Property needs special handling.

Parameters:
theproperty - The Property which was changed

resetToDefault

public void resetToDefault()
Resets all known Properties to its' default values. Will ignore free text Properties.