Open Ephys GUI
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes
EditorViewport Class Reference

Allows the user to view and edit the signal chain. More...

#include <EditorViewport.h>

Inheritance diagram for EditorViewport:
AccessClass

List of all members.

Public Member Functions

 EditorViewport ()
 Constructor.
 ~EditorViewport ()
 Destructor.
void paint (Graphics &g)
 Draws the background of the EditorViewport.
void deleteNode (GenericEditor *editor)
 Removes the processor associated with a given editor.
void selectEditor (GenericEditor *editor)
 Removes the processor associated with a given editor.
void makeEditorVisible (GenericEditor *editor, bool highlight=true, bool updateSettings=false)
 Ensures that the user can see the requested editor.
void refreshEditors ()
 Updates the boundaries and visibility of all the editors in the signal chain.
void clearSignalChain ()
 Removes all processors from the signal chain(s).
void signalChainCanBeEdited (bool canEdit)
 Used to enable and disable drag-and-drop signal chain editing.
bool isInterestedInDragSource (const String &sourceDescription, Component *sourceComponent)
 
Determines whether or not the EditorViewport should respond to 

the component that is currently being dragged.

void itemDragEnter (const String &sourceDescription, Component *sourceComponent, int x, int y)
 Called when a dragged item (usually a name from the ProcessorList) enters the boundaries of the EditorViewport.
void itemDragMove (const String &sourceDescription, Component *sourceComponent, int x, int y)
 Called when a dragged item (usually a name from the ProcessorList) moves within the boundaries of the EditorViewport.
void itemDragExit (const String &sourceDescription, Component *sourceComponent)
 Called when a dragged item (usually a name from the ProcessorList) leaves the boundaries of the EditorViewport.
void itemDropped (const String &sourceDescription, Component *sourceComponent, int x, int y)
 Called when a dragged item (usually a name from the ProcessorList) is released within the boundaries of the EditorViewport.
void mouseDown (const MouseEvent &e)
 Called when a mouse click begins within the EditorViewport.
void mouseDrag (const MouseEvent &e)
 Called when a mouse drag occurs within the EditorViewport.
void mouseUp (const MouseEvent &e)
 Called when a mouse click ends within the EditorViewport.
void mouseExit (const MouseEvent &e)
 Called when the mouse leaves the boundaries of the EditorViewport.
bool keyPressed (const KeyPress &key)
 Called when a key is pressed an the EditorViewport has keyboard focus.
void moveSelection (const KeyPress &key)
 Changes which editor is selected, depending on the keypress (and modifier keys).
void buttonClicked (Button *button)
 Called when one of the buttons the EditorViewport listens to has been clicked.
Array< SignalChainTabButton
*, CriticalSection > 
requestSignalChain ()
 Returns an array of pointers to SignalChainTabButtons (which themselves hold pointers to the sources of each signal chain).
const String saveState ()
 Save the current configuration as an XML file.
const String loadState ()
 Load a saved configuration from an XML file.
XmlElement * createNodeXml (GenericEditor *, int)
 Converts information about a given editor to XML.
XmlElement * switchNodeXml (GenericProcessor *)
 Converts information about a splitter or merge to XML.
void checkScrollButtons (int topTab)
 Checks whether or not the signal chain scroll buttons need to be activated.
bool isSignalChainEmpty ()
 Returns a boolean indicating whether or not the signal chain is empty.
- Public Member Functions inherited from AccessClass
 AccessClass ()
 ~AccessClass ()
void setUIComponent (UIComponent *)
 Sets the object's UIComponent and copies all the necessary pointers from the UIComponent.
virtual void updateChildComponents ()
 Called within setUIComponent() to enable subclasses to update their members' pointers.
EditorViewportgetEditorViewport ()
 Returns a pointer to the application's EditorViewport.
DataViewportgetDataViewport ()
 Returns a pointer to the application's DataViewport.
ProcessorListgetProcessorList ()
 Returns a pointer to the application's ProcessorList.
ProcessorGraphgetProcessorGraph ()
 Returns a pointer to the application's ProcessorGraph.
ControlPanelgetControlPanel ()
 Returns a pointer to the application's DataViewport.
MessageCentergetMessageCenter ()
 Returns a pointer to the application's MessageCenter.
UIComponentgetUIComponent ()
 Returns a pointer to the application's UIComponent.
AudioComponentgetAudioComponent ()
 Returns a pointer to the application's AudioComponent.

Public Attributes

int leftmostEditor
 The index of the left-most editor (used for scrolling purposes).
File currentFile

Detailed Description

Allows the user to view and edit the signal chain.

