Skip to content

Commit 5aa3949

Browse files
authored
Merge pull request #6 from EdoFro/wip
v0.0.8
2 parents 2161b34 + 3e0d555 commit 5aa3949

File tree

12 files changed

+1565
-1303
lines changed

12 files changed

+1565
-1303
lines changed

EditingTutorialsWithMDH/menuHelp.mm

Lines changed: 599 additions & 0 deletions
Large diffs are not rendered by default.

Tutorial-o-Matic project.mm

Lines changed: 322 additions & 1282 deletions
Large diffs are not rendered by default.

Tutorial-o-Matic/Tutorial-o-Matic.mm

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</attribute_registry>
77
<node TEXT="Tutorial-o-Matic" FOLDED="false" ID="ID_696401721" LINK="https://github.com/EdoFro/Freeplane_Tutorial_AddOn" BACKGROUND_COLOR="#97c7dc">
88
<font SIZE="16" BOLD="true" ITALIC="true"/>
9-
<attribute_layout NAME_WIDTH="101.87234 pt" VALUE_WIDTH="242.80851 pt"/>
9+
<attribute_layout NAME_WIDTH="99.9403 pt" VALUE_WIDTH="245.01492 pt"/>
1010
<attribute NAME="name" VALUE="tutorialOMatic"/>
11-
<attribute NAME="version" VALUE="v0.0.7"/>
11+
<attribute NAME="version" VALUE="v0.0.8"/>
1212
<attribute NAME="author" VALUE="EdoFro"/>
1313
<attribute NAME="freeplaneVersionFrom" VALUE="v1.9.9"/>
1414
<attribute NAME="freeplaneVersionTo" VALUE=""/>
@@ -98,7 +98,7 @@
9898
<font SIZE="24"/>
9999
<stylenode LOCALIZED_TEXT="styles.predefined" POSITION="right" STYLE="bubble">
100100
<stylenode LOCALIZED_TEXT="default" ID="ID_506805493" ICON_SIZE="12 pt" FORMAT_AS_HYPERLINK="false" COLOR="#484747" BACKGROUND_COLOR="#efefef" STYLE="bubble" SHAPE_HORIZONTAL_MARGIN="5 px" SHAPE_VERTICAL_MARGIN="2 px" BORDER_WIDTH_LIKE_EDGE="false" BORDER_WIDTH="1.9 px" BORDER_COLOR_LIKE_EDGE="false" BORDER_COLOR="#8fbcbb" BORDER_DASH_LIKE_EDGE="true" BORDER_DASH="SOLID" VGAP_QUANTITY="2 px" MAX_WIDTH="15 cm" MIN_WIDTH="3.5 cm">
101-
<arrowlink SHAPE="CUBIC_CURVE" COLOR="#bf5d3f" WIDTH="2" TRANSPARENCY="200" DASH="" FONT_SIZE="9" FONT_FAMILY="SansSerif" DESTINATION="ID_506805493" STARTINCLINATION="45.19149 pt;0 pt;" ENDINCLINATION="56.68085 pt;29.87234 pt;" STARTARROW="NONE" ENDARROW="DEFAULT"/>
101+
<arrowlink SHAPE="CUBIC_CURVE" COLOR="#bf5d3f" WIDTH="2" TRANSPARENCY="200" DASH="" FONT_SIZE="9" FONT_FAMILY="SansSerif" DESTINATION="ID_506805493" STARTINCLINATION="45.13433 pt;0 pt;" ENDINCLINATION="56.95522 pt;30.08955 pt;" STARTARROW="NONE" ENDARROW="DEFAULT"/>
102102
<font NAME="Dialog" SIZE="10" BOLD="false" STRIKETHROUGH="false" ITALIC="false"/>
103103
<edge STYLE="horizontal" COLOR="#ff0000" WIDTH="1" DASH="SOLID"/>
104104
<richcontent CONTENT-TYPE="plain/auto" TYPE="DETAILS"/>
@@ -195,7 +195,7 @@
195195
</richcontent>
196196
<node TEXT="Tutorial-o-Matic for Freeplane!!&#xa;Tutorial-o-Matic is an AddOn for Freeplane that gives the user the possibility to create his/her own tutorials." ID="ID_1642042079"/>
197197
</node>
198-
<node TEXT="changes" FOLDED="true" POSITION="left" ID="ID_461119253"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
198+
<node TEXT="changes" POSITION="left" ID="ID_461119253"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
199199
<html>
200200
<head>
201201

