blast_poll_table.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:5k
- /*
- * ===========================================================================
- * PRODUCTION $Log: blast_poll_table.hpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 20:54:17 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.7
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_ALGO_PLUGINS_ALIGN___BLAST_POLL_TABLE__HPP
- #define GUI_ALGO_PLUGINS_ALIGN___BLAST_POLL_TABLE__HPP
- /* $Id: blast_poll_table.hpp,v 1000.1 2004/06/01 20:54:17 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- *
- */
- #include <gui/widgets/fl/table_panel.hpp>
- #include <gui/core/idocument.hpp>
- #include <corelib/ncbitime.hpp>
- #include <gui/utils/fltk_utils.hpp>
- #include <gui/objutils/iselection.hpp>
- #include <gui/utils/command.hpp>
- #include <objects/seq/Seq_annot.hpp>
- #include <objects/seqloc/Seq_loc.hpp>
- #include <objects/seqalign/Seq_align_set.hpp>
- BEGIN_NCBI_SCOPE
- class CBlastPollItem : public CObject
- {
- public:
- CBlastPollItem()
- : m_Active(true),
- m_Errors(false) {}
- // RID we poll for
- string m_Rid;
- // Description of request
- string m_Descr;
- // polling status
- string m_Status;
- // flag: are we active?
- bool m_Active;
- // flag: were there errors on polling?
- bool m_Errors;
- // submit time
- CTime m_SubmitTime;
- // last poll time
- CTime m_LastPollTime;
- // Pointer to document of sequence to which m_Rid applies
- CConstRef<IDocument> m_Document;
- // Query Seq-loc to which m_Rid applies
- CConstRef<objects::CSeq_loc> m_QueryLoc;
- // results pulled from the BLAST server, for future reference
- CRef<objects::CSeq_annot> m_Results;
- };
- class CBlastPollTable : public CTablePanel< CRef<CBlastPollItem> >,
- public ISelection,
- public CCommandTarget
- {
- public:
- enum EColumnType {
- eRid,
- eLocation,
- eStatus,
- eSubmit,
- eLastPoll
- };
- CBlastPollTable(int x, int y, int w, int h, const char* label = NULL);
- // add an item to the table
- void AddItem(CBlastPollItem& item);
- // remove an item from the table
- void RemoveItem(size_t row);
- // remove all selected items
- void RemoveSelected();
- // update an item in the table
- void UpdateItem(size_t row, CBlastPollItem& item);
- // deactivate an item
- void DeactivateItem(size_t row);
- // activate an item
- void ActivateItem(size_t row);
- // move an item up or down in the list
- void MoveUp(size_t item);
- // move an item up or down in the list
- void MoveDown(size_t item);
- // check to see if a given RID is in the queue already
- bool HasRid(const string& rid) const;
- void GetSelections(TConstScopedObjects& objs) const;
- void SetSelections(const TConstScopedObjects& objs);
- // command map fo CCommandTarget
- DECLARE_CMD_MAP();
- // functions pinged by our popup menu
- void OnNewDocument();
- void OnSaveAs();
- // FLTK override: handle FLTK events
- int handle(int event);
- // show our popup menu
- void OnShowPopup();
- private:
- void x_UpdateItem(size_t idx);
- // overloaded copy handler
- int x_OnCopy();
- };
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: blast_poll_table.hpp,v $
- * Revision 1000.1 2004/06/01 20:54:17 gouriano
- * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.7
- *
- * Revision 1.7 2004/05/03 13:05:42 dicuccio
- * gui/utils --> gui/objutils where needed
- *
- * Revision 1.6 2004/04/23 21:02:52 ucko
- * +<Seq_annot.hpp>, since some compilers insist on seeing the full header
- * before any relevant CRefs.
- *
- * Revision 1.5 2004/04/22 13:07:23 dicuccio
- * Formatting changes
- *
- * Revision 1.4 2004/04/22 12:22:08 dicuccio
- * Added BLAST RID caching. Added better formatting for BLAST results
- *
- * Revision 1.3 2004/04/07 12:52:48 dicuccio
- * m_document -> m_Document. Added CSeq_align_set member CRef<> to store results
- *
- * Revision 1.2 2004/03/24 12:36:05 dicuccio
- * Added include for CSeq_loc
- *
- * Revision 1.1 2004/03/05 17:30:34 dicuccio
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_ALGO_PLUGINS_ALIGN___BLAST_POLL_TABLE__HPP