// real need to subclass this to remove it.
Iterator relations = ((CompositeEntity) composite)
.relationList().iterator();
while (relations.hasNext()) {
ComponentRelation relation = (ComponentRelation) relations
.next();
List vertexList = relation.attributeList(Vertex.class);
if (vertexList.size() != 0) {
// Add in all the vertexes.
Iterator vertexes = vertexList.iterator();
while (vertexes.hasNext()) {
Vertex v = (Vertex) vertexes.next();
nodes.add(v);
}
} else {
// See if we need to create a vertex.
// Count the linked ports.
int count = relation.linkedPortList().size();
if (count != 2) {
// A vertex is needed, so create one.
try {
String name = relation.uniqueName("vertex");
Vertex vertex = new Vertex(relation, name);
nodes.add(vertex);
// Have to manually handle propagation, since
// the MoML parser is not involved.