NCBI C++ ToolKit
gui_object_info_seq_annot.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: gui_object_info_seq_annot.cpp 41372 2018-07-18 20:45:38Z rudnev $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
36 #include <gui/objutils/label.hpp>
37 #include <gui/objutils/tooltip.hpp>
38 
40 
43 
45 {
46 public:
48 
49  virtual string GetType() const { return "Annotation"; }
50  virtual string GetSubtype() const;
51  virtual string GetLabel() const;
52  virtual void GetToolTip(ITooltipFormatter& tooltip, string& t_title, TSeqPos at_p = (TSeqPos)-1, bool* isGeneratedBySvc = NULL) const;
53  virtual void GetLinks(ITooltipFormatter& /*links*/, bool /*no_ncbi_base*/) const {};
54  virtual string GetIcon() const;
55  virtual string GetViewCategory() const;
56 
57 private:
60 };
61 
63 {
65  typeid(IGuiObjectInfo).name(),
66  CSeq_annot::GetTypeInfo(),
68 }
69 
71  SConstScopedObject& object, ICreateParams* /*params*/)
72 {
74  gui_info->m_Object = object.object;
75  gui_info->m_Scope = object.scope;
76  return gui_info;
77 }
78 
80 {
81  const CSeq_annot& annot = dynamic_cast<const CSeq_annot&>(*m_Object);
82 
83  switch(annot.GetData().Which()) {
85  return "Alignments";
87  return "Features";
89  return "Graphs";
91  return "Locations";
93  return "Sequence IDs";
95  return "Table";
96  default:
97  break;
98  }
99  return "";
100 }
101 
103 {
104  const CSeq_annot& annot = dynamic_cast<const CSeq_annot&>(*m_Object);
105 
106  switch(annot.GetData().Which()) {
108  return "symbol::annotation_alignments";
110  return "symbol::annotation_features";
112  return "symbol::annotation_graphs";
114  return "symbol::locations";
116  return "symbol::annotation_sequence_ids";
117  default:
118  break;
119  }
120  return "symbol::annotation";
121 }
122 
123 
125 {
126  string label;
128  return label;
129 }
130 
131 void CGuiObjectInfoSeq_annot::GetToolTip(ITooltipFormatter& tooltip, string& /*t_title*/, TSeqPos /*at_p*/, bool* isGeneratedBySvc) const
132 {
133  if(isGeneratedBySvc) {
134  *isGeneratedBySvc = false;
135  }
136  string t_text;
138  tooltip.AddRow(t_text);
139 }
140 
142 {
143  const CSeq_annot& annot = dynamic_cast<const CSeq_annot&>(*m_Object);
144 
145  switch(annot.GetData().Which()) {
147  return "Alignment";
149  return "Features";
151  return "Generic";
153  return "Sequence";
155  return "Sequence";
157  return "Generic";
158  default:
159  break;
160  }
161  return "Generic";
162 }
163 
CRef< objects::CScope > m_Scope
virtual void GetLinks(ITooltipFormatter &, bool) const
Get a set of links.
virtual string GetSubtype() const
virtual void GetToolTip(ITooltipFormatter &tooltip, string &t_title, TSeqPos at_p=(TSeqPos) -1, bool *isGeneratedBySvc=NULL) const
Get tooltip.
virtual string GetViewCategory() const
To share default view between different types.
static CGuiObjectInfoSeq_annot * CreateObject(SConstScopedObject &object, ICreateParams *params)
static void RegisterFactory(const string &interface_name, IInterfaceFactory *factory)
CObject –.
Definition: ncbiobj.hpp:180
primitive interface to arrange tabular data in the tooltips
Definition: tooltip.hpp:55
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define NULL
Definition: ncbistd.hpp:225
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
Definition: label.cpp:140
virtual void AddRow(const string &sContents="", unsigned colspan=2)=0
add a row with a cell, spanning across all columns
@ eDescriptionBrief
Definition: label.hpp:67
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_annot_.hpp:873
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_annot_.hpp:586
@ e_Ids
used for communication between tools
Definition: Seq_annot_.hpp:136
@ e_Locs
used for communication between tools
Definition: Seq_annot_.hpp:137
USING_SCOPE(objects)
void initCGuiObjectInfoSeq_annot()
Modified on Sun Mar 03 03:14:58 2024 by modify_doxy.py rev. 669887