Changeset 7426


Ignore:
Timestamp:
12/15/10 23:54:45 (9 years ago)
Author:
aivar
Message:

Added a workflow class that creates a pipeline of plugins but looks just like a plugin. In progress...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/maven/projects/deep-zoom-plugin/src/main/java/loci/workflow/WorkFlow.java

    r7425 r7426  
    2525    List<String> m_outputNames = new ArrayList<String>(); 
    2626    List<Chain> m_chains = new ArrayList<Chain>(); 
     27    Map<String, IWorkFlowComponent> m_inputComponents = new HashMap<String, IWorkFlowComponent>(); 
     28    Map<String, String> m_inputComponentNames = new HashMap<String, String>(); 
     29    Map<String, IOutputListener> m_listeners = new HashMap<String, IOutputListener>(); 
    2730 
    2831    public String getName() { 
     
    7982    } 
    8083 
    81     public void addInputName(String name) { 
    82         m_inputNames.add(name); 
    83     } 
    84  
    85     public void addOutputName(String name) { 
    86         m_outputNames.add(name); 
    87     } 
    88  
    8984    public void add(IWorkFlowComponent component) { 
    9085        m_componentMap.put(component.getName(), component); 
     
    114109    public void chainInput(String inName, IWorkFlowComponent dest, String destName) { 
    115110        m_inputNames.add(inName); 
    116         //TODO 
     111        m_inputComponents.put(inName, dest); 
     112        m_inputComponentNames.put(inName, destName); 
    117113    } 
    118114 
     
    123119    public void chainOutput(IWorkFlowComponent source, String sourceName, String outName) { 
    124120        m_outputNames.add(outName); 
    125         //TODO 
     121        //TODO set a listener, forwards to our listener, if any; source & sourceName might be misnomer 
    126122    } 
    127123     
    128124    public void input(ImageWrapper image, String name) { 
    129125        if (m_inputNames.contains(name)) { 
    130             //TODO feed to the top of the chain 
    131              
     126            IWorkFlowComponent dest = m_inputComponents.get(name); 
     127            String destName = m_inputComponentNames.get(name); 
     128            dest.input(image, destName); 
    132129        } 
    133130        else { 
     
    138135    public void setOutputListener(String name, IOutputListener listener) { 
    139136        if (m_outputNames.contains(name)) { 
    140             //TODO set up listener 
     137            m_listeners.put(name, listener); 
    141138        } 
    142139        else { 
     
    145142    } 
    146143 
     144    /** 
     145     * Keeps track of a chained connection. 
     146     */ 
    147147    private class Chain { 
    148148        IWorkFlowComponent m_source; 
Note: See TracChangeset for help on using the changeset viewer.