fdda.model
Interface PropertyHolder

All Known Subinterfaces:
Connection, Line, Node, Node
All Known Implementing Classes:
Connection, Line, Node, Node, WorkingPart

public interface PropertyHolder

A part of the model that holds properties.

Author:
Jörg Rüdenauer
See Also:
Property

Method Summary
 void addProperty(Property property)
          Adds a property to the holder.
 void addPropertyListener(PropertyListener listener)
          Adds a PropertyListener (Observer pattern).
 void changeProperty(Property property)
          Changes a property of the holder - i.e., replaces the property with the name of the parameter property with the parameter.
 void firePropertyChanged(Property property)
          Informs the listeners that a property has been changed.
 Iterator getProperties()
          Returns an Iterator over the properties of the holder.
 Property getProperty(String name)
          Returns a property of the holder.
 void removeProperty(Property property)
          Removes a property from the holder.
 void removePropertyListener(PropertyListener listener)
          Removes a PropertyListener (Observer pattern).
 

Method Detail

getProperties

public Iterator getProperties()
Returns an Iterator over the properties of the holder.

Returns:
an Iterator over the properties

getProperty

public Property getProperty(String name)
Returns a property of the holder. If no property with the specified name exists, null is returned.

Parameters:
name - the name of the property
Returns:
the property

addProperty

public void addProperty(Property property)
Adds a property to the holder. If a property with the same name already exists, it is removed.


removeProperty

public void removeProperty(Property property)
Removes a property from the holder. The key for removal is the name of the property; if no property with that name exists, nothing happens.

Parameters:
property - the property to be removed, must not be null

changeProperty

public void changeProperty(Property property)
Changes a property of the holder - i.e., replaces the property with the name of the parameter property with the parameter. If no such property exists, the property is simply added to the holder; in this case, a propertyAdded event instead of a propertyChanged event is fired.

Parameters:
property - the new property, must not be null

addPropertyListener

public void addPropertyListener(PropertyListener listener)
Adds a PropertyListener (Observer pattern).

Parameters:
listener - the listener to be added
See Also:
EventListenerList

removePropertyListener

public void removePropertyListener(PropertyListener listener)
Removes a PropertyListener (Observer pattern).

Parameters:
listener - the listener to be removed
See Also:
EventListenerList

firePropertyChanged

public void firePropertyChanged(Property property)
Informs the listeners that a property has been changed. Note that the property holder can't determine by himself whether a property is changed internally; therefore, the property must inform its holder of any changes. This method must only be called by implementing classes of either PropertyHolder or Property.

Parameters:
property - the property that was changed.


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.