Public Member Functions | Protected Member Functions | Protected Attributes

QmitkBaseComponent Class Reference

#include <QmitkBaseComponent.h>

Inheritance diagram for QmitkBaseComponent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 QmitkBaseComponent (QObject *parent=0, const char *name=0)
 Constructor.
virtual ~QmitkBaseComponent ()
 Destructor.
virtual QWidget * CreateControlWidget (QWidget *parent)
 Method to create the GUI for the component from the .ui-File. This Method is obligatory.
virtual void CreateConnections ()
 Method to create the connections for the component. This Method is obligatory even if no connections is needed.
virtual void TreeChanged ()
 The TreeChanged-slot-method if the component needs this information then reimplement.
void SetFunctionalityName (QString name)
 Method to set the Name of the Functionality.
virtual QWidget * GetGUIControls ()
virtual QString GetFunctionalityName ()
 method for defining the name of the functionality
virtual QGroupBox * GetContentContainer ()
virtual QGroupBox * GetMainCheckBoxContainer ()
virtual void SetContentContainerVisibility (bool)
 Method to set the "GetContentContainer"-visible or not, addicted to the visibility of a parent-component and the status of the checkable ComboBox from "GetMainCheckBoxContainer()".
virtual void Activated ()
 called when a functionality becomes active/visible. Often, event-handlers are connected (e.g., GlobalStateMachine::AddInteractor() or AddListener()) in Activated() and the connection is removed in Deactivated() (e.g., GlobalStateMachine::RemoveInteractor() or RemoveListener()).
virtual void Deactivated ()
 called when a functionality is Deactivated, i.e., is no longer active/visible. Often, event-handlers are connected (e.g., GlobalStateMachine::AddInteractor() or AddListener()) in Activated() and the connection is removed in Deactivated() (e.g., GlobalStateMachine::RemoveInteractor() or RemoveListener()).
virtual bool IsActivated ()
 Is the functionalityComponent currently active?
virtual bool IsAvailable ()
 Is the functionalityComponent currently available? Some components can only be available if other components are active. That can be checked here.

Protected Member Functions

virtual void SetAvailability (bool available)
 To set whether this component can be used or not. Thats why some components can only be used in connexion with other components.
QObject * GetParent ()
void AddComponentListener (QmitkBaseComponent *component)
void RemoveComponentListener (QmitkBaseComponent *component)

Protected Attributes

std::vector< QmitkBaseComponent * > m_AddedChildList
 Vector with all added components.
QString m_FuncName
 A Name of the FunctionalityComponent.
QObject * m_Parent
 The parent of the FunctionalityComponent.
QWidget * m_GUI

Detailed Description

Definition at line 51 of file QmitkBaseComponent.h.


Constructor & Destructor Documentation

QmitkBaseComponent::QmitkBaseComponent ( QObject *  parent = 0,
const char *  name = 0 
)

Constructor.

Definition at line 22 of file QmitkBaseComponent.cpp.

: QObject(parent),
m_FuncName(name),
m_Parent(parent)
{
}
QmitkBaseComponent::~QmitkBaseComponent (  ) [virtual]

Destructor.

Definition at line 30 of file QmitkBaseComponent.cpp.

{
}

Member Function Documentation

void QmitkBaseComponent::Activated (  ) [virtual]

called when a functionality becomes active/visible. Often, event-handlers are connected (e.g., GlobalStateMachine::AddInteractor() or AddListener()) in Activated() and the connection is removed in Deactivated() (e.g., GlobalStateMachine::RemoveInteractor() or RemoveListener()).

Reimplemented in QmitkFunctionalityComponentContainer, and QmitkThresholdComponent.

Definition at line 93 of file QmitkBaseComponent.cpp.

{
  m_Activated = true;
}
void QmitkBaseComponent::AddComponentListener ( QmitkBaseComponent component ) [protected]

Definition at line 123 of file QmitkBaseComponent.cpp.

References m_AddedChildList.

Referenced by QmitkFunctionalityComponentContainer::AddComponent().

{  
  if(component!=NULL)
  {
    m_AddedChildList.push_back(component);
  }
}
void QmitkBaseComponent::CreateConnections (  ) [virtual]

Method to create the connections for the component. This Method is obligatory even if no connections is needed.

Reimplemented in QmitkFunctionalityComponentContainer, and QmitkThresholdComponent.

Definition at line 35 of file QmitkBaseComponent.cpp.

{
}
QWidget * QmitkBaseComponent::CreateControlWidget ( QWidget *  parent ) [virtual]

Method to create the GUI for the component from the .ui-File. This Method is obligatory.

Definition at line 40 of file QmitkBaseComponent.cpp.

Referenced by QmitkFunctionalityComponentContainer::AddComponent().

{
  return (QWidget*) NULL;
}
void QmitkBaseComponent::Deactivated (  ) [virtual]

