Activity for Jochen Kall

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Interesting discussion, I guess ribbons are a bit of a red cloth for a lot of people. I must admit, not a big ribbon fan myself, stuff never seems to be where I expect it to be in MS Office at least, so more often than not I end up iterating all ribbons till I finally find what I'm looking for :D It did make we wonder though, which part of the freeplane toolbars do I actually use, and it turns out its pretty much the filtering and finding toolbar exclusively, all the other functions I either rarely...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Dimitry, A good case can be made for either logic in my opinion, depending on how freeplane is used. I bumped into this behaviour before as well and assumed it to be intentional to let the user have the last word, and avoid the awkward scenario where one manually changes formatting of a node and nothing happens because it is overwritten by a conditional style the user might not even know about. (e.g. when using a template someone else provided or collaborates with others on a map or continues...

  • Jochen Kall Jochen Kall modified a comment on discussion Open Discussion

    Hm, can't reproduce the problem, your script runs fine for me, we are on different Freeplane versions though. (Yours is 1.9.8, I'm still on 1.9.0) Error sounds like you are feeding the setters a long integer variable, but it expects normal integers. (can't tell for sure, your map links to images on your harddrive unfortunately ;) Try converting explicitly to integer, might help delta_x=node['dX'].toInteger() delta_y=node['dY'].toInteger() pos_x=node['pX'].toInteger() pos_y=node['pY'].toInteger()...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hm, can't reproduce the problem, your script runs fine for me, we are on different Freeplane versions though. (Yours is 1.9.8, I'm still on 1.9.0) Error sounds like you are feeding the setters a floating point variable, but it expects integers. (can't tell for sure, your map links to images on your harddrive unfortunately ;) Try converting explicitly to integer, might help delta_x=node['dX'].toInteger() delta_y=node['dY'].toInteger() pos_x=node['pX'].toInteger() pos_y=node['pY'].toInteger() Let me...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi sfpcom, I don't think freeplane supports such grid layouts natively, but placing nodes freely via the scripting API is easy enough. Best method probably is to have a script copy nodes instead of messing with your original map, that way you don't have to worry about restoring the original layout afterwards, instead the whole matrix simply gets deleted once you are done with it. Algorithm wise this is straight forward too, I whipped up the prototype below, seems to do what you want. Have fun Jochen...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi SFPC Took me quite a while to understand what you are trying to do here... Lets take a look at it step by step. First thing is to mark nodes that have invalid references, my guess is a reference is invalid if there is no node in the map, that has the referenced Col/Row property In that case, you can just slap on a map style with a script filter condition, like this: if (node.attributes.names.contains('Row') || node.attributes.names.contains('Col')) { c.find{it['RefCol']==node['Col']}.isEmpty()...

  • Jochen Kall Jochen Kall posted a comment on ticket #2949

    Hi Edo, that solves half the issue, so adding the trailing "/" indeed fixes the broken link icon. The issue leading to the link being broken remains though, and is reproducable, did you try adding a link to the parentfolder of a mindmap? Since I can repreduce this behaviour on three different machines with two different OS I was pretty certain that adding a link to the folder that contains the map always creates a broken hyperlink.

  • Jochen Kall Jochen Kall created ticket #2949

    Link to folder parent folder of mind map is broken

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi there Alexandre, you need to be a bit more specific, for people to help you, I think. Are you talking about removing clones? Or is it nodes that just happen to have the same text/details whatever, that you want to remove? Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi lilive, yap, ON_SINGLE_NODE is correct of course, I was trying to get it done with a one liner using an ON_SELECTED_NODE trigger at first, and forgot switching it back when I changed it following the realization that it won't be possible to retain the selection that way :P

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Alexandre, once you obtained the nodes from the IDs as described above, using c.select() fails with nullpointer exception, if the map the nodes belong to is not active, so Edos hunch was right. I don't know how to activate a map via script though. Just modifying nodes in non active maps works fine, like this code for instance changes the root node text for all open maps. c.getOpenMaps().each{it.root.text='bla'}

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    You did it, nice! Seeing the code I thought, maybe it can be done in a bit more groovy compact fashion, so not to show off or anything, here is a one liner version :) c.select(node.findAll().collect{it.plainText.split(',')}.flatten().collect{N(it.trim())}-null) Happy coding Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    This is N('ID') notation is news to me, very cool. Btw, if you know the ID of your node while writing your script you can address it directly as a variable like this from within your script: ID_1049517982.text="something" I use that all the time for debugging ^^

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    thanks Edo, yes, that's it, we are talking about different dialogs after all :D So that's the trick, I never used that dialog before tbh, definitely works though, thanks. Do you know the the reason why script filters are not available for map styles, by any chance? While I think I can maybe work around this limitation with some groovy scripting, having it in the map styles filter composer would make things so much easier. Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Dimitry, I don't use connectors much yet, so quite possibly my stance does not reflect most peoples use case of freeplane. That being said the first option, i.e. always taking the style from the source node without the ability to change it, would be a no go for me, since it takes away the control from the user, for not much benefit in terms of map automation. So the second option is clearly the one I'd prefer between the two, especially since it removes the source of confusion of having the connector...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Edo, that's great! Solves a major headache, but now I'm quite confused. I just checked with the newest 1.9.1 and I still don't get the script filter for conditional styles, do I need to have some specific setting for this? Ubuntu unfortunately won't let me take a screenshot while the combobox is unfolded, so I made a dummy filter of all different filter types the dialog offers me, see attachment. Basically, the only conditions I can make are: Core, details, or note Core text Details Note Parent...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Dimitry, played with it some more, you are right on both topics, it works as you wrote it would. Regarding the connector style, I must admit, what threw me off there is, that the connector style is attached to a specific style node in the style editor, so I assumed it would be applied to all incoming connections to nodes with that style automatically.

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Dimitry, I gave the latest build a try (freeplane-1.9.1-pre02) Stuff I noticed: 1. I set some text in the new connector style dialog (beginning, middle, end of the connector), and while the texts do show up in the style editor, they do not render in the actual map for me 2. The menu "Manage followed Mindmap" is greyed out, do I need to activate that feature somehow, or is that a bug? I also added the missing German translation strings along the way, but there are still some left I can't find in...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi everyone, I've been tinkering with conditional styles, and came across the following problem: I'd like to apply a style to a node based on a condition that involves the style of the parent node. Unfortunately unlike the very similar user filter dialog, the conditional style dialog does not offer a script filter option. So far I made a workaround with a dependent node property calculating the condition, but that clutters my map with these properties, which I'd rather avoid for usability reasons....

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi lilive, now I get it, guess there is no more elegant way that preserves order and selection while moving nodes like that. Well one more thing caught my eye, the way you implemented it doesn't work properly if the selected nodes don't share the same parent node, since it moves all selected nodes to the parent of the node the script actually executes on. Small tweak to fix that: // @ExecutionModes({ON_SELECTED_NODE}) nodes=c.getSortedSelection(true) nodes.reverse().each{it.moveTo(it.getParent(),0)}...

  • Jochen Kall Jochen Kall modified a comment on discussion Open Discussion

    Hi lilive, when I saw your post I remembered I had the same problem a while ago and found an API for that: node.moveTo(node.getParent(),-1) // moves node to last position node.moveTo(node.getParent(),0) // moves node to first position [edit] scrap that , you use moveTo already in the script :D sorry about that, then I don't think I understand the problem yet you are solving. Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi lilive, when I saw your post I remembered I had the same problem a while ago and found an API for that: node.moveTo(node.getParent(),-1) // moves node to last position node.moveTo(node.getParent(),0) // moves node to first position Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Peter, Not sure if there is an API for hiding/unhiding nodes, I didn't see anything either in the API doc, but you can simply select the nodes to hide and then execute the menu item with groovy like this: c.select(nodes_to_hide) menuUtils.executeMenuItems(['NodeEnumerationAction.NodeVisibility.HIDDEN']) To find the correct key for any menu item, you can use the Developer Tools add-on as described here: http://www.freeplane.org/wiki/index.php/Script_incubator#How_to_call_freeplane_menu-items_from_groovy_script...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Thanks Edo, Selective blindness I guess... there it was staring in my face and I didn't see it :/ Works perfectly, awesome. Sorry for wasting your time ^^ Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Edo, of course, I attached a minimal example map

  • Jochen Kall Jochen Kall modified a comment on discussion Open Discussion

    Hi everyone, I'm having a very specific filtering in mind, and it looks like it is not possible with the current filtering options in freeplane. What I'd like to do is to hide all nodes that fulfill a condition or are in a subtree of a node that fulfills the condition, and I can't define a filter like that with the filter wizard since the filter always operates on each node. So even by inverting and hiding descendants, the children still are shown since they themself of course don not fulfill the...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi everyone, I'm having a very specific filtering in mind, and it looks like it is not possible with the current filtering options in freeplane. What I'd like to do is to hide all nodes that fulfill a condition or are in a subtree of a node that fulfills the condition, and I can't define a filter like that with the filter wizard since the filter always operates on each node. So even by inverting and hiding descendants, the children still are shown since they themself of course don not fulfill the...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Edo, nice work, bookmarked for later use ;) When looking at your code, I thought, wouldn't it be easier to store the last known path in the map data instead of a node attribute? No need for searching, and dialogs and almost no risk for accidentally messing with the path either that way. node.map.storage["lastLocAttr"] Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Everyone, I'm implementing a special paste functionality, that pastes nodes from the clipboard and directly performs some manipulations of the contents. Luckily there is a script (Nr 38) in the script collection http://www.freeplane.org/wiki/index.php/Scripts_collection#Access_nodes_from_clipboard providing access to the nodes in the clipboard, great Unfortunately the script is outdated, it seems the underbelly of freeplane has changed in the meantime regarding how the clipboard is accessed. So...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Nice find Edo, interesting. I played with it a bit, it does work, but it only gives the information which part of the node was changed. Also no oldvalue & newvalue, so use is quite limited. It is significantly simpler than the INodeChangeListener though, here is a code snipped how to use that api for logging all the information given to the listener: import org.freeplane.api.NodeChangeListener import org.freeplane.api.NodeChanged class MyNodeChangeListener implements NodeChangeListener { public void...

  • Jochen Kall Jochen Kall modified a comment on discussion Open Discussion

    Hi Edo, thanks for the input. I'll give it a shot, don't think that's the issue though, I'll run it without the recursion breaker just to be sure, it is superfluous for the debug listener anyways. Update: ran it without the recursion breaker, no change If you look at the log above the debug listener wrote when I changed an attribute, the listener gets indeed triggered twice, first for the "HistoryInformationModel" which works fine, and then once more for the "NodeAttributeTableModel" and for that...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Edo, thanks for the input. I'll give it a shot, don't think that's the issue though, I'll run it without the recursion breaker just to be sure, it is superfluous for the debug listener anyways. If you look at the log above the debug listener wrote when I changed an attribute, the listener gets indeed triggered twice, first for the "HistoryInformationModel" which works fine, and then once more for the "NodeAttributeTableModel" and for that one, the oldvalue and newvalue parameters in the NodeChangeEvent...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Biswajit, you're welcome. To be honest, I also had no idea selectMultipleNodes() behaves like that either, it is not mentioned in the API documentation, but Freeplane is pretty awesome for quick and dirty debugging, all you need to do is add this line to your script: node.createChild(nodeList) That tells you all you need to know, the rest is poking selectMultipleNodes(), using unique() is just an obvious workaround once the behavior is understood ;) Happy coding Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Biswajit, This is a nice one. As with all good bugs, it looks correct at first glance. Took a bit of tinkering to figure this out, but basically two things go wrong here at once 1) This code gets executed several times, once for each node selected, you only want it to trigger once, so // @ExecutionModes({ON_SINGLE_NODE}) should be used instead 2) c.selectMultipleNodes() appearently does not like it when the argument contains nodes more than once. In that case, it seems the first node gets selected...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi echo21 Indeed, this looks very much like the listener problem I encountered in the thread lilive linked. From what I see you want to do (reacting to changing a node by changing the link) this should do the trick. The code I posted at the end of the thread is a workaround for reacting to changes in specific user defined properties, if you don't need that, lilives method is all you need. Regards Jochen

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi again, Thanks lilive, your way of getting the node from the nodeModel is quite a bit more elegant than mine. I did tinker some more with this stuff, but I still couldn't get it to work for dynamic node properties as I showed yesterday. So I took a step back and made it work with shadow copies of node properties to be reacted on. Has the drawback of the shadow copies being created and cluttering the nodes, but it works nicely for my use case at least, since I hide the node properties behind a little...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi Dimitry, thanks for taking the time. I tried changing stuff in the NodeModel directly and changes do indeed only show up after a refresh is triggered, so I dropped that approach, since lilives suggestion worked great and made it unnecessary anyways What I still can't figure out is which attribute was changed, let me show you what I mean. I made the following quick and dirty listener to get a log of what happens when I change a Node class MyNodeChangeListener implements INodeChangeListener { boolean...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi lilive, brilliant, that's a winner. With this pattern making changes to nodes from within a listener becomes trivial, It doesn't even require sidestepping the API by making the modifications through SkriptUtils as usual. Here is my demo code for the next person to run into that problem. import org.freeplane.features.map.INodeChangeListener import org.freeplane.features.map.NodeChangeEvent import org.freeplane.features.map.NodeModel import org.freeplane.features.mode.Controller import org.freeplane.plugin.script.proxy.ScriptUtils...

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi lilive, thanks a lot for the explanation, that explains the effect. With normal groovy scripts I just use the groovy console and and the API documentation to figure stuff out interactively in the traditional trial and error way, but with this listener I'm flying mostly blind :/ Well, I'd very much prefer to get this done without poking around the underbelly of freeplane too much, if it can be helped. Won't make for a reliable add-on if it potentially breaks whenever the freeplane version changes....

  • Jochen Kall Jochen Kall posted a comment on discussion Open Discussion

    Hi everyone, I have been trying to get Freeplane (Most useful tool I came across in a long while btw!) to change attributes of a node in reaction to a node being changed by the user. If I understand correctly, registering a NodeChangeListener is the way to do that, but for some reason I can't get it to work. What puzzles me is that I can in fact change the text of a node that way but neither attributes nor other node properties like the details can be changed by my NodeChangeListener (see attached...

1