BALL::VIEW::FileObserver Class Reference
[Modular Widgets]

#include <BALL/VIEW/WIDGETS/fileObserver.h>

Inheritance diagram for BALL::VIEW::FileObserver:
BALL::VIEW::DockWidget QDockWidget BALL::VIEW::ModularWidget BALL::Embeddable BALL::VIEW::ConnectionObject

List of all members.


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_

Detailed Description

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();

Constructor & Destructor Documentation

BALL::VIEW::FileObserver::FileObserver ( QWidget parent = 0,
const char *  name = 0 
)
virtual BALL::VIEW::FileObserver::~FileObserver (  )  [virtual]

Member Function Documentation

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).

Parameters:
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.

See also:
ModularWidget::initializeWidget

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.


Member Data Documentation