51 #include <wx/button.h>
52 #include <wx/statbox.h>
53 #include <wx/stattext.h>
90 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
110 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
111 wxFrame::Create( parent,
id, caption, pos,
size, style );
112 wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
113 if (attr.colBg != wxNullColour) {
114 SetOwnBackgroundColour(attr.colBg);
119 GetSizer()->SetSizeHints(
this);
159 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
160 itemDialog1->SetSizer(itemBoxSizer2);
163 itemBoxSizer2->Add(
m_Notebook, 1, wxGROW|wxALL, 5);
198 wxBoxSizer* itemBoxSizer12 =
new wxBoxSizer(wxHORIZONTAL);
199 itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
202 itemBoxSizer12->Add(
m_AcceptButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
205 wxButton* itemButton14 =
new wxButton( itemDialog1,
ID_CANCEL_BUTTON,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
206 itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
247 view.
Set(
"EnableDone", enable);
261 vector<CRef<CSeq_entry> > updated_entries;
272 updated_entries.push_back(saved);
282 for (
size_t i = 0;
i < updated_entries.size();
i++)
353 type->SetStr(
"TextViewParams");
359 label->SetStr(
"TextViewType");
361 param->
SetData().SetStr(
"Flat File");
362 data.push_back(param);
367 label->SetStr(
"ExpandAll");
369 param->
SetData().SetBool(
true);
370 data.push_back(param);
375 label->SetStr(
"TrackSelection");
377 param->
SetData().SetBool(
true);
378 data.push_back(param);
386 vector< vector<int> > &subsets =
GetSubsets();
390 if (!this->
m_TopSeqEntry || subsets.empty() || subsets.front().empty() || !prjSrv)
406 prjSrv->RemoveProjectView(*old_view);
412 for (
unsigned int s = 0; s < subsets.size(); s++)
414 for (
unsigned int j = 0; j < subsets[s].size(); j++)
416 int i = subsets[s][j];
420 selected_set.
insert(entry);
434 if ( selected_set.
find(entry) == selected_set.
end() )
504 if (unique_set.
find(bssh) == unique_set.
end())
506 set_vec.push_back(bssh);
515 vector<CBioseq_set_Handle> set_vec;
532 for (
long i = set_vec.size() - 1;
i >= 0;
i--)
540 vector<CBioseq_set_Handle> set_vec;
557 for (
int i = 0;
i < set_vec.size();
i++)
565 if (
set.IsEmptySeq_set())
574 if ((*it)->IsSetDescr())
585 master->
Set().push_back(cpy);
593 CSeq_descr::Tdata::iterator d = master->
Set().begin();
594 while (d != master->
Set().end())
599 if ((*d)->Equals(**s))
611 d = master->
Set().erase(d);
622 if (master->
IsSet() && !master->
Set().empty())
635 CBioseq::TDescr::Tdata::iterator di = bse.
SetDescr().Set().begin();
636 while (di != bse.
SetDescr().Set().end() && !(*di)->Equals(**d))
640 if (di != bse.
SetDescr().Set().end())
645 else if ((*it)->IsSet())
649 CBioseq_set::TDescr::Tdata::iterator di = bsse.
SetDescr().Set().begin();
650 while (di != bsse.
SetDescr().Set().end() && !(*di)->Equals(**d))
654 if (di != bsse.
SetDescr().Set().end())
688 pSeqDescrToCopy = pSeqDescrWithChosenDescs;
691 if (!pSeqDescrToCopy->
IsSet() || pSeqDescrToCopy->
Get().empty())
699 direct_child_ci->GetEditHandle().AddDescr(*
SerialClone(*pSeqDescrToCopy) );
706 CBioseq_set::TDescr::Tdata::iterator di = bsse.
SetDescr().Set().begin();
707 while (di != bsse.
SetDescr().Set().end() && !(*di)->Equals(**d))
711 if (di != bsse.
SetDescr().Set().end())
CBioseq_set_EditHandle –.
const CBioseq & GetNucFromNucProtSet(void) const
const CSeq_id * GetFirstId() const
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CProjectService - a service providing API for operations with Workspaces and Projects.
static bool ShouldStayInPlace(const objects::CSeqdesc &desc)
vector< vector< int > > & GetSubsets()
void SetSubsets(const set< objects::CBioseq_Handle > &selected)
void Set(const string &key, int val)
access a named key at this level, with no recursion
void ReadBioseq(const objects::CSeq_entry &se)
vector< SSetSeqRecord > m_SetSeq
objects::CSeq_entry_Handle m_TopSeqEntry
@Seq_descr.hpp User-defined methods of the data storage class.
@ fRecursive
Iterate recursively.
CSequesterSets()
Constructors.
vector< vector< int > > & GetSubsets()
void BioseqSetDescriptorPropagateUp(objects::CBioseq_set_Handle set)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Sequester Sets"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void RecursiveCollectSets(const objects::CBioseq_set_Handle &bssh, vector< objects::CBioseq_set_Handle > &set_vec, set< objects::CBioseq_set_Handle > &unique_set)
void OnAccept(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
void SetSubsets(const set< objects::CBioseq_Handle > &selected)
void EnableSmartPackageDone(bool enable)
CIRef< IProjectView > m_TextView
void BioseqSetDescriptorPropagateDown(const objects::CBioseq_set_Handle &bioseq_set_h)
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
wxButton * m_AcceptButton
void RecursivePropagateUp(void)
void RecursivePropagateDown(void)
virtual ~CSequesterSets()
Destructor.
static bool ShowToolTips()
Should we show tooltips?
wxButton * m_SequesterButton
CRef< objects::CUser_object > GetParams()
void OnSequester(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CConstRef< objects::CSeq_submit > m_SeqSubmit
CRef< objects::CSeq_entry > m_SavedEntry
class IProjectView defines the abstract interface for views observing projects.
IWorkbench is the central interface in the application framework.
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
C * SerialClone(const C &src)
Create on heap a clone of the source object.
void SetDescr(TDescr &v) const
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSet SelectSet(TClass set_class=CBioseq_set::eClass_not_set) const
Convert the empty Seq-entry to Bioseq-set.
void SetDescr(TDescr &v) const
void SelectNone(void) const
Make this Seq-entry to be empty.
bool AddSeqdesc(CSeqdesc &d) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSeq SelectSeq(CBioseq &seq) const
Make the empty Seq-entry be in seq state with specified Bioseq object.
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &d) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &d) const
CSeq_entry_EditHandle GetParentEntry(void) const
Get parent seq-entry edit handle.
bool HasParentEntry(void) const
Check if current seq-entry has a parent.
@ eNonRecursive
Deprecated.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
TData & SetData(void)
Assign a value to Data data member.
void SetLabel(TLabel &value)
Assign a value to Label data member.
void SetType(TType &value)
Assign a value to Type data member.
void SetData(TData &value)
Assign a value to Data data member.
vector< CRef< CUser_field > > TData
const TSeq & GetSeq(void) const
Get the variant data.
TSet & SetSet(void)
Select the variant.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
@ eClass_nuc_prot
nuc acid and coded proteins
@ eClass_genbank
converted genbank
list< CRef< CSeqdesc > > Tdata
const Tdata & Get(void) const
Get the member data.
bool IsSet(void) const
Check if a value has been assigned to data member.
Tdata & Set(void)
Assign a value to data member.
void Reset(void)
Reset data member.
@ e_not_set
No variant selected.
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define ID_SEQUESTER_BUTTON