Hi,

there is a problem with the note window: it is implemented as a plug-in, 
and information about the status of the note window is its internal 
information. I do not see how to install a listener communicating the 
note window status to the gui without changing the general plug-in 
framework design or introducing some bad hacks.

IMHO the problem is coursed by the plug-in design: the main purpose of 
the plug-ins is introducing of the new user actions and gui elements. 
But there is no direct connection between gui elements and the plug-ins.
In particular case of the NodeNote we have following call stack when the 
note window should be shown as a result of user action "Show/Hide Note 
Window":

NodeNoteRegistration.showNotesPanel() line: 277 
NodeNote.getSplitPaneToScreen(NodeNoteRegistration) line: 94    
NodeNote.startupMapHook() line: 72      
MindMapNodeModel(NodeAdapter).invokeHook(NodeHook) line: 818    
NodeHookAction.invoke(MindMapNode, List, String) line: 177      
NodeHookAction.addHook(MindMapNode, List, String) line: 97      
NodeHookAction.invoke(MindMapNode, List) line: 138      
NodeHookAction.actionPerformed(ActionEvent) line: 74    
JMenuItem(AbstractButton).fireActionPerformed(ActionEvent) line: 1995   


Let me explain:

The action NodeHookAction is defined in the plug-in framework. It starts 
  method "invokeHook" of the mind map. (which does not follow the swing 
convention where ActionListener becomes information about the origin of 
the event). The NodeNote object is stateless, it is created by the 
NodeHookAction every time the action is called. After creation its 
method startupMapHook() is called. Here it obtains the 
NodeNoteRegistration object created at the time of plug-in creation from 
the MindMapHookFactory (once for every opened map). The 
NodeNoteRegistration object is stateful, it controls the note window. 
And I do not know how to install a listener for communicating changes of 
this state to the gui elements without referencing internal plug-in 
classes not belonging to the plug-in interface.

So I think that this indirect and not transparent logic should be better 
explained and documented and probably simplified in the 0.10.0. Chris 
can help us here, because he is likely to understand this design better 
than somebody else.

But now I would like to ask you whether I should provide the checking 
mark for the rest menu items.

Dimitry



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Freemind-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemind-developer

Reply via email to