Project

General

Profile

« Previous | Next » 

Revision e7fb4208

Added by Ben Stöver almost 8 years ago

Debug outputs removed.
Token set added to CDMSequenceMatrixAdapter.

View differences:

eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/ExportSequenceToFileHandler.java
47 47

  
48 48
    @Override
49 49
    public Object execute(ExecutionEvent event) throws ExecutionException {
50
        System.out.println("ExportSequenceToFileHandler 1");
51

  
52 50
        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
53 51
        TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(currentSelection);
54 52
        if (treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof Sequence) {
55
            System.out.println("ExportSequenceToFileHandler 2");
56 53
            Sequence sequence = (Sequence)treeNodeOfSelection.getValue();
57 54

  
58 55
            //TODO Collect the following information using a wizard.
......
68 65

  
69 66
            try {
70 67
                writer.writeDocument(document, targetFile, parameters);
71
                System.out.println("ExportSequenceToFileHandler 3");
72 68
            }
73 69
            catch (IOException e) {
74 70
                e.printStackTrace();
......
78 74
                        //TODO Use multi language error message.
79 75
            }
80 76
        }
81
        System.out.println("ExportSequenceToFileHandler 4");
82 77
        return null;
83 78
    }
84 79
}
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/CDMSequenceMatrixAdapter.java
10 10
package eu.etaxonomy.taxeditor.molecular.io;
11 11

  
12 12

  
13
import info.bioinfweb.commons.bio.CharacterStateSetType;
13 14
import info.bioinfweb.commons.text.StringUtils;
14 15
import info.bioinfweb.jphyloio.ReadWriteConstants;
15 16
import info.bioinfweb.jphyloio.dataadapters.JPhyloIOEventReceiver;
16 17
import info.bioinfweb.jphyloio.dataadapters.MatrixDataAdapter;
18
import info.bioinfweb.jphyloio.dataadapters.ObjectListDataAdapter;
17 19
import info.bioinfweb.jphyloio.dataadapters.implementations.NoSetsMatrixDataAdapter;
20
import info.bioinfweb.jphyloio.dataadapters.implementations.readtowriteadapter.StoreObjectListDataAdapter;
18 21
import info.bioinfweb.jphyloio.events.LinkedLabeledIDEvent;
19 22
import info.bioinfweb.jphyloio.events.SequenceTokensEvent;
23
import info.bioinfweb.jphyloio.events.TokenSetDefinitionEvent;
20 24
import info.bioinfweb.jphyloio.events.type.EventContentType;
21 25

  
22 26
import java.io.IOException;
......
40 44

  
41 45
    private Sequence sequence;
42 46
    private String consensusSequenceLabel;
47
    private ObjectListDataAdapter<TokenSetDefinitionEvent> tokenSetList;
43 48
    //TODO Also allow specifying single read labels?
44 49

  
45 50

  
......
53 58
        super();
54 59
        this.sequence = sequence;
55 60
        this.consensusSequenceLabel = consensusSequenceLabel;
61
        tokenSetList = createTokenSetList();
62
    }
63

  
64

  
65
    private ObjectListDataAdapter<TokenSetDefinitionEvent> createTokenSetList() {
66
        StoreObjectListDataAdapter<TokenSetDefinitionEvent> result = new StoreObjectListDataAdapter<TokenSetDefinitionEvent>();
67
        result.setObjectStartEvent(new TokenSetDefinitionEvent(CharacterStateSetType.DNA,
68
                ReadWriteConstants.DEFAULT_TOKEN_SET_ID_PREFIX, null));
69
        return result;
56 70
    }
57 71

  
58 72

  
......
158 172
            throw new IllegalArgumentException("No sequence with the ID \"" + sequenceID + "\" could be found.");
159 173
        }
160 174
    }
175

  
176

  
177
    /* (non-Javadoc)
178
     * @see info.bioinfweb.jphyloio.dataadapters.implementations.NoSetsMatrixDataAdapter#getTokenSets()
179
     */
180
    @Override
181
    public ObjectListDataAdapter<TokenSetDefinitionEvent> getTokenSets() {
182
        return tokenSetList;
183
    }
161 184
}

Also available in: Unified diff