Skip to content

Commit 4c0ffda

Browse files
committed
added isBlocked()
1 parent 0c1f08f commit 4c0ffda

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM.groovy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import edofro.menuomatic.WSE_redux as WSE
88
import org.freeplane.core.ui.components.UITools as ui
99
import org.freeplane.plugin.script.proxy.ScriptUtils
1010
import org.freeplane.core.util.MenuUtils as menuUtils
11+
//import org.freeplane.core.util.HtmlUtils as htmlUtils
1112

1213

1314
import org.freeplane.api.Node as ApiNode
@@ -61,12 +62,16 @@ class ToM{
6162
}
6263

6364
def static getTutNodes( nTutorial){
64-
return nTutorial.find{isTutNode(it)}
65+
return nTutorial.find{isTutNode(it) && !isBlocked(it)}
6566
}
6667

6768
def static isTutNode( n){
6869
return n?.style?.name?.startsWith(styles.ini)?:false
6970
}
71+
72+
def static isBlocked(n){
73+
return (n && (n.pathToRoot - n).any{it.icons.icons.contains('closed')})
74+
}
7075

7176
def static getTutorialNode( n){
7277
return n.pathToRoot.find{isTutorialNode(it)}
@@ -627,7 +632,7 @@ class ToM{
627632
}
628633

629634
def static addTutorialsPane(myP, ApiMindMap mapa){
630-
def nodosTutoriales = mapa.root.find{it.style.name == styles.tutorial}
635+
def nodosTutoriales = mapa.root.find{it.style.name == styles.tutorial && !isBlocked(it) }
631636
if ( nodosTutoriales.size() != 1 ){
632637
def pane = tomui.createEmptyGridBagPanel()
633638
def pre = nodosTutoriales.size() == 0 ? "No t" : "T"

0 commit comments

Comments
 (0)