Skip to content

Commit 25d45eb

Browse files
committed
added Editing status
1 parent 472981a commit 25d45eb

7 files changed

Lines changed: 131 additions & 107 deletions

File tree

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

Lines changed: 33 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!--To view this file, download free mind mapping software Freeplane from https://www.freeplane.org -->
33
<node TEXT="Tutorial-o-Matic" FOLDED="false" ID="ID_696401721" LINK="https://github.com/EdoFro/Freeplane_Tutorial_AddOn" BACKGROUND_COLOR="#97c7dc">
44
<font SIZE="16" BOLD="true" ITALIC="true"/>
5-
<attribute_layout NAME_WIDTH="112.5 pt" VALUE_WIDTH="434.24999 pt"/>
5+
<attribute_layout NAME_WIDTH="127.5 pt" VALUE_WIDTH="449.24999 pt"/>
66
<attribute NAME="name" VALUE="tutorialOMatic"/>
7-
<attribute NAME="version" VALUE="v0.0.5"/>
7+
<attribute NAME="version" VALUE="v0.0.6"/>
88
<attribute NAME="author" VALUE="EdoFro"/>
99
<attribute NAME="freeplaneVersionFrom" VALUE="v1.9.9"/>
1010
<attribute NAME="freeplaneVersionTo" VALUE=""/>
@@ -138,10 +138,7 @@
138138
</stylenode>
139139
</map_styles>
140140
</hook>
141-
<hook NAME="AutomaticEdgeColor" COUNTER="14" RULE="ON_BRANCH_CREATION"/>
142-
<node TEXT="description" POSITION="left" ID="ID_1678998363">
143-
<edge COLOR="#ff0000"/>
144-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
141+
<node TEXT="description" POSITION="left" ID="ID_1678998363"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
145142
<html>
146143
<head>
147144

@@ -161,9 +158,7 @@
161158
</richcontent>
162159
<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"/>
163160
</node>
164-
<node TEXT="changes" POSITION="left" ID="ID_461119253">
165-
<edge COLOR="#0000ff"/>
166-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
161+
<node TEXT="changes" POSITION="left" ID="ID_461119253"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
167162
<html>
168163
<head>
169164

@@ -187,14 +182,15 @@
187182
<node TEXT="v0.0.4" FOLDED="true" ID="ID_1654795865">
188183
<node TEXT="- corrected link to version.properties&#xa;- information of pasted nodes now is saved in each map for later exercises and multiple exercising maps&#xa;- added &apos;go back&apos; when using &apos;GOTO&apos; panes&#xa;- added &apos;show node from map&apos;&#xa;- added &apos;Show Tutorials&apos; in tutorial&apos;s last page&#xa;- added markedj.Options for Markdown" ID="ID_312985717"/>
189184
</node>
190-
<node TEXT="v0.0.5" ID="ID_1381773414">
185+
<node TEXT="v0.0.5" FOLDED="true" ID="ID_1381773414">
191186
<node TEXT="- use look and feel specific colors (dpolivaev)" ID="ID_1429862191"/>
187+
</node>
188+
<node TEXT="v0.0.6" ID="ID_1444474192">
192189
<node TEXT="using devtools v0.9.30" ID="ID_1084561560"/>
190+
<node TEXT="added &quot;editing status&quot; to tutorial node (crayon icon)" ID="ID_710909877"/>
193191
</node>
194192
</node>
195-
<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_624388795">
196-
<edge COLOR="#00ff00"/>
197-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
193+
<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_624388795"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
198194
<html>
199195
<head>
200196

@@ -214,9 +210,7 @@
214210
</richcontent>
215211
<node TEXT="MIT License&#xa;&#xa;Copyright (c) 2021 Eduardo Frohlich.&#xa;&#xa;Permission is hereby granted, free of charge, to any person obtaining a copy&#xa;of this software and associated documentation files (the &quot;Software&quot;), to deal&#xa;in the Software without restriction, including without limitation the rights&#xa;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#xa;copies of the Software, and to permit persons to whom the Software is&#xa;furnished to do so, subject to the following conditions:&#xa;&#xa;The above copyright notice and this permission notice shall be included in all&#xa;copies or substantial portions of the Software.&#xa;&#xa;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#xa;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#xa;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&#xa;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#xa;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#xa;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&#xa;SOFTWARE." ID="ID_444630498"/>
216212
</node>
217-
<node TEXT="preferences.xml" POSITION="left" ID="ID_1967714695">
218-
<edge COLOR="#ff00ff"/>
219-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
213+
<node TEXT="preferences.xml" POSITION="left" ID="ID_1967714695"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
220214
<html>
221215
<head>
222216