called when a functionality is Deactivated, i.e., is no longer active/visible. Often, event-handlers are connected (e.g., GlobalStateMachine::AddInteractor() or AddListener()) in Activated() and the connection is removed in Deactivated() (e.g., GlobalStateMachine::RemoveInteractor() or RemoveListener()).

Reimplemented in QmitkFunctionalityComponentContainer, and QmitkThresholdComponent.

Definition at line 99 of file QmitkBaseComponent.cpp.

{
  m_Activated = false;
}
QGroupBox * QmitkBaseComponent::GetContentContainer (  ) [virtual]

Reimplemented in QmitkFunctionalityComponentContainer, and QmitkThresholdComponent.

Definition at line 76 of file QmitkBaseComponent.cpp.

{
  return (QGroupBox*) NULL;
}
QString QmitkBaseComponent::GetFunctionalityName (  ) [virtual]

method for defining the name of the functionality

Definition at line 64 of file QmitkBaseComponent.cpp.

References m_FuncName.

{
  return m_FuncName;
}
QWidget * QmitkBaseComponent::GetGUIControls (  ) [virtual]

Definition at line 52 of file QmitkBaseComponent.cpp.

{
  return (QWidget*) NULL;
}
QGroupBox * QmitkBaseComponent::GetMainCheckBoxContainer (  ) [virtual]

Reimplemented in QmitkFunctionalityComponentContainer, and QmitkThresholdComponent.

Definition at line 82 of file QmitkBaseComponent.cpp.

{
  return (QGroupBox*) NULL;
}
QObject * QmitkBaseComponent::GetParent (  ) [protected]

Definition at line 70 of file QmitkBaseComponent.cpp.

References m_Parent.

{
  return m_Parent;
}
bool QmitkBaseComponent::IsActivated (  ) [virtual]

Is the functionalityComponent currently active?

Warning:
Will only work if in sub-classes the superclass-methods are called in Activated() and Deactivated()!

Definition at line 105 of file QmitkBaseComponent.cpp.

Referenced by QmitkFunctionalityComponentContainer::TreeChanged().

{
  return m_Activated;
}
bool QmitkBaseComponent::IsAvailable (  ) [virtual]

Is the functionalityComponent currently available? Some components can only be available if other components are active. That can be checked here.

Warning:
Will only work if in sub-classes the superclass-methods are called in Activated() and Deactivated()!

Definition at line 111 of file QmitkBaseComponent.cpp.

{
  return m_Available;
}
void QmitkBaseComponent::RemoveComponentListener ( QmitkBaseComponent component ) [protected]

Definition at line 132 of file QmitkBaseComponent.cpp.

References m_AddedChildList.

{  
  if(component!=NULL)
  {
    std::vector<QmitkBaseComponent*>::iterator it = m_AddedChildList.begin();   
    while (it != m_AddedChildList.end()) 
    {
      if(*it == component) 
      {
        m_AddedChildList.erase(it);
        break;
      }
      ++it; 
    }
  }
}
void QmitkBaseComponent::SetAvailability ( bool  available ) [protected, virtual]

To set whether this component can be used or not. Thats why some components can only be used in connexion with other components.

Definition at line 117 of file QmitkBaseComponent.cpp.

Referenced by QmitkFunctionalityComponentContainer::QmitkFunctionalityComponentContainer(), and QmitkThresholdComponent::QmitkThresholdComponent().

{
  this->m_Available = available;
}
void QmitkBaseComponent::SetContentContainerVisibility ( bool   ) [virtual]

Method to set the "GetContentContainer"-visible or not, addicted to the visibility of a parent-component and the status of the checkable ComboBox from "GetMainCheckBoxContainer()".

Reimplemented in QmitkFunctionalityComponentContainer.

Definition at line 88 of file QmitkBaseComponent.cpp.

{
}
void QmitkBaseComponent::SetFunctionalityName ( QString  name )

Method to set the Name of the Functionality.

Definition at line 58 of file QmitkBaseComponent.cpp.

References m_FuncName.

{
  m_FuncName = name;
}
void QmitkBaseComponent::TreeChanged (  ) [virtual]

The TreeChanged-slot-method if the component needs this information then reimplement.

Reimplemented in QmitkFunctionalityComponentContainer.

Definition at line 46 of file QmitkBaseComponent.cpp.

{
}

Member Data Documentation

QString QmitkBaseComponent::m_FuncName [protected]

A Name of the FunctionalityComponent.

Definition at line 163 of file QmitkBaseComponent.h.

Referenced by GetFunctionalityName(), and SetFunctionalityName().

QWidget* QmitkBaseComponent::m_GUI [protected]

Reimplemented in QmitkFunctionalityComponentContainer.

Definition at line 170 of file QmitkBaseComponent.h.

QObject* QmitkBaseComponent::m_Parent [protected]

The parent of the FunctionalityComponent.

Definition at line 168 of file QmitkBaseComponent.h.

Referenced by GetParent().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines