#include <BALL/VIEW/WIDGETS/fileObserver.h>
Public Slots | |
void | updateFile () |
Look for updates in the file. | |
void | start () |
Start the observation. | |
void | stop () |
Stop the observation. | |
void | chooseFile () |
Choose a file and start the observer. | |
Public Member Functions | |
FileObserver (QWidget *parent=0, const char *name=0) | |
virtual | ~FileObserver () |
virtual void | initializeWidget (MainControl &main_control) |
virtual void | checkMenu (MainControl &main_control) |
void | setFileName (String filename) |
Set the name of the molecular file to be observed. | |
String | getFileName () const |
void | setUpdateInterval (Size msec) |
Set the update interval in milli seconds. | |
Protected Attributes | |
QAction * | start_action_ |
QAction * | stop_action_ |
QTimer | timer_ |
String | file_name_ |
QDateTime | last_vis_time_ |
Class for observing changes in a molecular file. When the file changes, all current Systems are deleted and the new content of the observed molecular file is shown. Supported are all files from the MolecularFileDialog. A MolecularFileDialog must have been inserted into the MainControl.
Usage: (in from MainControl derived class)
FileObserver* fo = new FileObserver(this, "FileObserver"); fo->setFileName("foo.pdb"); fo->start();
Definition at line 34 of file fileObserver.h.
BALL::VIEW::FileObserver::FileObserver | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
virtual BALL::VIEW::FileObserver::~FileObserver | ( | ) | [virtual] |
virtual void BALL::VIEW::FileObserver::checkMenu | ( | MainControl & | main_control | ) | [virtual] |
Menu checking method. This method is called MainControl::checkMenus before a popup menu is shown. It should be used to update the state of menu entries (e.g. disable or enable entries).
main_control | the MainControl object whose menus should be checked |
Reimplemented from BALL::VIEW::ModularWidget.
void BALL::VIEW::FileObserver::chooseFile | ( | ) | [slot] |
Choose a file and start the observer.
String BALL::VIEW::FileObserver::getFileName | ( | ) | const |
virtual void BALL::VIEW::FileObserver::initializeWidget | ( | MainControl & | main_control | ) | [virtual] |
Initialize the widget.
Reimplemented from BALL::VIEW::DockWidget.
void BALL::VIEW::FileObserver::setFileName | ( | String | filename | ) |
Set the name of the molecular file to be observed.
void BALL::VIEW::FileObserver::setUpdateInterval | ( | Size | msec | ) |
Set the update interval in milli seconds.
void BALL::VIEW::FileObserver::start | ( | ) | [slot] |
Start the observation.
void BALL::VIEW::FileObserver::stop | ( | ) | [slot] |
Stop the observation.
void BALL::VIEW::FileObserver::updateFile | ( | ) | [slot] |
Look for updates in the file.
String BALL::VIEW::FileObserver::file_name_ [protected] |
Definition at line 83 of file fileObserver.h.
QDateTime BALL::VIEW::FileObserver::last_vis_time_ [protected] |
Definition at line 84 of file fileObserver.h.
QAction* BALL::VIEW::FileObserver::start_action_ [protected] |
Definition at line 80 of file fileObserver.h.
QAction * BALL::VIEW::FileObserver::stop_action_ [protected] |
Definition at line 80 of file fileObserver.h.
QTimer BALL::VIEW::FileObserver::timer_ [protected] |
Definition at line 82 of file fileObserver.h.