repast.simphony.agents.designer.model
Class AgentPropertyorStepWithLabelModelPart

java.lang.Object
  extended by repast.simphony.agents.designer.model.AgentModelPart
      extended by repast.simphony.agents.designer.model.AgentDiagramElementModelPart
          extended by repast.simphony.agents.designer.model.AgentPropertyorStepModelPart
              extended by repast.simphony.agents.designer.model.AgentPropertyorStepWithLabelModelPart
All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
AgentPropertyModelPart, BehaviorStepModelPart, DecisionStepModelPart, TaskStepModelPart

public abstract class AgentPropertyorStepWithLabelModelPart
extends AgentPropertyorStepModelPart

Author:
agreif (Adapted by Michael J. North for Use in Repast Simphony from Alexander Greif’s Flow4J-Eclipse (http://flow4jeclipse.sourceforge.net/docs/index.html), with Thanks to the Original Author) Model part of a flowlet that has a label property.

Field Summary
protected  AgentPropertyorStepLabelModelPart propertyOrStepLabel
           
 
Fields inherited from class repast.simphony.agents.designer.model.AgentPropertyorStepModelPart
PROP_SOURCE_CONNECTION, PROP_TARGET_CONNECTION
 
Fields inherited from class repast.simphony.agents.designer.model.AgentDiagramElementModelPart
DEFAULT_PARENT_CLASS_NAME, parentClassName, PROP_LOCATION
 
Constructor Summary
AgentPropertyorStepWithLabelModelPart()
           
 
Method Summary
 AgentPropertyorStepLabelModelPart getFlowletLabel()
          Returns the flowlet's label model.
 String getLabel()
           
protected  String getLabelPropertyNameResource()
          Returns the name of the resource entry that contains the property name.
protected  Collection getPropertyDescriptorsCollection()
          Collects all property descriptors.
 Object getPropertyValue(Object propName)
          Returns an Object which represents the appropriate value for the property name supplied.
 boolean hasValidLabel()
          Returns whether the property has a valid label.
 void setFlowletLabel(AgentPropertyorStepLabelModelPart flowletLabel)
          Sets the flowlet's label.
 void setLabel(String newLabel)
           
 void setPropertyValue(Object id, Object value)
          Sets the value of a given property with the value supplied.
 
Methods inherited from class repast.simphony.agents.designer.model.AgentPropertyorStepModelPart
connectSource, connectTarget, disconnectSource, disconnectTarget, getSourceTransitions, getTargetTransitions, getType
 
Methods inherited from class repast.simphony.agents.designer.model.AgentDiagramElementModelPart
getEditableValue, getLocation, getParentClassName, getPropertyDescriptors, isPropertySet, isPropertySet, resetPropertyValue, setLocation, setParentClassName
 
Methods inherited from class repast.simphony.agents.designer.model.AgentModelPart
addPropertyChangeListener, firePropertyChange, fireStructureChange, propertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyOrStepLabel

protected AgentPropertyorStepLabelModelPart propertyOrStepLabel
Constructor Detail

AgentPropertyorStepWithLabelModelPart

public AgentPropertyorStepWithLabelModelPart()
Method Detail

getFlowletLabel

public AgentPropertyorStepLabelModelPart getFlowletLabel()
Returns the flowlet's label model.

Returns:
the flowlet's label model.

getLabel

public String getLabel()

setLabel

public void setLabel(String newLabel)

setFlowletLabel

public void setFlowletLabel(AgentPropertyorStepLabelModelPart flowletLabel)
Sets the flowlet's label.

Parameters:
propertyOrStepLabel -

hasValidLabel

public boolean hasValidLabel()
Returns whether the property has a valid label. This means that it is not null and length is not zero.

Returns:
true if the property has a valid label.

getLabelPropertyNameResource

protected String getLabelPropertyNameResource()
Returns the name of the resource entry that contains the property name. This metzhod returns the default key, subclasses can specify a more specific key.

Returns:
key in the resources file

getPropertyDescriptorsCollection

protected Collection getPropertyDescriptorsCollection()
Collects all property descriptors. Those of the superclass and those of this class

Overrides:
getPropertyDescriptorsCollection in class AgentDiagramElementModelPart
Returns:
Collection with all Property descriptors

getPropertyValue

public Object getPropertyValue(Object propName)
Returns an Object which represents the appropriate value for the property name supplied. In case of label property the request will be routed to the label modelPart.

Overrides:
getPropertyValue in class AgentDiagramElementModelPart
Parameters:
propName - Name of the property for which the the values are needed.
Returns:
Object which is the value of the property.
See Also:
org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)

setPropertyValue

public void setPropertyValue(Object id,
                             Object value)
Sets the value of a given property with the value supplied. Also fires a property change if necessary.

Overrides:
setPropertyValue in class AgentDiagramElementModelPart
Parameters:
id - Name of the parameter to be changed.
value - Value to be set to the given parameter.
See Also:
org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)