The EditorViewport is one of the most important classes in the GUI application. Dragging processors from the ProcessorList into the EditorViewport adds them to the signal chain. The newly added processors appear an editors in the EditorViewport. Deleting the editor from the EditorViewport removes its associated processor from the signal chain. Moving an editor (by dragging and dropping within the EditorViewport) rearranges the order of processing.

The EditorViewport can be used to browse through multiple parallel signal chains (by clicking the buttons on the far left), or to navigate around branching signal chains.

See also:
UIComponent, ProcessorGraph, SignalChainManager

Constructor & Destructor Documentation

EditorViewport::EditorViewport ( )

Constructor.

Adds the buttons for browsing through the signal chains.

EditorViewport::~EditorViewport ( )

Destructor.


Member Function Documentation

void EditorViewport::paint ( Graphics &  g)

Draws the background of the EditorViewport.

void EditorViewport::deleteNode ( GenericEditor editor)

Removes the processor associated with a given editor.

void EditorViewport::selectEditor ( GenericEditor editor)

Removes the processor associated with a given editor.

void EditorViewport::makeEditorVisible ( GenericEditor editor,
bool  highlight = true,
bool  updateSettings = false 
)

Ensures that the user can see the requested editor.

void EditorViewport::refreshEditors ( )

Updates the boundaries and visibility of all the editors in the signal chain.

void EditorViewport::clearSignalChain ( )

Removes all processors from the signal chain(s).

void EditorViewport::signalChainCanBeEdited ( bool  canEdit)

Used to enable and disable drag-and-drop signal chain editing.

Called by the ProcessorGraph when data acquisition begins and ends.

bool EditorViewport::isInterestedInDragSource ( const String &  sourceDescription,
Component *  sourceComponent 
)

Determines whether or not the EditorViewport should respond to 

the component that is currently being dragged.

void EditorViewport::itemDragEnter ( const String &  sourceDescription,
Component *  sourceComponent,
int  x,
int  y 
)

Called when a dragged item (usually a name from the ProcessorList) enters the boundaries of the EditorViewport.

Causes the background of the EditorViewport to change color.

void EditorViewport::itemDragMove ( const String &  sourceDescription,
Component *  sourceComponent,
int  x,
int  y 
)

Called when a dragged item (usually a name from the ProcessorList) moves within the boundaries of the EditorViewport.

Causes existing editors (if any) to shift their position to make room for the new processor that could be dropped.

void EditorViewport::itemDragExit ( const String &  sourceDescription,
Component *  sourceComponent 
)

Called when a dragged item (usually a name from the ProcessorList) leaves the boundaries of the EditorViewport.

Causes the background of the EditorViewport to change color.

void EditorViewport::itemDropped ( const String &  sourceDescription,
Component *  sourceComponent,
int  x,
int  y 
)

Called when a dragged item (usually a name from the ProcessorList) is released within the boundaries of the EditorViewport.

Adds the dropped processor to the signal chain.

void EditorViewport::mouseDown ( const MouseEvent &  e)

Called when a mouse click begins within the EditorViewport.

Usually used to select editors.

void EditorViewport::mouseDrag ( const MouseEvent &  e)

Called when a mouse drag occurs within the EditorViewport.

Usually used to move editors around in the signal chain.

void EditorViewport::mouseUp ( const MouseEvent &  e)

Called when a mouse click ends within the EditorViewport.

Usually used to indicate that a moving editor has been dropped.

void EditorViewport::mouseExit ( const MouseEvent &  e)

Called when the mouse leaves the boundaries of the EditorViewport.

bool EditorViewport::keyPressed ( const KeyPress &  key)

Called when a key is pressed an the EditorViewport has keyboard focus.

void EditorViewport::moveSelection ( const KeyPress &  key)

Changes which editor is selected, depending on the keypress (and modifier keys).

void EditorViewport::buttonClicked ( Button *  button)

Called when one of the buttons the EditorViewport listens to has been clicked.

Array<SignalChainTabButton*, CriticalSection> EditorViewport::requestSignalChain ( )

Returns an array of pointers to SignalChainTabButtons (which themselves hold pointers to the sources of each signal chain).

const String EditorViewport::saveState ( )

Save the current configuration as an XML file.

const String EditorViewport::loadState ( )

Load a saved configuration from an XML file.

XmlElement* EditorViewport::createNodeXml ( GenericEditor ,
int   
)

Converts information about a given editor to XML.

XmlElement* EditorViewport::switchNodeXml ( GenericProcessor )

Converts information about a splitter or merge to XML.

void EditorViewport::checkScrollButtons ( int  topTab)

Checks whether or not the signal chain scroll buttons need to be activated.

bool EditorViewport::isSignalChainEmpty ( )

Returns a boolean indicating whether or not the signal chain is empty.


Member Data Documentation

int EditorViewport::leftmostEditor

The index of the left-most editor (used for scrolling purposes).

File EditorViewport::currentFile

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