From 095cfdd7629760c150a6abe48ed2e04a73709260 Mon Sep 17 00:00:00 2001 From: akl Date: Mon, 18 Aug 2014 14:09:01 +0400 Subject: [PATCH] Implementation of 0022615: [CEA 1014] Fold/unfold all the nodes of a block. --- src/genericgui/GenericGui.cxx | 18 +++ src/genericgui/GenericGui.hxx | 4 + src/genericgui/GuiEditor.cxx | 16 +- src/genericgui/GuiEditor.hxx | 2 +- src/genericgui/Menus.cxx | 4 + src/genericgui/SceneComposedNodeItem.cxx | 177 +++++++++++++++------ src/genericgui/SceneComposedNodeItem.hxx | 6 +- src/genericgui/SceneElementaryNodeItem.cxx | 52 ++++-- src/genericgui/SceneElementaryNodeItem.hxx | 4 +- src/genericgui/SceneItem.cxx | 2 +- src/genericgui/SceneItem.hxx | 9 +- src/genericgui/SceneNodeItem.cxx | 4 +- src/genericgui/SceneNodeItem.hxx | 2 +- src/genericgui/SceneProcItem.cxx | 38 ----- src/genericgui/SceneProcItem.hxx | 1 - src/salomegui/resources/YACS_msg_fr.ts | 16 ++ src/salomegui/resources/YACS_msg_ja.ts | 16 ++ 17 files changed, 247 insertions(+), 124 deletions(-) diff --git a/src/genericgui/GenericGui.cxx b/src/genericgui/GenericGui.cxx index 2677874d9..e6086cef7 100644 --- a/src/genericgui/GenericGui.cxx +++ b/src/genericgui/GenericGui.cxx @@ -460,6 +460,14 @@ void GenericGui::createActions() tr("shrink/expand"), tr("shrink or expand the selected node"), 0, _parent, false, this, SLOT(onShrinkExpand())); + _shrinkExpandChildren = _wrapper->createAction(getMenuId(), tr("shrink or expand direct children of the selected node"), QIcon("icons:shrinkExpand.png"), + tr("shrink/expand children"), tr("shrink or expand direct children of the selected node"), + 0, _parent, false, this, SLOT(onShrinkExpandChildren())); + + _shrinkExpandElementaryRecursively = _wrapper->createAction(getMenuId(), tr("shrink or expand elementary nodes of the selected node recursively"), QIcon("icons:shrinkExpand.png"), + tr("shrink/expand elementary"), tr("shrink or expand elementary nodes of the selected node recursively"), + 0, _parent, false, this, SLOT(onShrinkExpandElementaryRecursively())); + _toggleStraightLinksAct = _wrapper->createAction(getMenuId(), tr("draw straight or orthogonal links"), QIcon("icons:straightLink.png"), tr("straight/orthogonal"), tr("draw straight or orthogonal links"), 0, _parent, true, this, SLOT(onToggleStraightLinks(bool))); @@ -2182,6 +2190,16 @@ void GenericGui::onShrinkExpand() { _guiEditor->shrinkExpand(); } +void GenericGui::onShrinkExpandChildren() { + DEBTRACE("GenericGui::onShrinkExpandChildren"); + _guiEditor->shrinkExpand(Qt::ControlModifier|Qt::ShiftModifier); +} + +void GenericGui::onShrinkExpandElementaryRecursively() { + DEBTRACE("GenericGui::onShrinkExpandElementaryRecursively"); + _guiEditor->shrinkExpand(Qt::ControlModifier); +} + void GenericGui::onToggleStraightLinks(bool checked) { Scene::_straightLinks = checked; diff --git a/src/genericgui/GenericGui.hxx b/src/genericgui/GenericGui.hxx index b3c9db94a..92767e1c2 100644 --- a/src/genericgui/GenericGui.hxx +++ b/src/genericgui/GenericGui.hxx @@ -161,6 +161,8 @@ namespace YACS QAction *_zoomToBlocAct; QAction *_centerOnNodeAct; QAction *_shrinkExpand; + QAction *_shrinkExpandChildren; + QAction *_shrinkExpandElementaryRecursively; QAction *_toggleStraightLinksAct; QAction *_toggleAutomaticComputeLinkAct; @@ -300,6 +302,8 @@ namespace YACS void onZoomToBloc(); void onCenterOnNode(); void onShrinkExpand(); + void onShrinkExpandChildren(); + void onShrinkExpandElementaryRecursively(); void onToggleStraightLinks(bool checked); void onToggleAutomaticComputeLinks(bool checked); void onToggleSimplifyLinks(bool checked); diff --git a/src/genericgui/GuiEditor.cxx b/src/genericgui/GuiEditor.cxx index 45dc0e33b..c50a41dda 100644 --- a/src/genericgui/GuiEditor.cxx +++ b/src/genericgui/GuiEditor.cxx @@ -372,7 +372,7 @@ SubjectDataPort* GuiEditor::CreateOutputPort(SubjectElementaryNode* seNode, /*! * Subject shrink or expand, command from popup menu: needs a valid selection */ -void GuiEditor::shrinkExpand() { +void GuiEditor::shrinkExpand(Qt::KeyboardModifiers kbModifiers) { DEBTRACE("GuiEditor::shrinkExpand"); Subject* sub = QtGuiContext::getQtCurrent()->getSelectedSubject(); @@ -393,12 +393,14 @@ void GuiEditor::shrinkExpand() { return; }; - if (sni->isExpanded()) { - sni->setExpanded(false); - } else { - sni->setExpanded(true); - }; - sni->reorganizeShrinkExpand(); + ShrinkMode aShrinkMode = CurrentNode; + if (kbModifiers == Qt::ControlModifier) { + aShrinkMode = ElementaryNodes; + } else if (kbModifiers == (Qt::ShiftModifier|Qt::ControlModifier)) { + aShrinkMode = ChildrenNodes; + } + + sni->reorganizeShrinkExpand(aShrinkMode); sni->showOutScopeLinks(); sni->updateLinks(); } diff --git a/src/genericgui/GuiEditor.hxx b/src/genericgui/GuiEditor.hxx index 627993b81..7940b7443 100644 --- a/src/genericgui/GuiEditor.hxx +++ b/src/genericgui/GuiEditor.hxx @@ -82,7 +82,7 @@ namespace YACS void PutSubjectInBloc(); std::string PutGraphInBloc(); void PutGraphInNode(std::string typeNode); - void shrinkExpand(); + void shrinkExpand(Qt::KeyboardModifiers kbModifiers = Qt::NoModifier); void rebuildLinks(); void arrangeNodes(bool isRecursive); void arrangeProc(); diff --git a/src/genericgui/Menus.cxx b/src/genericgui/Menus.cxx index 49c996f05..8cbc6bc0d 100644 --- a/src/genericgui/Menus.cxx +++ b/src/genericgui/Menus.cxx @@ -170,6 +170,8 @@ void ComposedNodeMenu::popupMenu(QWidget *caller, const QPoint &globalPos, const menu.addAction(gmain->_zoomToBlocAct); menu.addAction(gmain->_centerOnNodeAct); menu.addAction(gmain->_shrinkExpand); + menu.addAction(gmain->_shrinkExpandChildren); + menu.addAction(gmain->_shrinkExpandElementaryRecursively); menu.addAction(gmain->_computeLinkAct); // menu.addAction(gmain->_toggleAutomaticComputeLinkAct); // menu.addAction(gmain->_toggleSimplifyLinkAct); @@ -272,6 +274,8 @@ void ProcMenu::popupMenu(QWidget *caller, const QPoint &globalPos, const QString menu.addAction(gmain->_zoomToBlocAct); menu.addAction(gmain->_centerOnNodeAct); menu.addAction(gmain->_shrinkExpand); + menu.addAction(gmain->_shrinkExpandChildren); + menu.addAction(gmain->_shrinkExpandElementaryRecursively); menu.addAction(gmain->_computeLinkAct); // menu.addAction(gmain->_toggleAutomaticComputeLinkAct); // menu.addAction(gmain->_toggleSimplifyLinkAct); diff --git a/src/genericgui/SceneComposedNodeItem.cxx b/src/genericgui/SceneComposedNodeItem.cxx index ddd780595..6c18f9fe4 100644 --- a/src/genericgui/SceneComposedNodeItem.cxx +++ b/src/genericgui/SceneComposedNodeItem.cxx @@ -391,12 +391,10 @@ void SceneComposedNodeItem::removeChildFromList(AbstractSceneItem* child) _children.remove(child); } -void SceneComposedNodeItem::reorganizeShrinkExpand() { - DEBTRACE("SceneComposedNodeItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString()); - bool isExpanding = isExpanded(); - +void SceneComposedNodeItem::updateControlLinks(bool toExpand) +{ //update control links - std::list lscl=dynamic_cast(_subject)->getSubjectControlLinks(); + std::list lscl=dynamic_cast(getSubject())->getSubjectControlLinks(); for (std::list::const_iterator it = lscl.begin(); it != lscl.end(); ++it) { SceneLinkItem* lk = dynamic_cast(QtGuiContext::getQtCurrent()->_mapOfSceneItem[*it]); @@ -419,15 +417,44 @@ void SceneComposedNodeItem::reorganizeShrinkExpand() { }; if (b1 && b2) { - if (isExpanding) { + if (toExpand) { lk->show(); } else { lk->hide(); }; }; }; +} + +void SceneComposedNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode) { + DEBTRACE("SceneComposedNodeItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString()); + + bool toExpand = true; + if (theShrinkMode == CurrentNode) { + // shrink/expand current node only + toExpand = !isExpanded(); + + updateControlLinks(toExpand); + shrinkExpandRecursive(toExpand, true, theShrinkMode); + + } else { + if (!isExpanded()) + return; + // shrink/expand child nodes + toExpand = !hasExpandedChildren(theShrinkMode == ElementaryNodes); + for (list::const_iterator it=_children.begin(); it!=_children.end(); ++it) { + SceneItem* item = dynamic_cast(*it); + SceneNodeItem *sni = dynamic_cast(item); + item->shrinkExpandRecursive(toExpand, true, theShrinkMode); + } + _ancestorShrinked = !toExpand; + _width = _expandedWidth; + _height = _expandedHeight; + _shownState = expandShown; + adjustHeader(); + rebuildLinks(); + } - shrinkExpandRecursive(isExpanding, true); if (Scene::_autoComputeLinks) { SubjectProc* subproc = QtGuiContext::getQtCurrent()->getSubjectProc(); @@ -437,70 +464,116 @@ void SceneComposedNodeItem::reorganizeShrinkExpand() { } } -void SceneComposedNodeItem::shrinkExpandRecursive(bool isExpanding, bool fromHere) +bool SceneComposedNodeItem::hasExpandedChildren(bool recursively) +{ + bool res = false; + for (list::const_iterator it=_children.begin(); it!=_children.end() && !res; ++it) { + SceneItem* item = dynamic_cast(*it); + SceneNodeItem *sni = dynamic_cast(item); + if (sni->isExpanded()) { + res = true; + if (recursively) + if (SceneComposedNodeItem *scni = dynamic_cast(sni)) + res = scni->hasExpandedChildren(recursively); + } + } + return res; +} + +void SceneComposedNodeItem::shrinkExpandRecursive(bool toExpand, bool fromHere, ShrinkMode theShrinkMode) { DEBTRACE("SceneComposedNodeItem::shrinkExpandRecursive " << isExpanding << " " << fromHere << " " << isExpanded() << " " << _label.toStdString()); - if (!isExpanding) + bool toChangeShrinkState = false; + switch (theShrinkMode) { + case CurrentNode: + if (fromHere) + toChangeShrinkState = true; + break; + case ChildrenNodes: + if (fromHere) + toChangeShrinkState = true; + break; + case ElementaryNodes: + toChangeShrinkState = false; + break; + } + if (toChangeShrinkState) { + if (toExpand != isExpanded()) + setExpanded(toExpand); + } else if (!isExpanded() && theShrinkMode == ElementaryNodes) { + return; + } + + updateControlLinks(toExpand); + + if (!toExpand) { // ---collapsing: hide first children , then resize for (list::const_iterator it=_children.begin(); it!=_children.end(); ++it) { SceneItem* item = dynamic_cast(*it); - item->shrinkExpandRecursive(false, false); - item->hide(); - DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString()); - item->shrinkExpandLink(false); + item->shrinkExpandRecursive(toExpand, false, theShrinkMode); + if (theShrinkMode != ElementaryNodes) { + item->hide(); + DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString()); + item->shrinkExpandLink(false); + } } - if (_shownState == expandShown) - { - _expandedWidth = _width; - _expandedHeight = _height; - } + if (toChangeShrinkState || theShrinkMode != ElementaryNodes) { + if (_shownState == expandShown) + { + _expandedWidth = _width; + _expandedHeight = _height; + } - if (fromHere) - { - _shownState = shrinkShown; - } - else - { - _ancestorShrinked = true; - _shownState = shrinkHidden; - } + if (fromHere) + { + _shownState = shrinkShown; + } + else + { + _ancestorShrinked = true; + _shownState = shrinkHidden; + } - _width = 2*Resource::Corner_Margin + 2*Resource::DataPort_Width + Resource::Space_Margin; - if (_shownState == shrinkShown) - _height = getHeaderBottom() + Resource::Corner_Margin; - else - _height = Resource::Header_Height + Resource::Corner_Margin; + _width = 2*Resource::Corner_Margin + 2*Resource::DataPort_Width + Resource::Space_Margin; + if (_shownState == shrinkShown) + _height = getHeaderBottom() + Resource::Corner_Margin; + else + _height = Resource::Header_Height + Resource::Corner_Margin; - if (_shownState == shrinkHidden) // shrink of ancestor - setPos(0 ,0); - else - setPos(_expandedPos); - adjustHeader(); - if (_progressItem) - _progressItem->adjustGeometry(); + if (_shownState == shrinkHidden) // shrink of ancestor + setPos(0 ,0); + else + setPos(_expandedPos); + adjustHeader(); + if (_progressItem) + _progressItem->adjustGeometry(); + } } else { // --- expanding: resize, then show children - _ancestorShrinked = false; + if (toChangeShrinkState) + _ancestorShrinked = false; for (list::const_iterator it=_children.begin(); it!=_children.end(); ++it) { SceneItem* item = dynamic_cast(*it); - item->shrinkExpandRecursive(isExpanded(), false); - if (isExpanded()) - { - item->show(); - DEBTRACE("------------------------------- Show " << item->getLabel().toStdString()); - } - else - { - item->hide(); - DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString()); - } - item->shrinkExpandLink(fromHere); + item->shrinkExpandRecursive(isExpanded(), false, theShrinkMode); + if (theShrinkMode != ElementaryNodes) { + if (isExpanded()) + { + item->show(); + DEBTRACE("------------------------------- Show " << item->getLabel().toStdString()); + } + else + { + item->hide(); + DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString()); + } + item->shrinkExpandLink(fromHere); + } } if (isExpanded()) diff --git a/src/genericgui/SceneComposedNodeItem.hxx b/src/genericgui/SceneComposedNodeItem.hxx index 37e55d264..639cf0c86 100644 --- a/src/genericgui/SceneComposedNodeItem.hxx +++ b/src/genericgui/SceneComposedNodeItem.hxx @@ -45,8 +45,8 @@ namespace YACS virtual std::list getChildren(); virtual void removeChildFromList(AbstractSceneItem* child); virtual void reorganize(); - virtual void reorganizeShrinkExpand(); - virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere); + virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode); + virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode); virtual void shrinkExpandLink(bool se); virtual void collisionResolv(SceneItem* child, QPointF oldPos); virtual void rebuildLinks(); @@ -55,10 +55,12 @@ namespace YACS virtual void arrangeChildNodes(); virtual void adjustColors(); virtual void setShownState(shownState ss); + virtual bool hasExpandedChildren(bool recursively); protected: void dragEnterEvent(QGraphicsSceneDragDropEvent *event); void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); void dropEvent(QGraphicsSceneDragDropEvent *event); + void updateControlLinks(bool toExpand); virtual QColor getPenColor(); virtual QColor getBrushColor(); diff --git a/src/genericgui/SceneElementaryNodeItem.cxx b/src/genericgui/SceneElementaryNodeItem.cxx index 40d4b4d33..9396fe049 100644 --- a/src/genericgui/SceneElementaryNodeItem.cxx +++ b/src/genericgui/SceneElementaryNodeItem.cxx @@ -187,10 +187,12 @@ void SceneElementaryNodeItem::popupMenu(QWidget *caller, const QPoint &globalPos m.popupMenu(caller, globalPos); } -void SceneElementaryNodeItem::reorganizeShrinkExpand() +void SceneElementaryNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode) { DEBTRACE("SceneElementaryNodeItem::reorganizeShrinkExpand " << isExpanded() << " " << _label.toStdString()); - shrinkExpandRecursive(isExpanded(), true); + if (theShrinkMode != CurrentNode) + return; + shrinkExpandRecursive(!isExpanded(), true, theShrinkMode); if (Scene::_autoComputeLinks) { SubjectProc* subproc = QtGuiContext::getQtCurrent()->getSubjectProc(); @@ -200,30 +202,48 @@ void SceneElementaryNodeItem::reorganizeShrinkExpand() } } -void SceneElementaryNodeItem::shrinkExpandRecursive(bool isExpanding, bool fromHere) +void SceneElementaryNodeItem::shrinkExpandRecursive(bool toExpand, bool fromHere, ShrinkMode theShrinkMode) { - DEBTRACE("SceneElementaryNodeItem::shrinkExpandRecursive " << isExpanding << " " << fromHere << " " << isExpanded() << " " << _label.toStdString()); - if (isExpanding) - { + DEBTRACE("SceneElementaryNodeItem::shrinkExpandRecursive " << toExpand << " " << fromHere << " " << isExpanded() << " " << _label.toStdString()); + + bool toChangeShrinkState = false; + switch (theShrinkMode) { + case CurrentNode: + if (fromHere) + toChangeShrinkState = true; + break; + case ChildrenNodes: + if (fromHere) + toChangeShrinkState = true; + break; + case ElementaryNodes: + toChangeShrinkState = true; + break; + } + if (toChangeShrinkState && toExpand != isExpanded()) + setExpanded(toExpand); + + if (toExpand) { + if (toChangeShrinkState) { _ancestorShrinked = false; + _shownState = expandShown; + } else { if (isExpanded()) _shownState = expandShown; else _shownState = shrinkShown; } - else - { - if (fromHere) - _shownState = shrinkShown; - else - { - _ancestorShrinked = true; - _shownState = shrinkHidden; - } + } else { + if (fromHere || theShrinkMode==ElementaryNodes) { + _shownState = shrinkShown; + } else { + _ancestorShrinked = true; + _shownState = shrinkHidden; } + } if (_shownState == shrinkHidden) // shrink of ancestor - setPos(0 ,0); + setPos(0, 0); else setPos(_expandedPos); diff --git a/src/genericgui/SceneElementaryNodeItem.hxx b/src/genericgui/SceneElementaryNodeItem.hxx index 66ecbe387..fdc2f16ae 100644 --- a/src/genericgui/SceneElementaryNodeItem.hxx +++ b/src/genericgui/SceneElementaryNodeItem.hxx @@ -42,8 +42,8 @@ namespace YACS virtual void popupMenu(QWidget *caller, const QPoint &globalPos); virtual void autoPosNewPort(AbstractSceneItem *item, int nbPorts); virtual void reorganize(); - virtual void reorganizeShrinkExpand(); - virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere); + virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode); + virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode); virtual void setShownState(shownState ss); protected: int _maxPorts; diff --git a/src/genericgui/SceneItem.cxx b/src/genericgui/SceneItem.cxx index 35fb5f077..d097bb19b 100644 --- a/src/genericgui/SceneItem.cxx +++ b/src/genericgui/SceneItem.cxx @@ -436,7 +436,7 @@ void SceneItem::shrinkExpandLink(bool se) } -void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere) +void SceneItem::shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode) { } diff --git a/src/genericgui/SceneItem.hxx b/src/genericgui/SceneItem.hxx index 06cf276a3..a04e6dba1 100644 --- a/src/genericgui/SceneItem.hxx +++ b/src/genericgui/SceneItem.hxx @@ -33,6 +33,13 @@ namespace YACS { namespace HMI { + typedef enum + { + CurrentNode, + ChildrenNodes, + ElementaryNodes + } ShrinkMode; + class Scene; class RootSceneItem: public GuiObserver @@ -131,7 +138,7 @@ namespace YACS virtual void updateChildItems(); virtual void updateLinks(); virtual void shrinkExpandLink(bool se); - virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere); + virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode); bool isAncestorShrinked() { return _ancestorShrinked; }; bool _blocX; bool _blocY; diff --git a/src/genericgui/SceneNodeItem.cxx b/src/genericgui/SceneNodeItem.cxx index fdff648d0..8c7ee43ab 100644 --- a/src/genericgui/SceneNodeItem.cxx +++ b/src/genericgui/SceneNodeItem.cxx @@ -179,7 +179,7 @@ void SceneNodeItem::arrangeChildNodes() { } -void SceneNodeItem::reorganizeShrinkExpand() +void SceneNodeItem::reorganizeShrinkExpand(ShrinkMode theShrinkMode) { } @@ -310,7 +310,7 @@ void SceneNodeItem::mouseMoveEvent(QGraphicsSceneMouseEvent * event) void SceneNodeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { DEBTRACE("SceneNodeItem::mouseDoubleClickEvent"); - QtGuiContext::getQtCurrent()->getGMain()->_guiEditor->shrinkExpand(); + QtGuiContext::getQtCurrent()->getGMain()->_guiEditor->shrinkExpand(QApplication::keyboardModifiers()); } void SceneNodeItem::setTopLeft(QPointF topLeft) diff --git a/src/genericgui/SceneNodeItem.hxx b/src/genericgui/SceneNodeItem.hxx index 5205a4938..292c31d77 100644 --- a/src/genericgui/SceneNodeItem.hxx +++ b/src/genericgui/SceneNodeItem.hxx @@ -72,7 +72,7 @@ namespace YACS virtual void updateName(); virtual void arrangeNodes(bool isRecursive); virtual void arrangeChildNodes(); - virtual void reorganizeShrinkExpand(); + virtual void reorganizeShrinkExpand(ShrinkMode theShrinkMode); virtual void updateChildItems(); virtual void shrinkExpandLink(bool se); virtual void showOutScopeLinks(); diff --git a/src/genericgui/SceneProcItem.cxx b/src/genericgui/SceneProcItem.cxx index 14ec4befe..919d9510d 100644 --- a/src/genericgui/SceneProcItem.cxx +++ b/src/genericgui/SceneProcItem.cxx @@ -52,41 +52,3 @@ void SceneProcItem::popupMenu(QWidget *caller, const QPoint &globalPos) m.popupMenu(caller, globalPos); } -void SceneProcItem::reorganizeShrinkExpand() { - if (_children.size() == 0) - return; - bool isExpanding = true; - DEBTRACE("SceneProcItem::reorganizeShrinkExpand " << _expanded << " " << _label.toStdString()); - for (list::const_iterator it=_children.begin(); it!=_children.end(); ++it) - { - SceneItem* item = dynamic_cast(*it); - SceneNodeItem *sni = dynamic_cast(item); - if (sni->isExpanded()) { - isExpanding = false; - break; - } - } - for (list::const_iterator it=_children.begin(); it!=_children.end(); ++it) - { - SceneItem* item = dynamic_cast(*it); - SceneNodeItem *sni = dynamic_cast(item); - if (!isExpanding && sni->isExpanded()) { - sni->setExpanded(false); - item->shrinkExpandRecursive(false, true); - DEBTRACE("------------------------------- Hide " << item->getLabel().toStdString()); - } - if (isExpanding && !sni->isExpanded()) { - sni->setExpanded(true); - item->shrinkExpandRecursive(true, false); - DEBTRACE("------------------------------- Show " << item->getLabel().toStdString()); - } - item->shrinkExpandLink(isExpanding); - } - _ancestorShrinked = !isExpanding; - _width = _expandedWidth; - _height = _expandedHeight; - _shownState = expandShown; - adjustHeader(); - rebuildLinks(); -} - diff --git a/src/genericgui/SceneProcItem.hxx b/src/genericgui/SceneProcItem.hxx index 8e4ce68f0..725accab3 100644 --- a/src/genericgui/SceneProcItem.hxx +++ b/src/genericgui/SceneProcItem.hxx @@ -33,7 +33,6 @@ namespace YACS QString label, Subject *subject); virtual ~SceneProcItem(); virtual void popupMenu(QWidget *caller, const QPoint &globalPos); - virtual void reorganizeShrinkExpand(); }; } } diff --git a/src/salomegui/resources/YACS_msg_fr.ts b/src/salomegui/resources/YACS_msg_fr.ts index acc337c8a..ae221267b 100644 --- a/src/salomegui/resources/YACS_msg_fr.ts +++ b/src/salomegui/resources/YACS_msg_fr.ts @@ -593,10 +593,26 @@ shrink or expand the selected node contracter ou étendre le noeud choisi + + shrink or expand direct children of the selected node + contracter ou étendre le noeud choisi + + + shrink or expand elementary nodes of the selected node recursively + contracter ou étendre le noeud choisi + shrink/expand contracter/étendre + + shrink/expand children + contracter/étendre + + + shrink/expand elementary + contracter/étendre + draw straight or orthogonal links Créer les liens droits ou orthogonaux diff --git a/src/salomegui/resources/YACS_msg_ja.ts b/src/salomegui/resources/YACS_msg_ja.ts index f30cce995..a8508990e 100644 --- a/src/salomegui/resources/YACS_msg_ja.ts +++ b/src/salomegui/resources/YACS_msg_ja.ts @@ -593,10 +593,26 @@ shrink or expand the selected node 選択中のノードを展開または縮小 + + shrink or expand direct children of the selected node + 選択中のノードを展開または縮小 + + + shrink or expand elementary nodes of the selected node recursively + 選択中のノードを展開または縮小 + shrink/expand 展開/縮小 + + shrink/expand children + 展開/縮小 + + + shrink/expand elementary + 展開/縮小 + draw straight or orthogonal links 直線または直交リンクを描画 -- 2.39.2