Loading...
Searching...
No Matches
BALL::VIEW::FileObserver Class Reference
Visualisation » Modular Widgets

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

Inheritance diagram for BALL::VIEW::FileObserver:

## 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 Slots inherited from BALL::VIEW::DockWidget
virtual void | dropEvent (QDropEvent *e)
virtual void | dragEnterEvent (QDragEnterEvent *e)
virtual void | showGuestContextMenu (const QPoint &)

## 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.
Public Member Functions inherited from BALL::VIEW::DockWidget
| DockWidget (QWidget *parent, const char *title=0)
| Use this constructor!
virtual | ~DockWidget ()
void | setGuest (QWidget &guest)
virtual void | fetchPreferences (INIFile &inifile)
virtual void | writePreferences (INIFile &inifile)
virtual void | setWidgetVisible (bool state)
| For usage with Python:
QGridLayout * | getGuestLayout ()
Public Member Functions inherited from BALL::VIEW::ModularWidget
| ModularWidget (const char *name="<ModularWidget>")
| ModularWidget (const ModularWidget &widget)
virtual | ~ModularWidget ()
virtual void | destroy ()
virtual void | clear ()
QAction * | insertMenuEntry (Position parent_id, const QString &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence(), const QString &menu_hint=QString(""), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
BALL_DEPRECATED void | setMenuHelp (QAction *, const String &)
virtual BALL_DEPRECATED void | registerForHelpSystem (const QObject *, const String &)
virtual void | addToolBarEntries (QToolBar *main_tb)
void | setIcon (QAction *action, const String &filename, bool add_to_main_toolbar=true)
virtual void | initializePreferencesTab (Preferences &preferences)
virtual void | finalizePreferencesTab (Preferences &preferences)
virtual void | applyPreferences ()
bool | lockComposites ()
bool | unlockComposites ()
| Unlock the Composites.
MainControl * | getMainControl () const
virtual void | setStatusbarText (const String &text, bool important=false)
virtual void | setStatusbarText (const QString &text, bool important=false)
String | getWorkingDir ()
| Implemented for convenience.
void | setWorkingDir (const String &dir)
| Implemented for convenience.
FragmentDB & | getFragmentDB () const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
void | setWorkingDirFromFilename_ (String filename)
virtual BALL_DEPRECATED void | showHelp (const String &)
virtual void | finalizeWidget (MainControl &main_control)
virtual bool | canHandle (const String &) const
virtual bool | openFile (const String &)
Public Member Functions inherited from BALL::Embeddable
| Embeddable (const String &identifier="<Embeddable>")
| Embeddable (const Embeddable &embeddable)
virtual | ~Embeddable ()
void | setIdentifier (const String &identifier)
const String & | getIdentifier () const
void | unregisterThis ()
virtual void | registerThis ()
Public Member Functions inherited from BALL::VIEW::ConnectionObject
| ConnectionObject ()
virtual | ~ConnectionObject ()
void | registerConnectionObject (ConnectionObject &object)
void | unregisterConnectionObject (ConnectionObject &object)
bool | isConnectionObjectRegistered (const ConnectionObject &object)
ConnectionObject * | getParent () const
ConnectionObject * | getRoot ()
virtual void | onNotify (Message *message)
virtual bool | isValid () const

## Protected Attributes

QAction * | start_action_
QAction * | stop_action_
QTimer | timer_
String | file_name_
QDateTime | last_vis_time_
Protected Attributes inherited from BALL::VIEW::DockWidget
QWidget * | container_
QWidget * | guest_
QGridLayout * | layout_
QAction * | window_menu_entry_
bool | show_window_enty_
bool | default_visible_
QList< QAction * > | main_toolbar_actions_

## Additional Inherited Members

Public Types inherited from BALL::Embeddable
typedef std::vector< Embeddable * > | EmbeddableVector
static void | registerWidget (ModularWidget *mwidget)
Protected Member Functions inherited from BALL::VIEW::DockWidget
| DockWidget ()
| DockWidget (const DockWidget &)
void | notify_ (Message *message)
void | notify_ (Message &message)
void | onNotify_ (Message *message)
static void | registerInstance_ (const std::type_info &type, const Embeddable *instance)
static void | unregisterInstance_ (const Embeddable *instance)
static Size | countInstances_ (const std::type_info &type)
static Embeddable * | getInstance_ (const std::type_info &type, Position index)
static Embeddable * | getInstance_ (const std::type_info &type, const String &identifier)

## 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();
BALL::VIEW::FileObserver::FileObserver
FileObserver(QWidget *parent=0, const char *name=0)
BALL::VIEW::FileObserver::start
void start()
Start the observation.
BALL::VIEW::FileObserver::setFileName
void setFileName(String filename)
Set the name of the molecular file to be observed.

Definition at line 34 of file fileObserver.h.

## Constructor & Destructor Documentation

## FileObserver()

BALL::VIEW::FileObserver::FileObserver | ( | QWidget * | parent = 0,
|  | const char * | name = 0 )

## ~FileObserver()

virtual BALL::VIEW::FileObserver::~FileObserver | ( |  | ) |

virtual

## Member Function Documentation

## checkMenu()

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.

## chooseFile

void BALL::VIEW::FileObserver::chooseFile | ( |  | ) |

slot

Choose a file and start the observer.

## getFileName()

String BALL::VIEW::FileObserver::getFileName | ( |  | ) | const

## initializeWidget()

virtual void BALL::VIEW::FileObserver::initializeWidget | ( | MainControl & | main_control | ) |

virtual

Initialize the widget.

See also
  ModularWidget::initializeWidget

Reimplemented from BALL::VIEW::DockWidget.

## setFileName()

void BALL::VIEW::FileObserver::setFileName | ( | String | filename | ) |

Set the name of the molecular file to be observed.

## setUpdateInterval()

void BALL::VIEW::FileObserver::setUpdateInterval | ( | Size | msec | ) |

Set the update interval in milli seconds.

## start

void BALL::VIEW::FileObserver::start | ( |  | ) |

slot

Start the observation.

## stop

void BALL::VIEW::FileObserver::stop | ( |  | ) |

slot

Stop the observation.

## updateFile

void BALL::VIEW::FileObserver::updateFile | ( |  | ) |

slot

Look for updates in the file.

## Member Data Documentation

## file_name_

String BALL::VIEW::FileObserver::file_name_

protected

Definition at line 83 of file fileObserver.h.

## last_vis_time_

QDateTime BALL::VIEW::FileObserver::last_vis_time_

protected

Definition at line 84 of file fileObserver.h.

## start_action_

QAction* BALL::VIEW::FileObserver::start_action_

protected

Definition at line 80 of file fileObserver.h.

## stop_action_

QAction * BALL::VIEW::FileObserver::stop_action_

protected

Definition at line 80 of file fileObserver.h.

## timer_

QTimer BALL::VIEW::FileObserver::timer_

protected

Definition at line 82 of file fileObserver.h.