Revision f2218c81
Added by Ben Stöver over 8 years ago
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java | ||
---|---|---|
692 | 692 |
|
693 | 693 |
if (tokens != null) { // If either an edited sequence or a pherogram URI was provided. |
694 | 694 |
provider.insertTokensAt(id, 0, tokens); |
695 |
// Create pherogram area: |
|
696 |
PherogramArea pherogramArea = new PherogramArea(getReadsArea().getContentArea(), |
|
697 |
new PherogramAreaModel(pherogramProvider)); |
|
698 |
|
|
699 |
// Set position properties and shifts: |
|
700 |
PherogramAreaModel model = pherogramArea.getModel(); |
|
701 |
if ((firstSeqPos != null) && (leftCutPos != null)) { |
|
702 |
model.setFirstSeqLeftCutPos(firstSeqPos, leftCutPos); |
|
703 |
} |
|
704 |
if (rightCutPos != null) { |
|
705 |
model.setRightCutPosition(rightCutPos); |
|
706 |
} |
|
707 |
if ((shifts != null) && (shifts.length > 0)) { |
|
708 |
for (int i = 0; i < shifts.length; i++) { |
|
709 |
model.addShiftChange(shifts[i].position, shifts[i].shift); |
|
710 |
} |
|
711 |
setDirty(); |
|
712 |
} |
|
713 |
|
|
714 |
// Add pherogram area to GUI: |
|
715 |
pherogramArea.addMouseListener(new PherogramMouseListener(pherogramArea)); |
|
716 |
getReadsArea().getDataAreas().getSequenceAreas(id).add(pherogramArea); |
|
717 |
} |
|
695 |
|
|
696 |
if (pherogramProvider != null) { |
|
697 |
// Create pherogram area: |
|
698 |
PherogramArea pherogramArea = new PherogramArea(getReadsArea().getContentArea(), |
|
699 |
new PherogramAreaModel(pherogramProvider)); |
|
700 |
|
|
701 |
// Set position properties and shifts: |
|
702 |
PherogramAreaModel model = pherogramArea.getModel(); |
|
703 |
if ((firstSeqPos != null) && (leftCutPos != null)) { |
|
704 |
model.setFirstSeqLeftCutPos(firstSeqPos, leftCutPos); |
|
705 |
} |
|
706 |
if (rightCutPos != null) { |
|
707 |
model.setRightCutPosition(rightCutPos); |
|
708 |
} |
|
709 |
if ((shifts != null) && (shifts.length > 0)) { |
|
710 |
for (int i = 0; i < shifts.length; i++) { |
|
711 |
model.addShiftChange(shifts[i].position, shifts[i].shift); |
|
712 |
} |
|
713 |
setDirty(); |
|
714 |
} |
|
718 | 715 |
|
716 |
// Add pherogram area to GUI: |
|
717 |
pherogramArea.addMouseListener(new PherogramMouseListener(pherogramArea)); |
|
718 |
getReadsArea().getDataAreas().getSequenceAreas(id).add(pherogramArea); |
|
719 |
} |
|
720 |
} |
|
719 | 721 |
return id; |
720 | 722 |
} |
721 | 723 |
} |
Also available in: Unified diff
Fixed NPE when loading single reads without attached pherogram.