use of cbit.gui.graph.GraphEvent in project vcell by virtualcell.
the class WorkflowGraphModel method refreshAll.
/**
* Insert the method's description here.
* Creation date: (7/8/2003 9:11:57 AM)
*/
@Override
public void refreshAll() {
clearAllShapes();
if (getWorkflow() == null) {
fireGraphChanged(new GraphEvent(this));
return;
}
ContainerShape containerShape = new SimpleContainerShape(new Object(), this, "workflow-container");
addShape(containerShape);
//
for (Task task : getWorkflow().getTasks()) {
TaskShape taskShape = new TaskShape(task, this);
containerShape.addChildShape(taskShape);
addShape(taskShape);
//
for (DataOutput<? extends Object> output : task.getOutputs()) {
if (!output.getName().equals("displayed")) {
DataHolderShape dataHolderShape = new DataHolderShape(output, this);
containerShape.addChildShape(dataHolderShape);
addShape(dataHolderShape);
WorkflowEdgeShape workflowEdgeShape = new WorkflowEdgeShape(task.getName() + ":" + output.getName(), taskShape, dataHolderShape, this, true, false);
containerShape.addChildShape(workflowEdgeShape);
addShape(workflowEdgeShape);
}
}
// //
// // add a DataInputShape for each input and connect to TaskShape with an edge
// //
// for (DataInput<? extends Object> input : task.getInputs()){
// DataInputShape dataInputShape = new DataInputShape(input,this);
// containerShape.addChildShape(dataInputShape);
// addShape(dataInputShape);
//
// WorkflowEdgeShape workflowEdgeShape = new WorkflowEdgeShape("input:"+task.getName()+":"+input.name,dataInputShape, taskShape, this, true, false);
// containerShape.addChildShape(workflowEdgeShape);
// addShape(workflowEdgeShape);
// }
}
//
for (Task task : getWorkflow().getTasks()) {
for (DataInput<? extends Object> input : task.getInputs()) {
DataObject<? extends Object> source = getWorkflow().getConnectorSource(input);
if (source instanceof DataOutput) {
DataHolderShape dataHolderShape = (DataHolderShape) getShapeFromModelObject(source);
TaskShape taskShape = (TaskShape) getShapeFromModelObject(task);
WorkflowEdgeShape workflowEdgeShape = new WorkflowEdgeShape("connection:" + input.getName(), dataHolderShape, taskShape, this, true, false);
containerShape.addChildShape(workflowEdgeShape);
addShape(workflowEdgeShape);
}
}
}
fireGraphChanged(new GraphEvent(this));
}
Aggregations