34 #ifndef DISABLE_QT_LAYOUT_RENDERING
36 #endif //DISABLE_QT_LAYOUT_RENDERING
54 mpProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
58 mpTblLayouts->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
59 mpTblLayouts->verticalHeader()->hide();
71 this, SLOT(
dataChanged(
const QModelIndex&,
const QModelIndex&)));
72 connect(mpLEFilter, SIGNAL(textChanged(
const QString &)),
115 const QItemSelectionModel * pSelectionModel = mpTblLayouts->selectionModel();
117 QModelIndexList mappedSelRows;
120 for (i = 0; i < imax; i++)
122 if (pSelectionModel->isRowSelected((
int) i, QModelIndex()))
128 if (mappedSelRows.empty())
return;
131 QModelIndexList::const_iterator it = mappedSelRows.begin();
132 QModelIndexList::const_iterator end = mappedSelRows.end();
137 for (; it != end; ++it)
139 LayoutWindowMap::iterator itWindow =
mLayoutWindowMap.find((*pListOfLayouts)[it->row()]->getKey());
144 delete itWindow->second;
153 mpBtnDelete->setEnabled(mpTblLayouts->selectionModel()->selectedRows().size() > 0);
160 if (mpTblLayouts->selectionModel() != NULL)
162 disconnect(mpTblLayouts->selectionModel(), SIGNAL(selectionChanged(
const QItemSelection&,
const QItemSelection&)),
174 if (pDataModel != NULL &&
178 mpBtnNew->setEnabled(
true);
182 mpBtnNew->setEnabled(
false);
189 for (; it != end; ++it)
200 connect(mpTblLayouts->selectionModel(), SIGNAL(selectionChanged(
const QItemSelection&,
const QItemSelection&)),
212 for (i = 0; i < imax; ++i)
221 for (
size_t i = 0; i < layouts.
size(); ++i)
223 const CLayout *layout = layouts[i];
238 assert(pModel != NULL);
240 std::string name =
"COPASI autolayout";
245 std::stringstream str;
246 str <<
"COPASI autolayout " << ncount++;
252 if (pWizard.exec() != QDialog::Accepted)
256 std::map<std::string, std::string> m;
279 #ifndef DISABLE_QT_LAYOUT_RENDERING
289 #endif //DISABLE_QT_LAYOUT_RENDERING
293 pWin->updateRenderer();
299 pWin->slotRunSpringLayout();
311 if (mpTblLayouts->hasFocus())
319 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
321 if (ret == QMessageBox::Yes)
330 const QItemSelection & )
338 QModelIndex index =
mpProxyModel->mapToSource(proxyIndex);
340 int row = index.row();
349 const QModelIndex & )
351 mpTblLayouts->resizeColumnsToContents();
359 QRegExp regExp(mpLEFilter->text(), Qt::CaseInsensitive, QRegExp::RegExp);
369 if (pLayout == NULL || row < 0)
return NULL;
373 #ifndef DISABLE_QT_LAYOUT_RENDERING
388 #endif //DISABLE_QT_LAYOUT_RENDERING
390 std::string title =
"COPASI Diagram: " + pLayout->
getObjectName();
391 pWin->setWindowTitle(title.c_str());
393 pWin->resize(900, 600);
401 int row = index.row();
406 CLayout* pLayout = (* pListOfLayouts)[row];
407 std::string Key = pLayout->
getKey();
419 pLayoutWindow = pos->second;
422 if (pLayoutWindow == NULL)
430 if (pLayoutWindow != NULL)
440 pLayoutWindow->show();
441 pLayoutWindow->showNormal();
442 pLayoutWindow->activateWindow();
void slotAutoLayout()
Slots the auto layout.
bool removeRows(QModelIndexList rows, const QModelIndex &index=QModelIndex())
void slotLayoutChanged(int index)
const std::string & getObjectName() const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
virtual size_t size() const
void setMode(DISPLAY_MODE mode=GRAPH_MODE)
const std::set< const CMetab * > & getSideMetabolites() const
virtual bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex())
const std::set< const CReaction * > & getSelectedReactions() const
static CConfigurationFile * getConfiguration()
std::vector< CType * >::const_iterator const_iterator
const std::set< const CMetab * > & getSelectedMetabolites() const
static CLayout * createLayout(CCopasiContainer *parent, const std::set< const CCompartment * > &compartments, const std::set< const CReaction * > &reactions, const std::set< const CMetab * > &metabs, const std::set< const CMetab * > &sideMetabs, Parameters *mParams=NULL)
static const QIcon & icon(const IconID &id)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CListOfLayouts * getListOfLayouts()
virtual const std::string & getKey() const
void addLayout(CLayout *layout, const std::map< std::string, std::string > &m)
CCopasiVectorNS< CCompartment > & getCompartments()
void setListOfLayouts(CListOfLayouts *pListOfLayouts)
void addToMainWindow(CopasiUI3Window *window=NULL)
bool setObjectName(const std::string &name)
const std::set< const CCompartment * > & getSelectedCompartments() const
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)