@@ -325,9 +319,7 @@
325319
</html>
326320
</richcontent>
327321
</node>
328-
<node TEXT="default.properties" POSITION="left" ID="ID_1398497950">
329-
<edge COLOR="#00ffff"/>
330-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
322+
<node TEXT="default.properties" POSITION="left" ID="ID_1398497950"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
331323
<html>
332324
<head>
333325

@@ -348,9 +340,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
348340
</html>
349341
</richcontent>
350342
</node>
351-
<node TEXT="translations" POSITION="left" ID="ID_546877695">
352-
<edge COLOR="#7c0000"/>
353-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
343+
<node TEXT="translations" POSITION="left" ID="ID_546877695"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
354344
<html>
355345
<head>
356346

@@ -373,20 +363,26 @@ For each menu item with an icon add an attribute with the icon key (use develope
373363
</body>
374364
</html>
375365
</richcontent>
376-
<node TEXT="en" ID="ID_1998059292">
377-
<attribute_layout NAME_WIDTH="166.5 pt" VALUE_WIDTH="269.24999 pt"/>
378-
<attribute NAME="addons.${name}" VALUE="Tutorial-o-Matic"/>
366+
<node TEXT="en" ID="ID_1258736997">
367+
<attribute_layout NAME_WIDTH="181.49999 pt" VALUE_WIDTH="284.24999 pt"/>
379368
<attribute NAME="addons.${name}.ActionInstruction1" VALUE="&lt;html&gt;In submenu &lt;b&gt;{0}&lt;/b&gt; &lt;br&gt;click on &lt;b&gt;{1}&lt;/b&gt;&lt;/html&gt;"/>
369+
<attribute NAME="addons.${name}" VALUE="Tutorial-o-Matic"/>
380370
<attribute NAME="addons.${name}.ActionInstruction2" VALUE="&lt;html&gt;You can also use de keyboard shortcut &lt;b&gt;{0}&lt;/b&gt; for this command&lt;/html&gt;"/>
381-
<attribute NAME="addons.${name}.executeTutorial" VALUE="execute Demo tutorial"/>
382371
<attribute NAME="addons.${name}.openDemoMap" VALUE="open Demo map"/>
383372
<attribute NAME="addons.${name}.ToMDemo" VALUE="Tutorial-o-Matic Demo"/>
373+
<attribute NAME="addons.${name}.executeTutorial" VALUE="execute Demo tutorial"/>
384374
</node>
385-
<node TEXT="es" ID="ID_1519178718"/>
375+
<node TEXT="es" ID="ID_1964613511">
376+
<attribute_layout NAME_WIDTH="188.24999 pt" VALUE_WIDTH="248.24999 pt"/>
377+
<attribute NAME="addons.${name}.ActionInstruction1" VALUE="&lt;html&gt;En submenu &lt;b&gt;{0}&lt;/b&gt; &lt;br&gt;has click en &lt;b&gt;{1}&lt;/b&gt;&lt;/html&gt;"/>
378+
<attribute NAME="addons.${name}" VALUE="Tutorial-o-Matic"/>
379+
<attribute NAME="addons.${name}.ActionInstruction2" VALUE="&lt;html&gt;Puedes usar también el atajo &lt;b&gt;{0}&lt;/b&gt; para este comando&lt;/html&gt;"/>
380+
<attribute NAME="addons.${name}.openDemoMap" VALUE="abrir mapa demo"/>
381+
<attribute NAME="addons.${name}.ToMDemo" VALUE="Tutorial-o-Matic Demo"/>
382+
<attribute NAME="addons.${name}.executeTutorial" VALUE="ejecutar Demo tutorial"/>
386383
</node>
387-
<node TEXT="deinstall" POSITION="left" ID="ID_378917294">
388-
<edge COLOR="#00007c"/>
389-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
384+
</node>
385+
<node TEXT="deinstall" POSITION="left" ID="ID_378917294"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
390386
<html>
391387
<head>
392388

@@ -411,9 +407,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
411407
<attribute NAME="delete" VALUE="${installationbase}/resources/images/tutorialOMatic-icon.svg"/>
412408
<attribute NAME="delete" VALUE="${installationbase}/resources/images/tutorialOMatic-screenshot-1.png"/>
413409
</node>
414-
<node TEXT="scripts" POSITION="right" ID="ID_1037882722">
415-
<edge COLOR="#007c00"/>
416-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
410+
<node TEXT="scripts" POSITION="right" ID="ID_1037882722"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
417411
<html>
418412
<head>
419413

@@ -531,7 +525,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
531525
</html>
532526
</richcontent>
533527
<node TEXT="openDemoMap.groovy" ID="ID_1629939217">
534-
<attribute_layout NAME_WIDTH="209.24999 pt" VALUE_WIDTH="156.75 pt"/>
528+
<attribute_layout NAME_WIDTH="224.24999 pt" VALUE_WIDTH="171.74999 pt"/>
535529
<attribute NAME="menuTitleKey" VALUE="addons.${name}.openDemoMap"/>
536530
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}"/>
537531
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -543,7 +537,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
543537
<attribute NAME="execute_scripts_without_network_restriction" VALUE="false"/>
544538
</node>
545539
<node TEXT="ToMDemo.groovy" ID="ID_513310589">
546-
<attribute_layout NAME_WIDTH="209.24999 pt" VALUE_WIDTH="156.75 pt"/>
540+
<attribute_layout NAME_WIDTH="224.24999 pt" VALUE_WIDTH="171.74999 pt"/>
547541
<attribute NAME="menuTitleKey" VALUE="addons.${name}.ToMDemo"/>
548542
<attribute NAME="menuLocation" VALUE="${addonsMenu}/addons.${name}"/>
549543
<attribute NAME="executionMode" VALUE="on_single_node"/>
@@ -555,9 +549,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
555549
<attribute NAME="execute_scripts_without_network_restriction" VALUE="true"/>
556550
</node>
557551
</node>
558-
<node TEXT="lib" POSITION="right" ID="ID_1814812956">
559-
<edge COLOR="#7c007c"/>
560-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
552+
<node TEXT="lib" POSITION="right" ID="ID_1814812956"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
561553
<html>
562554
<head>
563555

@@ -597,9 +589,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
597589
<node TEXT="markedj-1.0.16.jar" ID="ID_1060333872"/>
598590
<node TEXT="jsoup-1.10.2.jar" ID="ID_1151792763"/>
599591
</node>
600-
<node TEXT="zips" POSITION="right" ID="ID_1623122610" VGAP_QUANTITY="2 px">
601-
<edge COLOR="#007c7c"/>
602-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
592+
<node TEXT="zips" POSITION="right" ID="ID_1623122610" VGAP_QUANTITY="2 px"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
603593
<html>
604594
<head>
605595

@@ -639,9 +629,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
639629
<node TEXT="icons" ID="ID_211861022"/>
640630
<node TEXT="templates" ID="ID_553385296"/>
641631
</node>
642-
<node TEXT="images" POSITION="right" ID="ID_1856886559">
643-
<edge COLOR="#7c7c00"/>
644-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
632+
<node TEXT="images" POSITION="right" ID="ID_1856886559"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
645633
<html>
646634
<head>
647635

@@ -677,9 +665,7 @@ For each menu item with an icon add an attribute with the icon key (use develope
677665
<node TEXT="tutorialOMatic-icon.svg" ID="ID_1901205001"/>
678666
<node TEXT="tutorialOMatic-screenshot-1.png" ID="ID_791135029"/>
679667
</node>
680-
<node TEXT="actions" POSITION="right" ID="ID_742010356">
681-
<edge COLOR="#00ff00"/>
682-
<richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
668+
<node TEXT="actions" POSITION="right" ID="ID_742010356"><richcontent TYPE="NOTE" CONTENT-TYPE="xml/">
683669
<html>
684670
<head>
685671

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

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ class ToM{
6363
def static getNewPageNodes(nTutorial){
6464
return nTutorial.find{it.style.name == styles.newPage}
6565
}
66+
67+
def static isEditingMode(n){
68+
def nodo = getTutorialNode(n)
69+
return nodo.icons.contains('emoji-1F58D')
70+
}
6671

6772
// end:
6873

@@ -151,14 +156,38 @@ class ToM{
151156
}
152157
}
153158

159+
def static htmlTitle(String texto){
160+
return "<html><style>h1 {color: rgb(240, 240, 240);background-color: rgb(100, 100, 150);display: block;padding: 10px;}</style><body><h1>${texto}</h1></body></html>"
161+
}
162+
154163
def static addPageTitle(myP, String texto){
155-
def html = "<html><style>h1 {color: rgb(240, 240, 240);background-color: rgb(100, 100, 150);display: block;padding: 10px;}</style><body><h1>${texto}</h1></body></html>"
164+
def html = htmlTitle(texto)
156165
myP.add(tomui.createInstructionsPane(html), tomui.GBC)
157166
}
158-
167+
159168
def static addPageTitle(myP, nodo){
160-
addPageTitle(myP, nodo.text)
169+
if (isEditingMode(nodo)) {
170+
def html = htmlTitle(nodo.text)
171+
def bttnText1 = "inspect"
172+
def bttnToolTip1 = "Click to select the page's source nodes"
173+
def bttnAction1 = { e ->
174+
def pageNode = nodo //.parent
175+
def m = c.mapLoader(nodo.map.file).withView()//.selectNodeById(pageNodeId)
176+
m.load()
177+
pageNode.pathToRoot*.folded = false
178+
c.select(pageNode)
179+
}
180+
def bttnText2 = 'reload'
181+
def bttnToolTip2 = "Click to reload '${nodo.text}' section"
182+
def bttnAction2 = { e -> fillPage(myP, nodo, true, true)}
183+
myP.add(tomui.createPageTitlePane(html, bttnText1, bttnToolTip1,bttnAction1,bttnText2,bttnToolTip2,bttnAction2), tomui.GBC)
184+
} else {
185+
addPageTitle(myP, nodo.text)
186+
}
161187
}
188+
189+
190+
162191

163192
def static addNextPagePane(myP, lastNode, boolean included = false, boolean showNextButton = true){
164193
def closeLabel = 'Stop tutorial'

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,40 @@ class ToM_ui{
211211
sp.viewport.add(panel)
212212
return sp
213213
}
214-
214+
215+
def static createPageTitlePane(String htmlMsg, bttnText1, bttnToolTip1,bttnAction1,bttnText2,bttnToolTip2,bttnAction2){
216+
def panel = swing.panel() {
217+
borderLayout()
218+
editorPane(
219+
editable : false,
220+
contentType : "text/html",
221+
text : htmlMsg,
222+
margin : new Insets(30,10,30,10),
223+
border : new EmptyBorder(5, 10, 5, 10), // <------- éste
224+
//border: new CompoundBorder(new LineBorder(Color.green, 1),new EmptyBorder(5, 10, 5, 10)), // éste es de prueba poder ver el borde
225+
constraints : CENTER,
226+
clientProperties: [(JEditorPane.HONOR_DISPLAY_PROPERTIES):true]
227+
)
228+
vbox(constraints:WEST) {
229+
button(
230+
label : bttnText1,
231+
// constraints : WEST,
232+
// margin : new Insets(10,15,10,15),
233+
toolTipText : bttnToolTip1,
234+
actionPerformed : bttnAction1,
235+
)
236+
button(
237+
label : bttnText2,
238+
// constraints : EAST,
239+
// margin : new Insets(10,15,10,15),
240+
toolTipText : bttnToolTip2,
241+
actionPerformed : bttnAction2,
242+
)
243+
}
244+
}
245+
return panel
246+
}
247+
215248
// genera panel con botón
216249
def static createButtonPanel(htmlMsg, buttonLabel, buttonToolTip, buttonAction, boolean isToggleButton = false){
217250
def panel = swing.panel(

Tutorial-o-Matic/translations/en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Sun Feb 27 18:12:08 CLST 2022
1+
#Wed Mar 02 21:33:10 CLST 2022
22
addons.${name}.ActionInstruction1=<html>In submenu <b>{0}</b> <br>click on <b>{1}</b></html>
33
addons.${name}=Tutorial-o-Matic
44
addons.${name}.ActionInstruction2=<html>You can also use de keyboard shortcut <b>{0}</b> for this command</html>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
#Sun Feb 27 18:12:08 CLST 2022
1+
addons.${name}.ActionInstruction1=<html>En submenu <b>{0}</b> <br>has click en <b>{1}</b></html>
2+
addons.${name}=Tutorial-o-Matic
3+
addons.${name}.ActionInstruction2=<html>Puedes usar también el atajo <b>{0}</b> para este comando</html>
4+
addons.${name}.openDemoMap=abrir mapa demo
5+
addons.${name}.ToMDemo=Tutorial-o-Matic Demo
6+
addons.${name}.executeTutorial=ejecutar Demo tutorial
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=v0.0.5
2-
downloadUrl=https://github.com/EdoFro/Freeplane_Tutorial_AddOn/releases/download/v0.0.5/Tutorial-o-Matic-v0.0.5.addon.mm
1+
version=v0.0.6
2+
downloadUrl=https://github.com/EdoFro/Freeplane_Tutorial_AddOn/releases/download/v0.0.6/Tutorial-o-Matic-v0.0.6.addon.mm
33
freeplaneVersionFrom=v1.9.9

0 commit comments

Comments
 (0)