示例#1
0
 void PartClosed(berry::IWorkbenchPartReference::Pointer partRef)
 {
   if((partRef->GetId() == QmitkImageNavigatorView::VIEW_ID) || (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID))
   {
     m_View->SetMultiWidget(0);
   }
 }
void QmitkFunctionalityCoordinator::PartClosed( berry::IWorkbenchPartReference::Pointer partRef )
{
  // check for multiwidget and inform views that it not available any more
  if ( partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID )
  {

    QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();
    for (std::set<QmitkFunctionality*>::iterator it = m_Functionalities.begin()
      ; it != m_Functionalities.end(); it++)
    {
      (*it)->StdMultiWidgetClosed(*(stdMultiWidgetEditor->GetStdMultiWidget()));
      (*it)->StdMultiWidgetNotAvailable(); // deprecated call, provided for consistence
    }
  }
  else
  {
    // check for functionality
    QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
    if(_QmitkFunctionality.IsNotNull())
    {
      // deactivate on close ( the standalone functionality may still be activated  )
      this->DeactivateStandaloneFunctionality(partRef.GetPointer(), 0);

      // and set pointer to 0
      if(m_StandaloneFuntionality == partRef.GetPointer())
        m_StandaloneFuntionality = 0;

      m_Functionalities.erase(_QmitkFunctionality.GetPointer()); // remove as opened functionality

      // call PartClosed on the QmitkFunctionality
      _QmitkFunctionality->ClosePartProxy();
      //m_VisibleStandaloneFunctionalities.erase(_QmitkFunctionality.GetPointer()); // remove if necessary (should be done before in PartHidden()
    }
  }
}
示例#3
0
 void PerspectiveChanged(const berry::IWorkbenchPage::Pointer&,
                         const berry::IPerspectiveDescriptor::Pointer&,
                         const berry::IWorkbenchPartReference::Pointer& partRef, const std::string& changeId)
 {
     if (changeId=="viewHide" && partRef->GetId()=="org.mitk.views.viewnavigatorview")
         berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->RemovePerspectiveListener(parentWidget->m_PerspectiveListener.data());
     else
         parentWidget->UpdateTreeList(nullptr, partRef.GetPointer(), changeId);
 }
  void PartVisible(const berry::IWorkbenchPartReference::Pointer& partRef) override
  {
    if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
    {
      QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();

      if (d->m_StdMultiWidget == stdMultiWidgetEditor->GetStdMultiWidget())
      {
        d->m_StdMultiWidget->AddPlanesToDataStorage();
        stdMultiWidgetEditor->RequestActivateMenuWidget(true);
      }
    }
  }
  void PartHidden(const berry::IWorkbenchPartReference::Pointer& partRef)
  {
    if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
    {
      QmitkStdMultiWidgetEditor::Pointer stdMultiWidgetEditor = partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>();

      if (d->m_StdMultiWidget == stdMultiWidgetEditor->GetStdMultiWidget())
      {
        d->m_StdMultiWidget->RemovePlanesFromDataStorage();
        stdMultiWidgetEditor->RequestActivateMenuWidget(false);
      }
    }
  }
示例#6
0
 void PartOpened(berry::IWorkbenchPartReference::Pointer partRef)
 {
   if (partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID)
   {
     if (QmitkStdMultiWidgetEditor::Pointer multiWidgetPart =
         partRef->GetPart(false).Cast<QmitkStdMultiWidgetEditor>())
     {
       m_View->SetMultiWidget(multiWidgetPart->GetStdMultiWidget());
     }
     else
     {
       m_View->SetMultiWidget(0);
     }
   }
 }
 void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override
 {
   if (ref->GetId()=="org.mitk.views.imagenavigator")
   {
     imageNavigatorAction->setChecked(true);
   }
 }
 void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override
 {
   if (ref->GetId()=="org.mitk.views.viewnavigatorview")
   {
     viewNavigatorAction->setChecked(false);
   }
 }
示例#9
0
void QmitkViewCoordinator::PartActivated( berry::IWorkbenchPartReference::Pointer partRef )
{
  //MITK_INFO << "*** PartActivated (" << partRef->GetPart(false)->GetPartName() << ")";
  berry::IWorkbenchPart* part = partRef->GetPart(false).GetPointer();

  // Check for a render window part and inform IRenderWindowPartListener views
  // that it was activated
  if ( mitk::IRenderWindowPart* renderPart = dynamic_cast<mitk::IRenderWindowPart*>(part) )
  {
    if (m_VisibleRenderWindowPart != renderPart)
    {
      RenderWindowPartActivated(renderPart);
      m_ActiveRenderWindowPart = renderPart;
      m_VisibleRenderWindowPart = renderPart;
    }
  }

  // Check if the activated part wants to be notified
  if (mitk::ILifecycleAwarePart* lifecycleAwarePart = dynamic_cast<mitk::ILifecycleAwarePart*>(part))
  {
    lifecycleAwarePart->Activated();
  }

  // Check if a zombie view has been activated.
  if (mitk::IZombieViewPart* zombieView = dynamic_cast<mitk::IZombieViewPart*>(part))
  {
    if (m_ActiveZombieView && (m_ActiveZombieView != zombieView))
    {
      // Another zombie view has been activated. Tell the old one about it.
      m_ActiveZombieView->ActivatedZombieView(partRef);
      m_ActiveZombieView = zombieView;
    }
  }
}
示例#10
0
 void PartHidden(berry::IWorkbenchPartReference::Pointer ref)
 {
  if (ref->GetId()=="org.mitk.views.imagenavigator")
  {
   imageNavigatorAction->setChecked(false);
  }
 }
void QmitkFunctionalityCoordinator::PartActivated( berry::IWorkbenchPartReference::Pointer partRef )
{
  // Check for QmitkFunctionality
  QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
  // change the active standalone functionality
  this->ActivateStandaloneFunctionality(_QmitkFunctionality.GetPointer());
}
示例#12
0
 void PartVisible(berry::IWorkbenchPartReference::Pointer ref)
 {
  if (!windowAdvisor->lastActiveEditor.Expired() &&
   ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock())
  {
   windowAdvisor->UpdateTitle(false);
  }
 }
void QmitkFunctionalityCoordinator::PartHidden( berry::IWorkbenchPartReference::Pointer partRef )
{
  // Check for QmitkFunctionality
  QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
  if(_QmitkFunctionality != 0)
  {
    _QmitkFunctionality->SetVisible(false);
    _QmitkFunctionality->Hidden();

    // tracking of Visible Standalone Functionalities
    m_VisibleStandaloneFunctionalities.erase(partRef.GetPointer());

    // activate Functionality if just one Standalone Functionality is visible
    if( m_VisibleStandaloneFunctionalities.size() == 1 )
      this->ActivateStandaloneFunctionality( *m_VisibleStandaloneFunctionalities.begin() );
  }
}
 void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override
 {
   if (!windowAdvisor->lastActiveEditor.Expired() &&
     ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock())
   {
     windowAdvisor->UpdateTitle(true);
   }
 }
示例#15
0
void QmitkViewCoordinator::PartDeactivated( berry::IWorkbenchPartReference::Pointer partRef )
{
  //MITK_INFO << "*** PartDeactivated (" << partRef->GetPart(false)->GetPartName() << ")";
  berry::IWorkbenchPart* part = partRef->GetPart(false).GetPointer();

  if (mitk::ILifecycleAwarePart* lifecycleAwarePart = dynamic_cast<mitk::ILifecycleAwarePart*>(part))
  {
    lifecycleAwarePart->Deactivated();
  }
}
示例#16
0
void QmitkViewCoordinator::PartClosed( berry::IWorkbenchPartReference::Pointer partRef )
{
  //MITK_INFO << "*** PartClosed (" << partRef->GetPart(false)->GetPartName() << ")";
  berry::IWorkbenchPart* part = partRef->GetPart(false).GetPointer();

  if (mitk::IRenderWindowPartListener* renderWindowListener = dynamic_cast<mitk::IRenderWindowPartListener*>(part))
  {
    m_RenderWindowListeners.remove(renderWindowListener);
  }
}
void QmitkFunctionalityCoordinator::PartVisible( berry::IWorkbenchPartReference::Pointer partRef )
{
  // Check for QmitkFunctionality
  QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
  if(_QmitkFunctionality.IsNotNull())
  {
    _QmitkFunctionality->SetVisible(true);
    _QmitkFunctionality->Visible();

    // tracking of Visible Standalone Functionalities
    if( _QmitkFunctionality->IsExclusiveFunctionality() )
    {
      m_VisibleStandaloneFunctionalities.insert(partRef.GetPointer());

      // activate Functionality if just one Standalone Functionality is visible
      if( m_VisibleStandaloneFunctionalities.size() == 1 )
        this->ActivateStandaloneFunctionality( *m_VisibleStandaloneFunctionalities.begin() );
    }
  }
}
void QmitkFunctionalityCoordinator::PartOpened( berry::IWorkbenchPartReference::Pointer partRef )
{
   // check for multiwidget and inform views that it is available now
  if ( partRef->GetId() == QmitkStdMultiWidgetEditor::EDITOR_ID )
  {
    for (std::set<QmitkFunctionality*>::iterator it = m_Functionalities.begin()
      ; it != m_Functionalities.end(); it++)
    {
      (*it)->StdMultiWidgetAvailable(*(partRef
        ->GetPart(false).Cast<QmitkStdMultiWidgetEditor>()->GetStdMultiWidget()));
    }
  }
  else
  {
    // Check for QmitkFunctionality
    QmitkFunctionality::Pointer _QmitkFunctionality = partRef->GetPart(false).Cast<QmitkFunctionality>();
    if(_QmitkFunctionality.IsNotNull())
    {
      m_Functionalities.insert(_QmitkFunctionality.GetPointer()); // save as opened functionality
    }
  }
}
示例#19
0
void QmitkViewCoordinator::PartHidden( berry::IWorkbenchPartReference::Pointer partRef )
{
  //MITK_INFO << "*** PartHidden (" << partRef->GetPart(false)->GetPartName() << ")";
  berry::IWorkbenchPart* part = partRef->GetPart(false).GetPointer();

  // Check for a render window part and if it is the currently active on.
  // Inform IRenderWindowPartListener views that it has been hidden.
  if ( mitk::IRenderWindowPart* renderPart = dynamic_cast<mitk::IRenderWindowPart*>(part) )
  {
    if (!m_ActiveRenderWindowPart && m_VisibleRenderWindowPart == renderPart)
    {
      RenderWindowPartDeactivated(renderPart);
      m_VisibleRenderWindowPart = 0;
    }
  }

  if (mitk::ILifecycleAwarePart* lifecycleAwarePart = dynamic_cast<mitk::ILifecycleAwarePart*>(part))
  {
    lifecycleAwarePart->Hidden();
  }
}
示例#20
0
void QmitkViewCoordinator::PartVisible( berry::IWorkbenchPartReference::Pointer partRef )
{
  //MITK_INFO << "*** PartVisible (" << partRef->GetPart(false)->GetPartName() << ")";
  berry::IWorkbenchPart* part = partRef->GetPart(false).GetPointer();

  // Check for a render window part and inform IRenderWindowPartListener views
  // that it was activated
  if ( mitk::IRenderWindowPart* renderPart = dynamic_cast<mitk::IRenderWindowPart*>(part) )
  {
    if (!m_ActiveRenderWindowPart)
    {
      RenderWindowPartActivated(renderPart);
      m_VisibleRenderWindowPart = renderPart;
    }
  }

  if (mitk::ILifecycleAwarePart* lifecycleAwarePart = dynamic_cast<mitk::ILifecycleAwarePart*>(part))
  {
    lifecycleAwarePart->Visible();
  }
}
void QmitkFunctionalityCoordinator::PartActivated( berry::IWorkbenchPartReference::Pointer partRef )
{
  // change the active standalone functionality
  this->ActivateStandaloneFunctionality(partRef.GetPointer());
}