Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::FileObserver Class Reference
[Modular Widgets]

Class for observing changes in a molecular file. More...

#include <fileObserver.h>

Inheritance diagram for VIEW::FileObserver:

VIEW::DockWidget VIEW::ModularWidget Embeddable 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) throw ()
virtual void initializeWidget (MainControl &main_control) throw ()
 Initialize the widget.
virtual void checkMenu (MainControl &main_control) throw ()
 Menu checking method.
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();


Member Function Documentation

virtual void VIEW::FileObserver::checkMenu MainControl main_control  )  throw () [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 VIEW::ModularWidget.

virtual void VIEW::FileObserver::initializeWidget MainControl main_control  )  throw () [virtual]
 

Initialize the widget.

See also:
ModularWidget::initializeWidget

Reimplemented from VIEW::DockWidget.