Search in sources :

Example 6 with Workflow

use of org.vcell.workflow.Workflow in project vcell by virtualcell.

the class WorkflowGraphModel method setWorkflow.

/**
 * Sets the graph property (cbit.vcell.mapping.potential.Graph) value.
 * @param graph The new value for the property.
 * @see #getGraph
 */
public void setWorkflow(Workflow workflow) {
    Workflow oldValue = fieldWorkflow;
    fieldWorkflow = workflow;
    firePropertyChange("workflow", oldValue, workflow);
    refreshAll();
}
Also used : Workflow(org.vcell.workflow.Workflow)

Example 7 with Workflow

use of org.vcell.workflow.Workflow in project vcell by virtualcell.

the class WorkflowModelPanel method setWorkflow.

/**
 * Sets the graph property (cbit.vcell.mapping.potential.Graph) value.
 * @param graph The new value for the property.
 * @see #getGraph
 */
public void setWorkflow(Workflow workflow) {
    Workflow oldValue = fieldWorkflow;
    fieldWorkflow = workflow;
    firePropertyChange("workflow", oldValue, workflow);
}
Also used : Workflow(org.vcell.workflow.Workflow)

Example 8 with Workflow

use of org.vcell.workflow.Workflow in project vcell by virtualcell.

the class WorkflowModelPanel method main.

/**
 * main entrypoint - starts the part when it is run as an application
 * @param args java.lang.String[]
 */
public static void main(java.lang.String[] args) {
    try {
        JFrame frame = new javax.swing.JFrame();
        WorkflowModelPanel aWorkflowModelPanel;
        aWorkflowModelPanel = new WorkflowModelPanel();
        frame.setContentPane(aWorkflowModelPanel);
        frame.setSize(aWorkflowModelPanel.getSize());
        frame.addWindowListener(new java.awt.event.WindowAdapter() {

            @Override
            public void windowClosing(java.awt.event.WindowEvent e) {
                System.exit(0);
            }
        });
        LocalWorkspace localWorkspace = new LocalWorkspace(new File("C:\\temp"));
        Workflow workflow = new Workflow("temp");
        class Task1 extends Task {

            final DataInput<Double> in = new DataInput<Double>(Double.class, "in", this);

            final DataOutput<Double> out = new DataOutput<Double>(Double.class, "out", this);

            public Task1() {
                super("t1");
                addInput(in);
                addOutput(out);
            }

            @Override
            protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
                System.out.println("executing task " + getName());
            }
        }
        ;
        class Task2 extends Task {

            final DataInput<Double> in = new DataInput<Double>(Double.class, "in", this);

            final DataOutput<Double> out = new DataOutput<Double>(Double.class, "out", this);

            public Task2() {
                super("t2");
                addInput(in);
                addOutput(out);
            }

            @Override
            protected void compute0(TaskContext context, ClientTaskStatusSupport clientTaskStatusSupport) throws Exception {
                System.out.println("executing task " + getName());
            }
        }
        ;
        Task1 task1 = new Task1();
        workflow.addTask(task1);
        Task2 task2 = new Task2();
        workflow.addTask(task2);
        workflow.connect2(task1.out, task2.in);
        aWorkflowModelPanel.setWorkflow(workflow);
        frame.setVisible(true);
        java.awt.Insets insets = frame.getInsets();
        frame.setSize(frame.getWidth() + insets.left + insets.right, frame.getHeight() + insets.top + insets.bottom);
        frame.setVisible(true);
    } catch (Throwable exception) {
        System.err.println("Exception occurred in main() of javax.swing.JPanel");
        exception.printStackTrace(System.out);
    }
}
Also used : DataOutput(org.vcell.workflow.DataOutput) LocalWorkspace(org.vcell.vmicro.workflow.data.LocalWorkspace) Task(org.vcell.workflow.Task) TaskContext(org.vcell.workflow.TaskContext) Workflow(org.vcell.workflow.Workflow) DataInput(org.vcell.workflow.DataInput) JFrame(javax.swing.JFrame) ClientTaskStatusSupport(org.vcell.util.ClientTaskStatusSupport) File(java.io.File)

Example 9 with Workflow

use of org.vcell.workflow.Workflow in project vcell by virtualcell.

the class WorkflowObjectsTableModel method setValueAt.

