Belle II Software  release-08-01-10
InfoWidget Class Reference

text-based info viewer showing DataStore contents. More...

#include <InfoWidget.h>

Inheritance diagram for InfoWidget:
Collaboration diagram for InfoWidget:

Classes

struct  URI
 a parsed URI. More...
 

Public Member Functions

 InfoWidget (const TGWindow *p)
 ctor.
 
void update ()
 reset for new event (try to show same object if it exists).
 
void show (const char *uri="main:", bool clearSelection=true)
 Navigate to given URI. More...
 
void show (const TObject *obj)
 Navigate to page belonging to given object. More...
 
void back ()
 navigate to previous page, clearing current page from history.
 
virtual int IsVisited (const char *uri) override
 Used to colour visited links.
 

Private Member Functions

TString createMainPage () const
 create DataStore overview.
 
TString createArrayPage (const URI &uri) const
 create list of array contents.
 
TString createObjectPage (const URI &uri) const
 create object info.
 
TString getHeader (const URI &uri=URI()) const
 returns string with title, breadcrumbs, menu.
 
 ClassDefOverride (InfoWidget, 0)
 text-based info viewer showing DataStore contents.
 

Static Private Member Functions

static TString getContents (const TObject *obj)
 Get object contents (member data).
 
static TString getRelatedInfo (const TObject *obj)
 return HTML-formatted list of related objects.
 

Private Attributes

std::set< TString > m_visited
 list of all pages viewed in current event.
 
std::vector< TString > m_history
 ordered list of all pages viewed in current event.
 

Detailed Description

text-based info viewer showing DataStore contents.

Definition at line 27 of file InfoWidget.h.

Member Function Documentation

◆ show() [1/2]

void show ( const char *  uri = "main:",
bool  clearSelection = true 
)

Navigate to given URI.

Parameters
uriwhat to show, see InfoWidget::URI
clearSelectionwhen showing an object, this determines wether to clear an existing selection

Definition at line 93 of file InfoWidget.cc.

94 {
95  B2DEBUG(100, "Navigating to: " << uri);
96 
97  if (std::string(uri) == "back:") {
98  back();
99  return;
100  }
101 
102  m_visited.insert(uri);
103  m_history.push_back(uri);
104 
105  URI parsedURI = URI(uri);
106  TString info;
107  if (parsedURI.object) {
108  info = createObjectPage(parsedURI);
109 
110  //highlight in display
111  if (clearSelection)
113  VisualRepMap::getInstance()->select(parsedURI.object);
114  } else if (parsedURI.entryName != "") {
115  info = createArrayPage(parsedURI);
116  } else {
117  info = createMainPage();
118  }
119  info = "<html><body>" + info + "</body></html>";
120 
121  Clear();
122  //string only passed to function taking const char*...
123  ParseText(const_cast<char*>(info.Data()));
124  Layout();
125 }
void back()
navigate to previous page, clearing current page from history.
Definition: InfoWidget.cc:79
TString createObjectPage(const URI &uri) const
create object info.
Definition: InfoWidget.cc:198
std::set< TString > m_visited
list of all pages viewed in current event.
Definition: InfoWidget.h:93
std::vector< TString > m_history
ordered list of all pages viewed in current event.
Definition: InfoWidget.h:95
TString createArrayPage(const URI &uri) const
create list of array contents.
Definition: InfoWidget.cc:179
TString createMainPage() const
create DataStore overview.
Definition: InfoWidget.cc:127
void clearSelection() const
Clear existing selection in Eve Browser.
static VisualRepMap * getInstance()
get instance pointer.
Definition: VisualRepMap.cc:36
void select(const TObject *object) const
Select the representation of the given object.
Definition: VisualRepMap.cc:87

◆ show() [2/2]

void show ( const TObject *  obj)

Navigate to page belonging to given object.

Special in that it doesn't clear the current selection.

Definition at line 88 of file InfoWidget.cc.


The documentation for this class was generated from the following files: