Project

General

Profile

« Previous | Next » 

Revision 00d1a6ce

Added by Ben Stöver over 7 years ago

Export single read alignment wizard separated into two pages.
Option to elongate sequences added.
Application information parameters of JPhyloIO set.

View differences:

eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/io/wizard/ExportSingleReadAlignmentWizardModel.java
9 9
package eu.etaxonomy.taxeditor.molecular.io.wizard;
10 10

  
11 11

  
12
import info.bioinfweb.commons.bio.SequenceUtils;
12 13
import info.bioinfweb.jphyloio.events.type.EventContentType;
13 14
import info.bioinfweb.jphyloio.factory.JPhyloIOReaderWriterFactory;
14 15
import info.bioinfweb.jphyloio.formatinfo.JPhyloIOFormatInfo;
......
33 34
    protected static final Map<String, JPhyloIOFormatInfo> FORMAT_NAMES_TO_INFO_MAP = createFormatInfoList();
34 35

  
35 36

  
36
    private IObservableValue exportSingleReads = new WritableValue(true, Boolean.class);
37
    private IObservableValue exportConsensusSequence = new WritableValue(true, Boolean.class);
38
    private IObservableValue consensusSequenceLabel = new WritableValue("ConsensusSequence", String.class);
39 37
    private IObservableValue formatInfo = new WritableValue(null, String.class);
40 38
    private IObservableValue fileName = new WritableValue(null, String.class);
39
    private IObservableValue exportSingleReads = new WritableValue(true, Boolean.class);
40
    private IObservableValue exportConsensusSequence = new WritableValue(true, Boolean.class);
41
    private IObservableValue consensusSequenceLabel = new WritableValue("Consensus", String.class);
42
    private IObservableValue elongateSequences = new WritableValue(false, Boolean.class);
43
    private IObservableValue useGapToken = new WritableValue(true, Boolean.class);
41 44

  
42 45

  
43 46
    private static Map<String, JPhyloIOFormatInfo> createFormatInfoList() {
......
52 55
    }
53 56

  
54 57

  
58
    protected IObservableValue getFormatInfoObservable() {
59
        return formatInfo;
60
    }
61

  
62

  
63
    /**
64
     * Returns the <i>JPhyloIO</i> format info object to be used for exporting.
65
     *
66
     * @return the format info
67
     */
68
    public JPhyloIOFormatInfo getFormatInfo() {
69
        return FORMAT_NAMES_TO_INFO_MAP.get(formatInfo.getValue());
70
    }
71

  
72

  
73
    public String getFileName() {
74
        return (String)fileName.getValue();
75
    }
76

  
77

  
78
    protected IObservableValue getFileNameObservable() {
79
        return fileName;
80
    }
81

  
82

  
55 83
    public boolean isExportSingleReads() {
56 84
        return (Boolean)exportSingleReads.getValue();
57 85
    }
......
82 110
    }
83 111

  
84 112

  
85
    protected IObservableValue getFormatInfoObservable() {
86
        return formatInfo;
113
    public String getElongationToken() {
114
        if ((Boolean)elongateSequences.getValue()) {
115
            if ((Boolean)useGapToken.getValue()) {
116
                return Character.toString(SequenceUtils.GAP_CHAR);
117
            }
118
            else {
119
                return Character.toString(SequenceUtils.MISSING_DATA_CHAR);
120
            }
121
        }
122
        else {
123
            return null;
124
        }
87 125
    }
88 126

  
89 127

  
90
    /**
91
     * Returns the <i>JPhyloIO</i> format info object to be used for exporting.
92
     *
93
     * @return the format info
94
     */
95
    public JPhyloIOFormatInfo getFormatInfo() {
96
        return FORMAT_NAMES_TO_INFO_MAP.get(formatInfo.getValue());
128
    protected IObservableValue getElongateSequencesObservable() {
129
        return elongateSequences;
97 130
    }
98 131

  
99 132

  
100
    public String getFileName() {
101
        return (String)fileName.getValue();
133
    protected IObservableValue getUseGapTokenObservable() {
134
        return useGapToken;
102 135
    }
103 136

  
104 137

  
105
    protected IObservableValue getFileNameObservable() {
106
        return fileName;
107
    }
108 138
}

Also available in: Unified diff