public void setValueAt(Object value, int row, int col) {
    if (value == null) {
        return;
    }
    try {
        String inputValue = (String) value;
        inputValue = inputValue.trim();
        WorkflowObject workflowObject = getValueAt(row);
        switch(col) {
            case COLUMN_VALUE:
                {
                    if (inputValue.length() == 0) {
                        return;
                    }
                    if (workflowObject instanceof WorkflowParameter) {
                        WorkflowParameter dataHolder = (WorkflowParameter) workflowObject;
                        Class dataClass = dataHolder.getType();
                        Repository repository = taskContext.getRepository();
                        Workflow workflow = taskContext.getWorkflow();
                        if (dataClass.equals(Double.class)) {
                            repository.setData(dataHolder, Double.valueOf(inputValue));
                            workflow.refreshStatus();
                        } else if (dataClass.equals(Float.class)) {
                            repository.setData(dataHolder, Float.valueOf(inputValue));
                            workflow.refreshStatus();
                        } else if (dataClass.equals(Integer.class)) {
                            repository.setData(dataHolder, Integer.valueOf(inputValue));
                            workflow.refreshStatus();
                        } else if (dataClass.equals(Boolean.class)) {
                            repository.setData(dataHolder, Boolean.valueOf(inputValue));
                            workflow.refreshStatus();
                        } else if (dataClass.equals(String.class)) {
                            repository.setData(dataHolder, inputValue);
                            workflow.refreshStatus();
                        } else {
                            System.out.println("type " + dataClass.getSimpleName() + " not supported");
                        }
                    }
                    break;
                }
        }
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }
}
Also used : Repository(org.vcell.workflow.Repository) Workflow(org.vcell.workflow.Workflow) WorkflowParameter(org.vcell.workflow.WorkflowParameter) WorkflowObject(org.vcell.workflow.WorkflowObject)

Example 10 with Workflow

use of org.vcell.workflow.Workflow in project vcell by virtualcell.

the class WorkflowObjectsTableModel method setTaskContext.

public void setTaskContext(TaskContext taskContext) {
    if (taskContext != null) {
        Workflow workflow = taskContext.getWorkflow();
        workflow.removePropertyChangeListener(this);
        for (WorkflowParameter<? extends Object> dataHolder : workflow.getParameters()) {
            dataHolder.removePropertyChangeListener(this);
        }
        for (Task task : workflow.getTasks()) {
            task.removePropertyChangeListener(this);
        }
    }
    this.taskContext = taskContext;
    if (this.taskContext != null) {
        Workflow workflow = this.taskContext.getWorkflow();
        workflow.addPropertyChangeListener(this);
        for (WorkflowParameter<? extends Object> dataHolder : workflow.getParameters()) {
            dataHolder.addPropertyChangeListener(this);
        }
        for (Task task : workflow.getTasks()) {
            task.addPropertyChangeListener(this);
        }
    }
    refreshData();
}
Also used : Task(org.vcell.workflow.Task) Workflow(org.vcell.workflow.Workflow)

Aggregations

Workflow (org.vcell.workflow.Workflow)13 LocalWorkspace (org.vcell.vmicro.workflow.data.LocalWorkspace)7 TaskContext (org.vcell.workflow.TaskContext)7 File (java.io.File)6 Repository (org.vcell.workflow.Repository)6 MemoryRepository (org.vcell.workflow.MemoryRepository)5 ArrayList (java.util.ArrayList)4 Issue (org.vcell.util.Issue)3 Task (org.vcell.workflow.Task)3 IssueContext (org.vcell.util.IssueContext)2 DisplayDependentROIs (org.vcell.vmicro.workflow.task.DisplayDependentROIs)2 DisplayProfileLikelihoodPlots (org.vcell.vmicro.workflow.task.DisplayProfileLikelihoodPlots)2 ImportRawTimeSeriesFromVFrap (org.vcell.vmicro.workflow.task.ImportRawTimeSeriesFromVFrap)2 RunProfileLikelihoodGeneral (org.vcell.vmicro.workflow.task.RunProfileLikelihoodGeneral)2 WorkflowObject (org.vcell.workflow.WorkflowObject)2 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)1 Hashtable (java.util.Hashtable)1 JFrame (javax.swing.JFrame)1 ClientTaskStatusSupport (org.vcell.util.ClientTaskStatusSupport)1 OptContext (org.vcell.vmicro.workflow.data.OptContext)1