InfoVis 2013  1.0
Information Visualisation project - "Mapping Text with Phrase Nets"
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UIManager.h
Go to the documentation of this file.
1 #ifndef UI_MANAGER_H
2 #define UI_MANAGER_H
3 
4 
5 
6 #include <string>
7 #include <vector>
8 #include <map>
9 
10 namespace CEGUI
11 {
12  class Window;
13  class EventArgs;
14  class FrameWindow;
15  class Listbox;
16  class ToggleButton;
17  class Spinner;
18  class Editbox;
19  class WindowManager;
20  class OpenGLTexture;
21  class BasicImage;
22  class PushButton;
23 }
24 
25 class Application;
26 class CeguiHandler;
28 
29 /* The UIManager handles everything related to the CEGUI library, and the creation of text labels */
30 class UIManager
31 {
32 public:
33  UIManager(Application* application, CeguiHandler* ceguiHandler);
34  ~UIManager();
35 
36  void updateFpsCount(int fpsCount);
37 
38  CEGUI::Window* createNewGraphNodeWindow(const std::string& label, const float& normalisedSize);
39  void fitNodeGraphDisplayWindowToChildren(int& graphWindowWidth, int& graphWindowHeight);
40 
42 
44  void updateArrowBackgroundTexture(unsigned int textId, int texWidth, int texHeight);
45 
46  void setCurrentFileEditboxText(const std::string& fileName);
49 
50  RegexPhraseListboxItem* addConnectionWordToListbox(const std::string& text);
51 
52  void getCurrentlySelectedPhraseListboxConnectionWords(std::vector<std::string>& connectionWords);
53 
54  static const std::string m_labelFontNameBase;
55 
56 private:
57  void initGUI();
58 
59  void createGraphArrowTexture();
60 
61  void initGuiContext();
62 
63  void initFonts();
64 
65  void initGUIElements();
66  void initGUIElementsEditor();
67  void initGUIElementsApplicationArea();
68 
69  void createGraphDisplayWindow();
70 
71  void initGUIElementsMenubar();
72 
73  void initLayouts();
74 
75  void loadResources();
76 
77  bool handleItemQuitClicked(const CEGUI::EventArgs& args);
78  bool handleFileItemOpenClicked(const CEGUI::EventArgs& args);
79  bool handleGraphRedrawButtonClicked(const CEGUI::EventArgs& args);
80  bool handleRegexPhraseListboxItemSelectionChanged(const CEGUI::EventArgs& args);
81  bool handleRegexSubmitNewConnectorButtonClicked(const CEGUI::EventArgs& args);
82 
83  std::string getNormalisedSizeFontName(const float& normalisedSize);
84 
85 
86  CEGUI::WindowManager* m_windowManager;
87 
88  Application* m_application;
89  CeguiHandler* m_ceguiHandler;
90 
91  CEGUI::Window* m_rootWindow;
92  CEGUI::Window* m_editorLayoutRootWindow;
93 
94  CEGUI::Window* m_applicationArea;
95  CEGUI::Window* m_editorWindow;
96  CEGUI::Window* m_graphDisplayContainerWnd;
97  CEGUI::Window* m_graphDisplayArrowBGWnd;
98 
99  CEGUI::Window* m_fpsCounter;
100  CEGUI::Listbox* m_regexPhraseListbox;
101  CEGUI::Editbox* m_regexConnectionEditbox;
102  CEGUI::Spinner* m_filterTopResultSpinner;
103  CEGUI::ToggleButton* m_filterHideCommonResultsCB;
104 
105  CEGUI::PushButton* m_regexSubmitNewConnectionWordButton;
106 
107  CEGUI::Window* m_currentFileLabel;
108 
109  CEGUI::Window* m_graphRedrawButton;
110 
111  std::vector<CEGUI::Window*> m_graphNodeWindows;
112 
113  float m_fontMinSize;
114  float m_fontMaxSize;
115 
116  CEGUI::OpenGLTexture* m_graphArrowTex;
117  CEGUI::BasicImage* m_graphArrowImage;
118 
119  float m_graphDisplayWndMargin;
120 
121  std::map<std::string, RegexPhraseListboxItem*> m_alreadyAddedStopwords;
122 };
123 
124 #endif