@@ -269,6 +269,9 @@
269269
<node TEXT="bugs fixes" ID="ID_1389797512"/>
270270
<node TEXT="Improved Step by Step Tutorials" ID="ID_345569965"/>
271271
</node>
272+
<node TEXT="v0.0.8" ID="ID_1932824258">
273+
<node TEXT="Test: Using Tutorial-o-Matic as Menu Help" ID="ID_1349453896"/>
274+
</node>
272275
</node>
273276
<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_624388795"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
274277
<html>
@@ -452,9 +455,10 @@ For each menu item with an icon add an attribute with the icon key (use develope
452455
</body>
453456
</html>
454457
</richcontent>
455-
<node TEXT="en" ID="ID_643789068">
456-
<attribute_layout NAME_WIDTH="194.55319 pt" VALUE_WIDTH="245.87234 pt"/>
458+
<node TEXT="en" ID="ID_647184303">
459+
<attribute_layout NAME_WIDTH="197.73134 pt" VALUE_WIDTH="246.08955 pt"/>
457460
<attribute NAME="addons.${name}.createNewTutorialMindMap" VALUE="Create new tutorial mind map"/>
461+
<attribute NAME="addons.${name}.getMenuHelp" VALUE="Get menu help"/>
458462
<attribute NAME="addons.${name}" VALUE="Tutorial-o-Matic"/>
459463
<attribute NAME="addons.${name}.ToMDemo" VALUE="Tutorial-o-Matic Demo"/>
460464
<attribute NAME="addons.${name}.ToMTutorial" VALUE="Tutorial-o-Matic Intro"/>
@@ -467,9 +471,10 @@ For each menu item with an icon add an attribute with the icon key (use develope
467471
<attribute NAME="addons.${name}.openDemoMap" VALUE="open Demo map"/>
468472
<attribute NAME="addons.${name}.showTutorialsFromActiveMap" VALUE="Show tutorials from active map"/>
469473
</node>
470-
<node TEXT="es" ID="ID_1100466604">
474+
<node TEXT="es" ID="ID_89536389">
471475
<attribute_layout NAME_WIDTH="194.55319 pt" VALUE_WIDTH="214.46808 pt"/>
472476
<attribute NAME="addons.${name}.createNewTutorialMindMap" VALUE="Crear nuevo mapa para tutoriales"/>
477+
<attribute NAME="addons.${name}.getMenuHelp" VALUE="Obtener ayuda para menu"/>
473478
<attribute NAME="addons.${name}" VALUE="Tutorial-o-Matic"/>
474479
<attribute NAME="addons.${name}.ToMDemo" VALUE="Tutorial-o-Matic Demo"/>
475480
<attribute NAME="addons.${name}.ToMTutorial" VALUE="Intro Tutorial-o-Matic"/>
@@ -521,6 +526,8 @@ For each menu item with an icon add an attribute with the icon key (use develope
521526
<attribute NAME="delete" VALUE="${installationbase}/doc/Tutorial-o-Matic/myExistingMindMap.mm"/>
522527
<attribute NAME="delete" VALUE="${installationbase}/addons/${name}/scripts/getMenuCommandToM.groovy"/>
523528
<attribute NAME="delete" VALUE="${installationbase}/doc/Tutorial-o-Matic/LongTutorialExample.mm"/>
529+
<attribute NAME="delete" VALUE="${installationbase}/addons/${name}/scripts/getMenuHelp.groovy"/>
530+
<attribute NAME="delete" VALUE="${installationbase}/doc/Tutorial-o-Matic/menuHelp.mm"/>
524531
</node>
525532
<node TEXT="scripts" POSITION="right" ID="ID_1037882722"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
526533
<html>
@@ -640,7 +647,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
640647
</html>
641648
</richcontent>
642649
<node TEXT="getMenuCommandToM.groovy" ID="ID_863849079">
643-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="186.89361 pt"/>
650+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="191.28358 pt"/>
644651
<attribute NAME="menuTitleKey" VALUE="addons.${name}.getMenuCommandToM"/>
645652
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Commands"/>
646653
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -652,7 +659,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
652659
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
653660
</node>
654661
<node TEXT="showTutorialsFromActiveMap.groovy" ID="ID_484672073">
655-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="194.55319 pt"/>
662+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="197.73134 pt"/>
656663
<attribute NAME="menuTitleKey" VALUE="addons.${name}.showTutorialsFromActiveMap"/>
657664
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Commands"/>
658665
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -664,7 +671,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
664671
<attribute NAME="execute_scripts_without_network_restriction" VALUE="true"/>
665672
</node>
666673
<node TEXT="createNewTutorialMindMap.groovy" ID="ID_1471194194">
667-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="187.65957 pt"/>
674+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="191.28358 pt"/>
668675
<attribute NAME="menuTitleKey" VALUE="addons.${name}.createNewTutorialMindMap"/>
669676
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Commands"/>
670677
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -676,7 +683,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
676683
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
677684
</node>
678685
<node TEXT="importToMStyles.groovy" ID="ID_1858810414">
679-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="186.89361 pt"/>
686+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="191.28358 pt"/>
680687
<attribute NAME="menuTitleKey" VALUE="addons.${name}.importToMStyles"/>
681688
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Commands"/>
682689
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -688,7 +695,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
688695
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
689696
</node>
690697
<node TEXT="openTutorialPageFromLink.groovy" ID="ID_1316819334">
691-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="186.89361 pt"/>
698+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="191.28358 pt"/>
692699
<attribute NAME="menuTitleKey" VALUE="addons.${name}.openTutorialPageFromLink"/>
693700
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Commands"/>
694701
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -700,7 +707,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
700707
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
701708
</node>
702709
<node TEXT="ToMDemo.groovy" ID="ID_513310589">
703-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="170.80851 pt"/>
710+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="177.31343 pt"/>
704711
<attribute NAME="menuTitleKey" VALUE="addons.${name}.ToMDemo"/>
705712
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Demos"/>
706713
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -712,7 +719,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
712719
<attribute NAME="execute_scripts_without_network_restriction" VALUE="true"/>
713720
</node>
714721
<node TEXT="openDemoMap.groovy" ID="ID_1629939217">
715-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="170.80851 pt"/>
722+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="177.31343 pt"/>
716723
<attribute NAME="menuTitleKey" VALUE="addons.${name}.openDemoMap"/>
717724
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Demos"/>
718725
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -724,7 +731,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
724731
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
725732
</node>
726733
<node TEXT="ToMTutorial.groovy" ID="ID_1001747286">
727-
<attribute_layout NAME_WIDTH="187.65957 pt" VALUE_WIDTH="141.70212 pt"/>
734+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="147.22388 pt"/>
728735
<attribute NAME="menuTitleKey" VALUE="addons.${name}.ToMTutorial"/>
729736
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}"/>
730737
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -735,6 +742,18 @@ For each menu item with an icon add an attribute with the icon key (use develope
735742
<attribute NAME="execute_scripts_without_exec_restriction" VALUE="false"/>
736743
<attribute NAME="execute_scripts_without_network_restriction" VALUE="true"/>
737744
</node>
745+
<node TEXT="getMenuHelp.groovy" ID="ID_1905569645">
746+
<attribute_layout NAME_WIDTH="199.88059 pt" VALUE_WIDTH="174.08955 pt"/>
747+
<attribute NAME="menuTitleKey" VALUE="addons.${name}.getMenuHelp"/>
748+
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}/Tests"/>
749+
<attribute NAME="executionMode" VALUE="on_single_node"/>
750+
<attribute NAME="keyboardShortcut" VALUE="control shift F1"/>
751+
<attribute NAME="execute_scripts_without_asking" VALUE="true"/>
752+
<attribute NAME="execute_scripts_without_file_restriction" VALUE="true"/>
753+
<attribute NAME="execute_scripts_without_write_restriction" VALUE="false"/>
754+
<attribute NAME="execute_scripts_without_exec_restriction" VALUE="false"/>
755+
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
756+
</node>
738757
</node>
739758
<node TEXT="lib" POSITION="right" ID="ID_1814812956"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
740759
<html>

Tutorial-o-Matic/history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# History
22

3+
## v0.0.8
4+
5+
* Test: Using Tutorial-o-Matic as Menu Help
6+
37
## v0.0.7
48

59
* getMenuCommand renamed to getMenuCommandToM.groovy
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import javax.swing.JComponent
2+
3+
import edofro.menuomatic.MenuAction as MA
4+
import edofro.tutorialomatic.ToM as tom
5+
6+
7+
8+
def newPageStyle = 'ToM_newPage'
9+
MenuHelperFolderName = 'Tutorial-o-Matic'
10+
11+
//get command under mouse pointer
12+
def action = getAction()
13+
if(!action) {
14+
msg("No command found under mouse arrow")
15+
return 'NOK'
16+
}
17+
18+
//open menuHelp Tutorial mindmap
19+
def mapa = getMap()
20+
if(!mapa) {
21+
msg("Help map couldn't be found")
22+
return 'NOK'
23+
}
24+
25+
26+
//obtener nodo de acción
27+
def linkAccion = "menuitem:_${action.key}".toString()
28+
def actionNode = mapa.root.find{n -> n.link.text == linkAccion}.take(1)
29+
30+
// abrir tutorial en página de nodo de acción
31+
if(!actionNode) {
32+
msg("Command '${MA.getLabelText(action)}' was not found in '${mapa.name}'")
33+
return 'NOK'
34+
}
35+
36+
def newPageNode = actionNode[0].pathToRoot.reverse().find{it.style.name == newPageStyle}
37+
38+
if(!newPageNode) {
39+
msg("Command '${MA.getLabelText(action)}' has no helping page in '${mapa.name}'")
40+
return 'NOK'
41+
}
42+
43+
tom.openTutorialPage(newPageNode.id, mapa)
44+
45+
return "Done"
46+
47+
// methods
48+
def getAction(){
49+
JComponent component = (JComponent) MA.getComponent()
50+
return MA.getAction(component)
51+
}
52+
53+
def msg(t){
54+
ui.informationMessage(t.toString())
55+
}
56+
57+
58+
//region: opens tutorial map
59+
def getMap(){
60+
def m = c.openMaps.find{it.name == 'menuHelp'}
61+
return m ?: getMapFromUserdirectory(MenuHelperFolderName, 'menuHelp.mm')
62+
}
63+
64+
def getMapFromUserdirectory(addonFolderName,mapFileName){
65+
def sep = File.separator
66+
def userDir = c.userDirectory.path
67+
def pathName = userDir + sep + "doc" + sep + addonFolderName + sep + mapFileName
68+
def tutMap = tom.getMapFromPath(pathName, false)
69+
return tutMap
70+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ class ToM_actions{
110110
mME.label
111111
}
112112

113+
def static getIcon(mME){
114+
mME.icon
115+
}
116+
113117
def static getToolTip(mME){
114118
mME.toolTipText
115119
}
@@ -139,6 +143,7 @@ class ToM_actions{
139143
<< [ label : getLabel(miPath[-1]) ]
140144
<< [ menuPath : getMenuPath(miPath) ]
141145
<< [ toolTip : getToolTip(miPath[-1]) ]
146+
<< [ icon : getIcon(miPath[-1]) ]
142147
def instr1 = textUtils.format(actionInstruction1, apos(myAction.menuPath), apos(myAction.label))
143148
def instr2 = myAction.keyStroke?textUtils.format(actionInstruction2, apos(myAction.keyStroke)):""
144149
myAction << [ instructions : instr2?htmlUtils.join(instr1,"", instr2).replace('\n',''):instr1 ]

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ class ToM_ui{
490490

491491
//end:
492492

493-
494493
//region: Listeners
495494

496495
// Listener for Tutorial Tab pane so it gets resized (enough length) each time its width gets modified

Tutorial-o-Matic/translations/en.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Aug 08 18:13:04 CLT 2022
2-
1+
#Sat Aug 13 17:52:09 CLT 2022
32
addons.${name}.createNewTutorialMindMap=Create new tutorial mind map
3+
addons.${name}.getMenuHelp=Get menu help
44
addons.${name}=Tutorial-o-Matic
55
addons.${name}.ToMDemo=Tutorial-o-Matic Demo
66
addons.${name}.ToMTutorial=Tutorial-o-Matic Intro

Tutorial-o-Matic/translations/es.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Mon Aug 08 18:13:04 CLT 2022
1+
#Sat Aug 13 17:52:09 CLT 2022
22

33
addons.${name}.createNewTutorialMindMap=Crear nuevo mapa para tutoriales
4+
addons.${name}.getMenuHelp=Obtener ayuda para menu
45
addons.${name}=Tutorial-o-Matic
56
addons.${name}.ToMDemo=Tutorial-o-Matic Demo
67
addons.${name}.ToMTutorial=Intro Tutorial-o-Matic
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=v0.0.7
2-
downloadUrl=https://github.com/EdoFro/Freeplane_Tutorial_AddOn/releases/download/v0.0.7/Tutorial-o-Matic-v0.0.7.addon.mm
1+
version=v0.0.8
2+
downloadUrl=https://github.com/EdoFro/Freeplane_Tutorial_AddOn/releases/download/v0.0.8/Tutorial-o-Matic-v0.0.8.addon.mm
33
changelogUrl=https://github.com/EdoFro/Freeplane_Tutorial_AddOn/releases/latest/download/history.md
44
freeplaneVersionFrom=v1.9.9

0 commit comments

Comments
 (0)