Skip to content

Commit 15db6d0

Browse files
committed
WIP
1 parent 5859814 commit 15db6d0

File tree

4 files changed

+36
-31
lines changed

4 files changed

+36
-31
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
<node TEXT="- better scrollspeed&#xa;- message when command no present in Menu for active map&#xa;- added execute_scripts_without_network_restriction: true so web images could be loaded&#xa;- improved showMenu to show actions in extended submenus&#xa;- changed &apos;Close tutorial&apos; to &apos;Stop tutorial&apos;&#xa;- tables have now black borders&#xa;- Codeblocks have special style in EditorPanes&#xa;- links in EditorPanes are now clickeable and open the default web browser&#xa;- added a listener to resize height of content panel when tabpanel width changes&#xa;- added newPage styles and functionality&#xa;- added Table of Contents styles and functionality&#xa;- added Table of Contents button to &apos;next page&apos; panel&#xa;- added GOTO style and its functionality&#xa;- added Action style and its functionality&#xa;- added groovy style and its functionality&#xa;- enables multiple tutorials in one map&#xa;- added &apos;copy&apos; style and its functionality&#xa;- added &apos;select&apos; style and its functionality&#xa;- added &apos;openMap&apos; style and its functionality&#xa;- added &apos;inspect tutorial map&apos; functionality" ID="ID_1550125378"/>
177177
</node>
178178
<node TEXT="v0.0.4" ID="ID_1654795865">
179-
<node TEXT="- corrected link to version.properties&#xa;- information of pasted nodes now is saved in each map for later exersizes and multiple exercizing maps&#xa;- added &apos;go back&apos; when using &apos;GOTO&apos; panes&#xa;- added &apos;show node from map&apos;" ID="ID_312985717"/>
179+
<node TEXT="- corrected link to version.properties&#xa;- information of pasted nodes now is saved in each map for later exersizes and multiple exercizing 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" ID="ID_312985717"/>
180180
</node>
181181
</node>
182182
<node TEXT="license" FOLDED="true" POSITION="left" ID="ID_624388795">

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

Lines changed: 0 additions & 24 deletions
This file was deleted.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ class ToM{
162162
def static addNextPagePane(myP, lastNode, boolean included = false, boolean showNextButton = true){
163163
def closeLabel = 'Stop tutorial'
164164
def closeToolTip = 'Click to stop the tutorial and close the tutorial tab'
165-
def nextLabel = 'Next page'
166-
def nextToolTip = 'Click to continue to the next page of the tutorial'
167-
def bttnAction = showNextButton? { e -> fillPage(myP, lastNode, included, true) } : null
165+
def nextLabel = showNextButton?'Next page':'Show tutorials'
166+
def nextToolTip = showNextButton?'Click to continue to the next page of the tutorial':'Click to see the list of tutorials'
167+
def bttnAction = showNextButton? { e -> fillPage(myP, lastNode, included, true) } : { e -> showTutorials(lastNode.mindMap) }
168168
def tocLabel = 'Table of Contents'
169169
def tocToolTip = 'Click to show the Table of Contents of the tutorial'
170170
def tocBttnAction = { e -> showTOC(myP,lastNode) }

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

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package edofro.tutorialomatic
22

33
//region: imports
44
import edofro.tutorialomatic.TabPane
5-
import edofro.tutorialomatic.CustomComponentListener
5+
//import edofro.tutorialomatic.CustomComponentListener
66

77
import java.util.Timer
88

@@ -185,6 +185,12 @@ class ToM_ui{
185185
layout: new GridBagLayout(),
186186
// background: Color.gray
187187
){}
188+
def sp = createScrollPaneForContentPane(contentPane)
189+
TabPane.addTab(tabName, sp)
190+
return contentPane
191+
}
192+
193+
def static createScrollPaneForContentPane(contentPane){
188194
contentPane.addComponentListener(new CustomComponentListener())
189195
def panel = swing.panel(
190196
layout: new GridBagLayout(),
@@ -194,8 +200,7 @@ class ToM_ui{
194200
def sp = swing.scrollPane(){}
195201
sp.verticalScrollBar.unitIncrement = 16 //.getVerticalScrollBar().setUnitIncrement(16)
196202
sp.viewport.add(panel)
197-
TabPane.addTab(tabName, sp)
198-
return contentPane
203+
return sp
199204
}
200205

201206
// genera panel con botón
@@ -396,4 +401,28 @@ class ToM_ui{
396401

397402
//end:
398403

404+
405+
//region: Listeners
406+
407+
// Listener for Tutorial Tab pane so it gets resized (enough length) each time its width gets modified
408+
static class CustomComponentListener implements ComponentListener {
409+
public void componentResized(ComponentEvent e) { //https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html
410+
def comp = e.component
411+
//ToM_ui.resizeContentPanel(comp, tomui.maxContentPaneHeigth)
412+
sleep(100)
413+
ToM_ui.resizeContentPanel(comp, comp.height + 500)
414+
// TabPane.repaint()
415+
}
416+
public void componentMoved(ComponentEvent e) {
417+
// e.source.title = " moved. "
418+
}
419+
public void componentShown(ComponentEvent e) {
420+
// e.source.title = " shown. "
421+
}
422+
public void componentHidden(ComponentEvent e) {
423+
// e.getSource().title = " hidden. "
424+
}
425+
}
426+
427+
//end:
399428
}

0 commit comments

Comments
 (0)