Open Ephys GUI
 All Classes Functions Variables Pages
VisualizerEditor.h
1 /*
2  ------------------------------------------------------------------
3 
4  This file is part of the Open Ephys GUI
5  Copyright (C) 2012 Open Ephys
6 
7  ------------------------------------------------------------------
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __VISUALIZEREDITOR_H_17E6D78C__
25 #define __VISUALIZEREDITOR_H_17E6D78C__
26 
27 #include "../../../JuceLibraryCode/JuceHeader.h"
28 #include "GenericEditor.h"
29 #include "../../UI/UIComponent.h"
30 #include "../../UI/DataViewport.h"
31 #include "../Visualization/DataWindow.h"
32 #include "../Visualization/Visualizer.h"
33 
34 /**
35 
36  Base class for creating editors with visualizers.
37 
38  @see GenericEditor, Visualizer
39 
40 */
41 
42 class DataWindow;
43 class Visualizer;
44 
45 class SelectorButton : public Button
46 {
47  public:
48  SelectorButton(const String& name);
49  ~SelectorButton();
50  private:
51  void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
52 };
53 
55 {
56 public:
60 
61  void buttonEvent (Button* button);
62  virtual void buttonCallback(Button* button) {}
63 
64  virtual Visualizer* createNewCanvas() = 0;
65 
66  virtual void enable();
67  virtual void disable();
68 
69  void editorWasClicked();
70 
71  void updateVisualizer();
72 
73  ScopedPointer<DataWindow> dataWindow;
74  ScopedPointer<Visualizer> canvas;
75 
76  String tabText;
77 
78 private:
79 
80  void initializeSelectors();
81  bool isPlaying;
82 
83  SelectorButton* windowSelector;
84  SelectorButton* tabSelector;
85 
86  int tabIndex;
87 
88 
89 
90  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VisualizerEditor);
91 
92 };
93 
94 
95 
96 #endif // __VISUALIZEREDITOR_H_17E6D78C__