|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.model.impl.WorkingPart | +--fdda.model.impl.Node
The implementation of the Node interface.
Field Summary | |
protected WorkingPart |
graphicalRepresentation
the graphical representation of the part |
Fields inherited from interface fdda.model.Node |
ACTIVE_PROPERTY_NAME, LABEL_PROPERTY_NAME, NODE_TYPE_PROPERTY_NAME |
Fields inherited from interface fdda.model.WorkingPart |
WORKING_PROPERTY_NAME |
Constructor Summary | |
Node(int nr,
Project project,
Node graphicalRepresentation)
Constructor. |
Method Summary | |
void |
addConnection(Connection connection)
Adds a connection to the node. |
void |
addProperty(Property property)
Adds a property to the holder. |
void |
addPropertyListener(PropertyListener listener)
Adds a PropertyListener (Observer pattern). |
boolean |
canSendMessageDirectlyTo(Node node)
Returns whether the node can send a message through (exactly) one connections to another node. |
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. |
protected void |
firePropertyAdded(Property property)
Notifies the listeners that a property has been added. |
void |
firePropertyChanged(Property property)
Informs the listeners that a property has been changed. |
protected void |
firePropertyRemoved(Property property)
Notifies the listeners that a property has been removed. |
Node |
getAlgorithmicNode()
Returns the algorithmic representation of the node. |
List |
getConnections()
Returns all the connections starting or ending at the node. |
Node |
getGraphicalRepresentation()
Returns the graphical representation of the node. |
List |
getIncomingConnections()
Returns all directed connections ending at the node and all undirected connections of the node. |
String |
getLabel()
Returns the label of the node, which can identify the node for an user. |
List |
getNeighbours()
Returns all nodes that are directly connected to this node through a connection (either directed or undirected). |
int |
getNr()
Returns the internal number of the node, which is unique. |
List |
getOutgoingConnections()
Returns all directed connections starting at the node and all undirected connections of the node. |
Project |
getProject()
Returns the project that contains this node. |
Iterator |
getProperties()
Returns an Iterator over the properties of the holder. |
Property |
getProperty(String name)
Returns a property of the holder. |
void |
initialize()
Initializes the node. |
boolean |
isConnectedTo(Node node)
Returns whether there exists a connection that may transport messages directly between this node and another node. |
boolean |
isNeighbouredTo(Node node)
Returns whether the node is a neighbour of the node in the parameter. |
boolean |
isRepeater()
Returns whether this node is a repeater. |
boolean |
isWorking()
Returns whether the part is currently working. |
void |
propertyAdded(PropertyEvent pe)
Called whenever a property is added to the PropertyHolder. |
void |
propertyChanged(PropertyEvent pe)
Called whenever a property of the PropertyHolder is changed. |
void |
propertyRemoved(PropertyEvent pe)
Called whenever a property is removed from the PropertyHolder. |
void |
removeConnection(Connection connection)
Removes a connection from the node. |
void |
removeProperty(Property property)
Removes a property from the holder. |
void |
removePropertyListener(PropertyListener listener)
Removes a PropertyListener (Observer pattern). |
void |
setAlgorithmicNode(Node algorithmicNode)
Specifies the algorithmic representation of the node. |
void |
setLabel(String label)
Sets the label of the node. |
void |
setWorking(boolean working)
Sets whether the part is currently working. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fdda.model.PropertyHolder |
addProperty, addPropertyListener, changeProperty, firePropertyChanged, getProperties, getProperty, removeProperty, removePropertyListener |
Methods inherited from interface fdda.model.WorkingPart |
isWorking, setWorking |
Field Detail |
protected WorkingPart graphicalRepresentation
Constructor Detail |
public Node(int nr, Project project, Node graphicalRepresentation)
nr
- the ID / internal number of the nodegraphicalRepresentation
- the graphical representationMethod Detail |
public void initialize()
Node
initialize
in interface Node
public Node getGraphicalRepresentation()
Node
getGraphicalRepresentation
in interface Node
public Node getAlgorithmicNode()
Node
getAlgorithmicNode
in interface Node
public void setAlgorithmicNode(Node algorithmicNode)
Node
setAlgorithmicNode
in interface Node
algorithmicNode
- the algorithmic representationpublic int getNr()
Node
getNr
in interface Node
public String getLabel()
Node
getLabel
in interface Node
public void setLabel(String label)
Node
setLabel
in interface Node
label
- the new label.public List getConnections()
Node
getConnections
in interface Node
public List getOutgoingConnections()
Node
getOutgoingConnections
in interface Node
public List getIncomingConnections()
Node
getIncomingConnections
in interface Node
public List getNeighbours()
Node
getNeighbours
in interface Node
public boolean isNeighbouredTo(Node node)
Node
isNeighbouredTo
in interface Node
node
- a node
public boolean canSendMessageDirectlyTo(Node node)
Node
canSendMessageDirectlyTo
in interface Node
node
- a node
public boolean isConnectedTo(Node node)
Node
isConnectedTo
in interface Node
node
- a node
public void addConnection(Connection connection)
Node
addConnection
in interface Node
connection
- a connectionpublic void removeConnection(Connection connection)
Node
removeConnection
in interface Node
connection
- a connectionpublic void propertyChanged(PropertyEvent pe)
PropertyListener
propertyChanged
in interface PropertyListener
propertyChanged
in class WorkingPart
pe
- the PropertyEventpublic void propertyAdded(PropertyEvent pe)
PropertyListener
propertyAdded
in interface PropertyListener
propertyAdded
in class WorkingPart
pe
- the PropertyEventpublic Project getProject()
Node
getProject
in interface Node
public boolean isRepeater()
Node
isRepeater
in interface Node
public boolean isWorking()
WorkingPart
isWorking
in interface WorkingPart
public final void setWorking(boolean working)
WorkingPart
setWorking
in interface WorkingPart
working
- whether the part is workingpublic Iterator getProperties()
PropertyHolder
getProperties
in interface PropertyHolder
public Property getProperty(String name)
PropertyHolder
getProperty
in interface PropertyHolder
name
- the name of the property
public void addProperty(Property property)
PropertyHolder
addProperty
in interface PropertyHolder
public void removeProperty(Property property)
PropertyHolder
removeProperty
in interface PropertyHolder
property
- the property to be removed, must not be nullpublic void changeProperty(Property property)
PropertyHolder
changeProperty
in interface PropertyHolder
property
- the new property, must not be nullpublic void addPropertyListener(PropertyListener listener)
PropertyHolder
addPropertyListener
in interface PropertyHolder
listener
- the listener to be addedEventListenerList
public void removePropertyListener(PropertyListener listener)
PropertyHolder
removePropertyListener
in interface PropertyHolder
listener
- the listener to be removedEventListenerList
public void firePropertyChanged(Property property)
PropertyHolder
firePropertyChanged
in interface PropertyHolder
property
- the property that was changed.protected void firePropertyAdded(Property property)
property
- the added propertyEventListenerList
protected void firePropertyRemoved(Property property)
property
- the added propertyEventListenerList
public void propertyRemoved(PropertyEvent pe)
PropertyListener
propertyRemoved
in interface PropertyListener
pe
- the PropertyEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |