Project

General

Profile

« Previous | Next » 

Revision 97e308a9

Added by Andreas Müller almost 3 years ago

cleanup and remove generics from Identifier class

View differences:

eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/e4/AlignmentEditorE4.java
11 11
import java.io.File;
12 12
import java.io.IOException;
13 13
import java.io.InputStream;
14

  
15 14
import java.util.ArrayList;
16 15
import java.util.Collection;
17 16
import java.util.Collections;
......
85 84
import info.bioinfweb.libralign.pherogram.provider.ReverseComplementPherogramProvider;
86 85
import info.bioinfweb.tic.SWTComponentFactory;
87 86

  
88

  
89

  
90 87
/**
91 88
 * Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to
92 89
 * a consensus sequence.
......
138 135

  
139 136

  
140 137
    private MultipleAlignmentsContainer alignmentsContainer = null;
141
    private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<String, SingleReadAlignment>();  //TODO Move this to ContigSequenceDataProvider
142

  
138
    private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<>();  //TODO Move this to ContigSequenceDataProvider
143 139

  
144 140
    @Inject
145 141
    private MDirtyable dirty;
......
150 146
    public AlignmentEditorE4() {
151 147
    }
152 148

  
153

  
154 149
    private void refreshToolbarElement(String id) {
155 150
		ICommandService commandService =
156 151
				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
......
159 154
		}
160 155
    }
161 156

  
162

  
163 157
    private void registerEditSettingListener(MultipleAlignmentsContainer container) {
164 158
        container.getEditSettings().addListener(new EditSettingsListener() {
165 159
            @Override
......
179 173
        });
180 174
    }
181 175

  
182

  
183 176
    private AlignmentArea createIndexArea(MultipleAlignmentsContainer container, AlignmentArea labeledArea) {
184 177
		AlignmentArea result = new AlignmentArea(container);
185 178
		result.setAllowVerticalScrolling(false);
......
187 180
		return result;
188 181
    }
189 182

  
190

  
191 183
    private AlignmentArea createEditableAlignmentArea(MultipleAlignmentsContainer container, boolean allowVerticalScrolling) {
192 184
		AlignmentArea result = new AlignmentArea(container);
193 185
		result.setAllowVerticalScrolling(allowVerticalScrolling);
......
201 193
		return result;
202 194
	}
203 195

  
204

  
205 196
    private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container,
206 197
    		AlignmentArea labeledArea) {
207 198

  
......
212 203
		return result;
213 204
    }
214 205

  
215

  
216 206
    private MultipleAlignmentsContainer getAlignmentsContainer() {
217 207
    	if (alignmentsContainer == null) {
218 208
    		alignmentsContainer = new MultipleAlignmentsContainer();
......
266 256
    	}
267 257
    }
268 258

  
269

  
270 259
    /**
271 260
     * Checks whether the specified alignment area or one of its subcomponents currently has the
272 261
     * focus.
......
280 269
    	return SWTUtils.childHasFocus((Composite)area.getToolkitComponent());
281 270
    }
282 271

  
283

  
284 272
    public boolean hasPherogram(String sequenceID) {
285 273
        return getReadsArea().getDataAreas().getSequenceAreas(sequenceID).size() > PHEROGRAM_AREA_INDEX;
286 274
    }
287 275

  
288

  
289 276
    public PherogramArea getPherogramArea(String sequenceID) {
290 277
        if (hasPherogram(sequenceID)) {
291 278
            return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX);
......
295 282
        }
296 283
    }
297 284

  
298

  
299 285
    private ConsensusSequenceArea getConsensusHintDataArea() {
300 286
        return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas().
301 287
                get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas().
302 288
                get(CONSENSUS_DATA_AREA_INDEX);
303 289
    }
304 290

  
305

  
306 291
    @Deprecated  //TODO Remove as soon as testing period is over
307 292
    private void createTestContents() {
308 293
		// Just for testing:
......
326 311
		}
327 312
    }
328 313

  
329

  
330
    private void readCDMData(Sequence sequenceNode) {
314
    private void readCdmData(Sequence sequenceNode) {
331 315
    	//TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated).
332 316

  
333 317
		// Add reads:
......
358 342
		//TODO Can the consensus sequence also be null? / Should it be created here, if nothing is in the DB?
359 343
    }
360 344

  
361

  
362 345
    @PostConstruct
363 346
    public void createPartControl(Composite parent) {
364 347
        if (CdmStore.isActive()){
......
488 471
            if(sequenceNode!=null && sequenceNode.getId()!=0){
489 472
                sequenceNode = CdmStore.getService(ISequenceService.class).load(sequenceNode.getUuid());
490 473
            }
491
            readCDMData(sequenceNode);
474
            readCdmData(sequenceNode);
492 475
        }
493 476
        else {
494 477
            createTestContents();  // This case will removed after the test phase and an exception should probably be thrown.

Also available in: Unified diff