void PairAlign::connectSignals() { connect(showHideSequenceWidget, SIGNAL(si_subgroupStateChanged(QString)), SLOT(sl_subwidgetStateChanged(QString))); connect(showHideSettingsWidget, SIGNAL(si_subgroupStateChanged(QString)), SLOT(sl_subwidgetStateChanged(QString))); connect(showHideOutputWidget, SIGNAL(si_subgroupStateChanged(QString)), SLOT(sl_subwidgetStateChanged(QString))); connect(algorithmListComboBox, SIGNAL(currentIndexChanged(QString)), SLOT(sl_algorithmSelected(QString))); connect(inNewWindowCheckBox, SIGNAL(clicked(bool)), SLOT(sl_inNewWindowCheckBoxChangeState(bool))); connect(alignButton, SIGNAL(clicked()), SLOT(sl_alignButtonPressed())); connect(outputFileSelectButton, SIGNAL(clicked()), SLOT(sl_checkState())); connect(outputFileLineEdit, SIGNAL(textChanged(QString)), SLOT(sl_outputFileChanged())); connect(firstSeqSelectorWC, SIGNAL(si_selectionChanged()), SLOT(sl_selectorTextChanged())); connect(secondSeqSelectorWC, SIGNAL(si_selectionChanged()), SLOT(sl_selectorTextChanged())); connect(msa->getMaObject(), SIGNAL(si_lockedStateChanged()), SLOT(sl_checkState())); connect(msa->getMaObject(), SIGNAL(si_alignmentChanged(const MultipleAlignment&, const MaModificationInfo&)), SLOT(sl_alignmentChanged())); }
void LRegionsSelection::clear() { QVector<U2Region> tmpRemoved = regions; regions.clear(); if (!tmpRemoved.isEmpty()) { emit si_selectionChanged(this, emptyLRegions, tmpRemoved); } }
void LRegionsSelection::removeRegion(const U2Region& r) { int idx = regions.indexOf(r); if (idx == -1) { return; } regions.remove(idx); QVector<U2Region> tmpRemoved; tmpRemoved.append(r); emit si_selectionChanged(this, emptyLRegions, tmpRemoved); }
void LRegionsSelection::addRegion(const U2Region& r) { assert(r.length > 0); if (regions.contains(r)) { return; } regions.append(r); QVector<U2Region> tmpAdded; tmpAdded.append(r); emit si_selectionChanged(this, tmpAdded, emptyLRegions); }
MSAOverview::MSAOverview(MSAEditorUI *_ui) : editor(_ui->getEditor()), ui(_ui), sequenceArea(_ui->getSequenceArea()) { connect(sequenceArea, SIGNAL(si_visibleRangeChanged()), this, SLOT(sl_visibleRangeChanged())); connect(sequenceArea, SIGNAL(si_selectionChanged(MSAEditorSelection,MSAEditorSelection)), SLOT(sl_selectionChanged())); connect(editor->getMSAObject(), SIGNAL(si_alignmentChanged(MAlignment,MAlignmentModInfo)), SLOT(sl_redraw())); }
McaEditorReferenceArea::McaEditorReferenceArea(McaEditorWgt *ui, SequenceObjectContext *ctx) : PanView(ui, ctx, McaEditorReferenceRenderAreaFactory(ui, NULL != ui ? ui->getEditor() : NULL)), editor(NULL != ui ? ui->getEditor() : NULL), ui(ui), renderer(dynamic_cast<McaReferenceAreaRenderer *>(getRenderArea()->getRenderer())) { SAFE_POINT(NULL != renderer, "Renderer is NULL", ); singleBaseSelection = true; setLocalToolbarVisible(false); settings->showMainRuler = false; scrollBar->hide(); rowBar->hide(); connect(ui->getEditor()->getMaObject(), SIGNAL(si_alignmentChanged(MultipleAlignment,MaModificationInfo)), SLOT(sl_update())); connect(ui->getScrollController(), SIGNAL(si_visibleAreaChanged()), SLOT(sl_visibleRangeChanged())); connect(ui->getSequenceArea(), SIGNAL(si_selectionChanged(MaEditorSelection,MaEditorSelection)), SLOT(sl_selectionChanged(MaEditorSelection,MaEditorSelection))); connect(ui, SIGNAL(si_clearSelection()), SLOT(sl_clearSelection())); connect(ui->getSequenceArea(), SIGNAL(si_clearReferenceSelection()), SLOT(sl_clearSelection())); connect(ctx->getSequenceSelection(), SIGNAL(si_selectionChanged(LRegionsSelection*, const QVector<U2Region>&, const QVector<U2Region>&)), SLOT(sl_onSelectionChanged(LRegionsSelection*, const QVector<U2Region>&, const QVector<U2Region>&))); connect(this, SIGNAL(si_selectionChanged()), ui->getSequenceArea(), SLOT(sl_backgroundSelectionChanged())); connect(editor, SIGNAL(si_fontChanged(const QFont &)), SLOT(sl_fontChanged(const QFont &))); connect(ui->getConsensusArea(), SIGNAL(si_mismatchRedrawRequired()), SLOT(completeUpdate())); connect(scrollBar, SIGNAL(valueChanged(int)), ui->getScrollController()->getHorizontalScrollBar(), SLOT(setValue(int))); sl_fontChanged(editor->getFont()); }
MaOverview::MaOverview(MaEditorWgt *ui) : QWidget(ui), editor(ui->getEditor()), ui(ui), sequenceArea(ui->getSequenceArea()), stepX(0), stepY(0) { connect(sequenceArea, SIGNAL(si_visibleRangeChanged()), this, SLOT(sl_visibleRangeChanged())); connect(sequenceArea, SIGNAL(si_selectionChanged(MaEditorSelection,MaEditorSelection)), SLOT(sl_selectionChanged())); connect(editor->getMaObject(), SIGNAL(si_alignmentChanged(MultipleAlignment,MaModificationInfo)), SLOT(sl_redraw())); connect(ui->getScrollController(), SIGNAL(si_visibleAreaChanged()), SLOT(sl_redraw())); connect(ui->getCollapseModel(), SIGNAL(si_toggled()), SLOT(sl_redraw())); }
QWidget* RefSeqCommonWidget::createReferenceGroup(){ QWidget *group = new QWidget(this); QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(5); layout->setAlignment(Qt::AlignTop); reSeqSelector = new SequenceSelectorWidgetController(msaEditor); connect(reSeqSelector, SIGNAL(si_selectionChanged()), SLOT(sl_textControllerChanged())); layout->addWidget(reSeqSelector); group->setLayout(layout); return group; }
McaEditorWgt::McaEditorWgt(McaEditor *editor) : MaEditorWgt(editor) { rowHeightController = new McaRowHeightController(this); refCharController = new McaReferenceCharController(this, editor); initActions(); initWidgets(); refArea = new McaEditorReferenceArea(this, getEditor()->getReferenceContext()); connect(refArea, SIGNAL(si_selectionChanged()), statusBar, SLOT(sl_update())); seqAreaHeaderLayout->insertWidget(0, refArea); MaEditorConsensusAreaSettings consSettings; consSettings.visibleElements = MSAEditorConsElement_CONSENSUS_TEXT | MSAEditorConsElement_RULER; consSettings.highlightMismatches = true; consArea->setDrawSettings(consSettings); MSAConsensusAlgorithmFactory* algoFactory = AppContext::getMSAConsensusAlgorithmRegistry()->getAlgorithmFactory(BuiltInConsensusAlgorithms::SIMPLE_EXTENDED_ALGO); consArea->setConsensusAlgorithm(algoFactory); QString name = getEditor()->getReferenceContext()->getSequenceObject()->getSequenceName(); QWidget *refName = createHeaderLabelWidget(tr("Reference %1:").arg(name), Qt::Alignment(Qt::AlignRight | Qt::AlignVCenter), refArea); refName->setObjectName("reference label container widget"); nameAreaLayout->insertWidget(0, refName); QVector<U2Region> itemRegions; for (int i = 0; i < editor->getNumSequences(); i++) { itemRegions << U2Region(i, 1); } collapseModel->setTrivialGroupsPolicy(MSACollapsibleItemModel::Allow); collapseModel->reset(itemRegions); collapseModel->collapseAll(false); collapseModel->setFakeCollapsibleModel(true); collapsibleMode = true; McaEditorConsensusArea* mcaConsArea = qobject_cast<McaEditorConsensusArea*>(consArea); SAFE_POINT(mcaConsArea != NULL, "Failed to cast consensus area to MCA consensus area", ); connect(mcaConsArea->getMismatchController(), SIGNAL(si_selectMismatch(int)), refArea, SLOT(sl_selectMismatch(int))); }
void McaEditorReferenceArea::sl_onSelectionChanged(LRegionsSelection * /*selection*/, const QVector<U2Region> &addedRegions, const QVector<U2Region> &removedRegions) { if (addedRegions.size() == 1) { const U2Region addedRegion = addedRegions.first(); qint64 baseToScrollTo = -1; if (removedRegions.size() == 1) { const U2Region removedRegion = removedRegions.first(); if (addedRegion.startPos < removedRegion.startPos && addedRegion.endPos() == removedRegion.endPos()) { baseToScrollTo = addedRegion.startPos; } else if (addedRegion.startPos == removedRegion.startPos && addedRegion.endPos() > removedRegion.endPos()) { baseToScrollTo = addedRegion.endPos() - 1; } else { baseToScrollTo = addedRegion.startPos; } } else { baseToScrollTo = addedRegion.startPos; } ui->getScrollController()->scrollToBase(static_cast<int>(baseToScrollTo), width()); } emit si_selectionChanged(); }
void LRegionsSelection::setSelectedRegions(const QVector<U2Region>& newSelection) { QVector<U2Region> tmpRemoved = regions; regions = newSelection; emit si_selectionChanged(this, newSelection, tmpRemoved); }