Development: Difference between revisions

From FreeMind
Jump to navigationJump to search
No edit summary
 
(145 intermediate revisions by 23 users not shown)
Line 1: Line 1:
<table><tr>
<table><tr>
<td valign=top>
{{Navigation_bar}}
<td>&nbsp;
<td width=600>
<td width=600>


<b>The development</b> of FreeMind is coordinated using FreeMind's [http://sourceforge.net/projects/freemind/ project page] at SourceForge, and also using this wiki. At wiki, we have '''[[requests for enhancements]]''' page; there is also [http://sourceforge.net/tracker/?group_id=7118&atid=357118 requests for enhancements] (RFEs) page at SourceForge (not preferred). You can [http://freemind.cvs.sourceforge.net/freemind/ browse CVS repository].
The development of FreeMind is coordinated using FreeMind's [http://sourceforge.net/projects/freemind/ project page] at SourceForge, and also using this wiki. At wiki, we have '''[[requests for enhancements]]''' page; there is also [http://sourceforge.net/tracker/?group_id=7118&atid=357118 requests for enhancements] (RFEs) page at SourceForge (not preferred). You can [http://freemind.git.sourceforge.net/git/gitweb.cgi?p=freemind/freemind;a=summary browse] our new [[GIT]] repository.


We also use SourceForge for [http://sourceforge.net/tracker/?group_id=7118&atid=107118 bugs],  and [http://sourceforge.net/forum/forum.php?forum_id=22101 open discussion forum]. We do not use the documentation part there as we use this wiki instead.
We also use SourceForge for [http://sourceforge.net/tracker/?group_id=7118&atid=107118 bugs],  and [http://sourceforge.net/forum/forum.php?forum_id=22101 open discussion forum]. We do not use the documentation part there as we use this wiki instead.


== Getting started as a developer or tester ==
==Contributing to FreeMind==


=== To get the latest beta version of FreeMind ===
See [[Contributing]].


You can get the beta version from the CVS. Look under branches. Observe, that these versions are not official releases
==Getting started as a developer==
and may admit serious errors. Please, use them only if you urgently need a feature included in such a version
or to give us feedback to our development which is highly appreciated.


=== To compile FreeMind on your own ===
See [[Getting started as a developer]].


If you are a developer, just download the sources, unpack them,
==Getting started as a tester==
find the folder with the file build.xml, and execute the command
<code>ant</code> in that folder. For more detail description
see the [http://freemind.sourceforge.net/docs/compile/windows/Quick%20guide%20to%20compiling%20Freemind%20on%20an%20XP%20system.html Quick guide to compiling Freemind on an XP system using Eclipse] prepared for you by Bob Alexander.


Broken down into simple steps, a simple way for a developer of compiling FreeMind is perhaps the following.
See [[Getting started as a tester]].


# install [http://java.sun.com/javase/downloads/index.html Java SDK] &mdash; standard development kit
==Reporting bugs==
# install [http://ant.apache.org/ Ant] &mdash; a tool for building code using complicated make files)
# download FreeMind's [http://sourceforge.net/project/showfiles.php?group_id=7118 source code]  as published in the Files section
# unpack the source code package with the extension <code>tar.gz</code>
# change directory to the one where <code>built.xml</code> file resides &mdash; the build file for Ant, similar to make files for the C language
# type <code>ant</code> in the command shell


=== To set up a FreeMind project under Eclipse ===
See [[Reporting bugs]].


You download FreeMind to ~/src/freemind say.
==Organization of FreeMind development==
Then, you have to compile FreeMind on command line using "ant dist".
After that you open a new project with working directory ~/src you should find the following settings:


* The binaries are stored into ~/src/bin/classes.
Initially, every active developer of the core team works on his own GIT branch. Our intermediate results are
* You have two source folders.
published as our "alpha versions". We use forum [http://sourceforge.net/forum/forum.php?forum_id=22101 Open Discussion] to communicate them.
* All jars you find in ~/src/freemind are added to the project.


Then finish the project settings and there should be no errors in the project. You can run FreeMind starting the class <code java>freemind.main.FreeMind</code>.
Further details about the FreeMind release process are described on the FreeMind [[Release process]] page.


=== Further development wiki pages ===
==Experimental versions==


Further reading (still under construction):
Currently, there are no experimental versions available. The latest release candidate can be downloaded from [http://sourceforge.net/project/showfiles.php?group_id=7118 Files section].


* [[FreeMind Actions]]
==Obtaining focus for selected node in reliable manner==
* [[Plugins]]
* [[Undoable Actions]] (first version available)
 
=== To use concurrent version repository (CVS) with Eclipse ===
 
See [http://freemind.sourceforge.net/docs/Using%20CVS%20via%20Eclipse/index.html Using CVS from within Eclipse] guide by Bob Alexander.
 
When working with CVS, remember that it is difficult to change directory and file names under CVS. Moreover, it not easy to remove files completely. Therefore, pay attention when checking files in.
 
=== Becoming a developer ===
 
New developer starts by sending his contributions as patches. Later on, he may get access to CVS repository. The process is approximately as follows.
 
* Create a user account at SourceForge. 
* Discuss the change, feature or bug in our [http://sourceforge.net/forum/forum.php?forum_id=22101 open discussion forum].
* If the topic is accepted, start to change the actual CVS code.
* Post your contribution in the patch section of SourceForge or send it by email to the current project manager. We do not respond immediately, as FreeMind team consists of volunteers.
* After having successfully developed and integrated some items, you get access to FreeMind's CVS repository at SourceForge.
 
=== Development resources ===
 
* [http://freemind.sourceforge.net/javadoc/index.html API documentation] (javadoc)
* [http://freemind.sourceforge.net/Freemind-development.html Obsolete development mind map]
* [http://freemind.sourceforge.net/Freemind-development.mm Obsolete development mind map for download]
* [http://freemind.sourceforge.net/Freemind-development-exported.html Obsolete development mind map exported to HTML with folding]
 
=== Getting the latest CVS branch ===
 
The latest integration branch is ''fm_060405_integration''. The last release has tag ''FM-0-8-0''.
 
== How the FreeMind development is organized ==
 
Initially every active developer works on his own branch. Our intermediate results are
published as our "alpha versions". We use forum [http://sourceforge.net/forum/forum.php?forum_id=22101 Open Discussion] and section [[Experimental_versions]] on this wiki page to communicate them.
 
Only after this partial developments are finished, they can me merged together.
The resulting version is expected to work with all maps created by all versions,
which are merged into it, but we can not assure it in any particular case.
 
The merged versions are published as Release Candidates and are released.
 
An alternative to this development scheme would be not to publish the
intermediate versions, and I think the current method is probably a better one.
 
=== Experimental versions ===
 
Currently, there are the following experimental versions available. They are not meant for productive use; use at your own risk!
 
==== FreeMind with  Node Attributes and Map Filters ====
Attaching of named attributes to every node, filtering of the displayed map content based on node text, node icons and node attributes
* [http://sourceforge.net/forum/forum.php?thread_id=1454779&forum_id=22101 Actual discussion forum thread]
* [http://sourceforge.net/forum/forum.php?thread_id=1272052&forum_id=22101 Old discussion forum thread]
* [http://freemind.sourceforge.net/dimitri_testversions/0_8_FA/  Screenshots and Downloads]
 
==== FreeMind with  WYSIWYG rich text node editor ====
* [http://sourceforge.net/forum/forum.php?thread_id=1425434&forum_id=22101 Discussion forum thread]
* [http://freemind.sourceforge.net/dan_test_versions/ Downloads]
 
==== FreeMind Browser Applet for FreeMind 0.8 ====
* [http://sourceforge.net/forum/forum.php?thread_id=1420558&forum_id=22101 Discussion forum thread]
* [http://freemind.sourceforge.net/testversions/ Downloads]
 
=== Alpha, Beta and Release Candidate ===
 
I propose the following definitions of labels alpha, beta, and release candidate.
 
* ''Alpha'' is a purely test version. Absolutely no guarantee is made on how it's going to work, keep data format of FreeMind mind maps, and the like. Users of alpha are people who want to help in the development process of FreeMind by reporting bugs in early unstable versions, or who want to influence in which direction the alpha will be finetuned.
* ''Beta'' is a version with known old and newly introduced bugs, with many fixes pending. Maps saved from betas should ideally be readable by later versions. Thus, allocating label beta requires considerable attention.
* ''Release Candidate'' is a version in which there are neither errors nor changes pending that the developers would know of at the date of publishing.
 
--[[User:Danielpolansky|Danielpolansky]] 04:49, 29 Apr 2006 (PDT)
 
== Conceptual remarks ==
 
=== Modular model - view design ===
 
The architecture of FreeMind makes it possible that FreeMind becomes general tool for editing tree-structured data, that is mind maps, XML/HTML documents, folder trees etc. in future.
 
All these kinds of data would be presented to the user as a mind map. Model-View-Controller design makes it possible for you only to write so called model of the data structure, without caring for the visual representation. Currently, mind map mode and file mode are implemented.
 
=== Original vision of Joerg Mueller ===
 
Joerg Muller is the original author of FreeMind, developing it up to the version 0.4.0. Here follows what he's got to say on his original vision:
 
: What I had in mind when I began to write FreeMind, was creating a collaborative mind where people can intuitively share their ideas, knowledge and thoughts with each other. Of course FreeMind is only a first step into this direction, but I did this first step. Now a Mode must be implemented that makes collaboration over the Internet possible, maybe using the Topic-Map standard. I think linear text is a very poor way of representing knowledge, and by using trees and networks, visual representation, internet collaboration and open source we should be able to create some kind of a collaborative mind.
 
: FreeMind now has evolved from a specific Mind Map Editor to a generic editor for tree structured data. I want FreeMind to become for tree structured data what emacs is for linear data (ie. text).
 
One may think of extending FreeMind to work with networks as opposed to trees only, an example of this being Topic Maps (ISO).
 
Daniel Polansky: Joerg's vision of FreeMind becoming Emacs for tree data is intriguing, but rather far fetched at the time. You would need to provide scripting facility and at least many basic operations, like upcase, downcase, replace and many others. It is even not evident that this goal valuable compared to other goals - there many quite obvious and still missing features.
 
=== Why not use OPML for storage instead of FreeMind's native XML format ===
 
The current version of [http://www.opml.org/ OPML] is not suited for our purposes. It should be easy to create conversion XSLT between FreeMind and OPML. First, if we decided to use OPML, we would have to wait until the owner of OPML changes his standard to fit our needs. Thus, we would be dependent, not being able to act dynamically. Second, already the current version of OPML is insufficient. It does not contain most of what FreeMind already uses: colors, fonts, folded tag, edges and icons. It is not a superset of FreeMind's XML format, even not in a vague sense. Even if I renamed the elements names properly, OPML would still be a subset and not superset of FreeMind's XML. As a result, we have no benefit from using OPML right now.
 
''Summary:'' 1) we would run into dependence, and 2) OPML is insufficient, loosely speaking it is a subset.
 
=== Why may FreeMind be more relevant than some other open source applications ===
 
There are many efforts to create new text editors, text processor and the like. While this activity is not without value, it does not fill that big value gap as mind mapping application.
 
Take, for instance, text editors like JEdit. There are already well estabilished text editors like Emacs or Vim, and there are many others. It's not that these editors would be perfect, far from that, but they're still pretty useful and with some training users can become very efficient with them.
 
With text processors, the thing is that most users in companies have already Microsoft Office for free. What does that mean? That means that the individual users do not have to pay for the MS Office, and they cannot effectively decide to use other Office platform either because of the value of easy sharing. Furthermore, there are competing free Office platforms like KOffice, OpenOffice or AbiWord.
 
In mind mapping, the situation is quite different. You do not get commercial alternative granted in companies, unlike office applications. The point here is that most of MS Windows users, the mainstream, do not have a mind mapping application yet. For them, starting to use FreeMind is not a switch from Microsoft product to alternative product. It is a switch from scattered documents in incomparable and hard-to-overview formats to one document with unprecedented order and transparency - FreeMind's mind map.
 
Therefore, I am expecting a growth of interest of free developers in developing and using this application.
 
Furthermore, even though Java is quite slow and memory hungry, it solves the neverending quarrel between religious die-hard fans of different computing platforms, which I have first experienced with Atari 800 XL versus Commodore 64 battle, later IBM compatible versus Commodore Amiga battle, and nowadays Windows versus Linux battles.
 
== Misc ==
 
=== To create a new release ===
 
To succesfully complete a new release, do the following
 
* upload the release files into /incoming at ftp:upload.sourceforge.net , use the user anonymous and your e-mail address as a password
* create new release. The files you have uploaded with ftp will be offered to you. Releases have names like "0.6.1", "0.6.5".
* update the home page so that it points to the new version of installation files
* post news, listing the most important changes of the new version
* repost the news to the Announce forum, with basically the same text
* repost the news the mailing list freemind-users@lists.sourceforge.net
 
Notice that the news cannot be monitored unlike forum, and forum has no RSS
feed unlike news.
 
=== To create proper copyright notice ===
 
A source file may be viewed as a sum ''b'' + ''d<sub>1</sub>'' + ''d<sub>2</sub>'' + ... + ''d<sub>k</sub>'', where ''b'' is the basis, ''d<sub>i</sub>'' are deltas (or patches), and the plus operator is the operator of applying a patch. The basis and each delta have their own copyright holder and the year of copyright.
 
If there is only one autor and one year, then the copyright notice is simple.
 
If there is only one autor and more years, then the copyright notice may look like
 
<blockquote>
Copyright © 2003-2005 Big Author
</blockquote>
 
which is to be understood as
 
<blockquote>
Some parts of the sum are copyrighted in 2003, some perhaps in 2004, and some certainly in 2005.
</blockquote>
 
If there are more authors, then the copyright notice consists of more lines, like
 
<blockquote>
Copyright © 2003-2005 Big Author, <br>
Copyright © 2005 Captain,
</blockquote>
 
Not all changes are eligible for copyright. If a change is small, then it does not make sense to add a line to the copyright notice for it.
 
Copyright notice is not required for copyright to hold. It makes claiming your right at court easier.
 
The correctness of these instructions is not granted. They are subject to improvement as we see fit.
 
--[[User:Danielpolansky|Danielpolansky]] 11:29, 3 Jun 2005 (PDT)
 
=== All on keyboard mappings ===
 
Currently, each function has at most one key assigned. But, it should be the other way around;
the keys should have functions assigned, rather than functions key. For instance, it would be
valuable to have both ''insert'' and ''tab'' assigned to ''new node'' function. (Actually on MS Windows it is right now not possible at all to bind anything to ''tab''.)
 
=== To translate FreeMind into your language ===
 
Look for a translation into your language present in the development  [http://cvs.sourceforge.net/viewcvs.py/freemind/freemind/?only_with_tag=fm_041017_base_integration branch].
If such a translation isn't present, take the latest revision of [http://cvs.sourceforge.net/viewcvs.py/freemind/freemind/?only_with_tag=fm_041017_base_integration Resources_en.properties]. Translate the labels in the text at the right side from = to your language.
 
You can directly create and edit any java property file in any language using [http://propedit.sourceforge.jp/index_en.html propedit].
 
: This editor can directly edit property files written in Unicode reference characters, and saves the time and effort of converting into Unicode through native2ascii. In addition to the usual functions of an editor, the plugin is integrated with Eclipse and JBuilder. Files can be opened in the IDE and saved in Unicode. It can use by intuitive and simple operation. For details, see [http://sourceforge.jp/projects/propedit Propedit].
 
Another interesting tool to manage language property files is [http://popeye.sourceforge.net/ popeye]. Popeye can deal with several language property files at the same time so you can contrast the original property file data with their translations. Also, the program can highlight all properties that do not have a translation set in one of the selected languages.
 
Alternatively you can save your property file in UTF-8 encoding; this is possible e.g. using Microsoft Notepad. After that convert the file into \uXXXX Unicode escape notation, using [http://java.sun.com/j2se/1.3/docs/tooldocs/win32/native2ascii.html native2ascii] tool included with the Java SDK. Example of use (Resources_cs.properties.txt is before conversion):
 
cd C:\j2sdk1.4.2\bin>
native2ascii.exe -encoding UTF8 Resources_cs.properties.utf8.txt Resources_cs.properties
 
Ideally, your file's name will be ''Resources_xx.properties'', where ''xx'' is the code of the language (e.g. en, de, dk etc.). [http://sourceforge.net/tracker/?group_id=7118&atid=307118 Send your translation as a patch] afterwards.
 
To convert \uXXXX Unicode encoded file back to UTF-8, use a command similar to the following.
 
cd C:\j2sdk1.4.2\bin>
native2ascii.exe '''-reverse''' -encoding UTF8 Resources_cs.properties Resources_cs.properties.utf8.txt
 
Currently, we have the following languages translated.
{| border="1" cellspacing="0" cellpadding="2"
! colspan="7" style="background:#fff8f0;" | Already Translated Languages
|-------------------------------------------------
! | Language || Language    || Short || If released || Translator || Reviewer || Capitalized Titles
|-----------------------------------------------------------------
| Czech    || Česky      || cs || not released || Radek Švarz || Daniel Polansky ||No
|-----------------------------------------------------------------
| Chinese    || trad.chinese || zh|| [http://sourceforge.net/tracker/index.php?func=detail&aid=1179121&group_id=7118&atid=307118 released] || [http://java.fromtw.com william chen] || &nbsp; || &nbsp;
|-----------------------------------------------------------------
| Chinese    || simp.chinese || zh_CN|| [http://sourceforge.net/tracker/index.php?func=detail&aid=1179573&group_id=7118&atid=307118 not released] || [http://java.fromtw.com william chen] || &nbsp;  || &nbsp;
|-----------------------------------------------------------------
| Danish  || Dansk      || dk || released    ||            ||                || 
|-----------------------------------------------------------------
| Dutch    || Nederlands  || nl || [http://sourceforge.net/tracker/index.php?func=detail&aid=1157653&group_id=7118&atid=307118 not released] || Koen Roggemans ||              ||No
|-----------------------------------------------------------------
| English  || English    || en || released    || N/A        ||                  || Yes
|-----------------------------------------------------------------
| Finnish ||  Suomi      || fi  || not released || Matti Lassila ||      ||
|-----------------------------------------------------------------
| French  || Francais    || fr || released    ||            ||                  ||
|-----------------------------------------------------------------
| German  || Deutsch    || de || released    || Christian Foltin ||                ||
|-----------------------------------------------------------------
| Hungarian ||            || ?  || not released || [http://documan.sourceforge.net/ documan] ||      ||
|-----------------------------------------------------------------
| Italian  || Italiano    || it || released    || Bob Alexander ||      ||
|-----------------------------------------------------------------
| Japanese || Nihongo    || ja || released    || Kohichi Aoki ||        ||
|-----------------------------------------------------------------
| Korean  || Hangeul      || kr || [http://sourceforge.net/tracker/index.php?func=detail&aid=1236421&group_id=7118&atid=307118 released(rc5)]    || Kim Jong Woo ||        ||
|-----------------------------------------------------------------
| Polish  || Polski      || pl || not released || Rafal Kraik      ||  || No
|-----------------------------------------------------------------
| Portuguese || Português || pt || not released || Luis Ferreira      ||  ||
|-----------------------------------------------------------------
| Russian  || Pусский    || ru || not released || Prokudin Alexander ||    ||
|-----------------------------------------------------------------
| Spanish  || Espanol    || es || released    || Hugo Gayosso      ||    || Yes
|-----------------------------------------------------------------
| Turkish  || Türkçe      || tr || [https://sourceforge.net/tracker/download.php?group_id=7118&atid=307118&file_id=186544&aid=1530176 not released] || Uğur Çetin        ||    || Yes
|}
 
To activate a new translation, follow the following steps:
* write or download the Resources_xx.properties file;
* unpack the freemind.jar file with 7-Zip or similar into a temp folder;
* replace or add the Resources_xx.properties with the new one;
* repack the freemind.jar with the modified content of the temp folder.
 
=== To translate the wiki pages itself ===
 
See [http://meta.wikimedia.org/wiki/Meta:Interlanguage_links] for a description of how to do that. We don't have such a page yet, so, please, be careful.
 
=== FreeMind's xml data format (.mm) ===
 
FreeMind stores his data in own XML flavor. Up to FreeMind 0.6.5, the xml format has been unchanged. The list of elements and their attributes as of FreeMind 0.7.1 follows.
 
* '''map''' (root element)
** version (0.7.1)
* '''node''' (parent element: node, map)
** id  (0.7.1)
** text
** link
** folded
** color
** position (left or right, only for children of the root) (0.7.1)
* '''edge''' (parent element: node)
** style
** color
** width
* '''font''' (parent element: node)
** name
** size
** bold
** italic
* '''icon''' (parent element: node) (0.6.7)
** builtin
* '''cloud''' (parent element: node) (0.7.1)
** color
* '''arrowlink''' (parent element: node) (0.7.1)
** color
** destination (id of the target node)
** startarrow (arrow style)
** endarrow (arrow style)
 
The actual W3C schema can be found under
[[http://cvs.sourceforge.net/viewcvs.py/freemind/freemind/Attic/freemind.xsd?rev=1.1.2.1&only_with_tag=fm_041017_base_integration&view=log]].
 
=== Libraries and tools used in FreeMind ===
 
* [http://nanoxml.cyberelf.be/ NanoXML]
 
=== Sources of free icons ===
 
FreeMind uses (a) tool icons used in the toolbars, and (b) icons used in nodes. Especially for the icons used in nodes, a good comprehensive source of free icons is needed. FreeMind uses PNG icons, in the size of 16 x 16. Nowadays many icons are drawn in SVG vector format first, and converted to 16 x 16 bitmap images afterwards.
 
Ideally, it would not be the task of FreeMind team to draw icons; this task should be outsourced instead. Whether this is a realistic assumption remains to be seen.
 
Some links on the sources of free icons follow.
 
* [http://www.kde-look.org/index.php?xcontentmode=22x27 Icons at kde-look]
* [http://www.gnome-look.org/index.php?xcontentmode=120 Icons at gnome-look]
* [http://www.everaldo.com/crystal.html Crystal icons] &mdash; an icon set often used in KDE desktop environment
* [http://tango-project.org/Tango_Desktop_Project Tango Desktop Project] &mdash; an icon library for KDE and Gnome, licenced under Creative Commons Attribution Sharealike
* [http://www.famfamfam.com/lab/icons/silk/ Silk icons] &mdash; 1000 icons licenced under Creative Commons attribution license
* [http://www.openclipart.org/ Open Clip Art Library] &mdash; a library used for some Mediawiki icons, mostly not suitable as a source of icons but rather as of clipart
* [http://commons.wikimedia.org/wiki/Category:PD_OpenClipart Open Clipart at Wikimedia commons]
 
 
More relevant links
 
* [http://jimmac.musichall.cz/icons.php Icons by Jimmac]
 
== Implementation ==
 
=== Menu Label Checklist ===
{| border="1" cellspacing="0" cellpadding="2"
! colspan="1" style="background:#fff8f0;" | Menu Label Checklist  || Poor || Good
|------------------------------------------------------------------------------------------------------
| In English, use capitalized labels  || Move to root            || Move to Root
|------------------------------------------------------------------------------------------------------
| Menu items leading to a dialog should end with ... .    || Open <br> Close ...      || Open... <br> Close
|------------------------------------------------------------------------------------------------------
| Do not repeat the verb already used in the menu heading || Export > Export to PNG <br> Insert > Insert Hyperlink  || Export > As PNG <br> Insert > Hyperlink
|}
 
=== To implement embedded images ===
 
To implement embedded images, one would store binary data in a node, like &lt;node TYPE="image" BINARY="x4543edvc...45ert"/&gt;
Upon opening the node for viewing, temporary file would be created and HTML viewer would point to that file. Upon editing,
external image editor would be opened to edit the temporary file, like Gimp.
 
=== Improved HTML editing ===
 
FreeMind's long node may contain HTML. However, it needs to be edited in its source text form. We can improve upon that by
 
* providing WYSIWYG HTML editor embedded in FreeMind, like Java based [http://www.hexidec.com/ekit.php eKIT] ([http://sourceforge.net/projects/ekit/ project page] LGPL licence).
 
* enabling using external WYISWYG editor for editing HTML, like Microsoft FrontPage. This editor would be automatically opened upon clicking an HTML node, displaying it in WYSIWYG way. It is not clear how to get the changed node back to FreeMind. One option is to generate a temporary file, passing it to the external editor upon calling. However, how does the external editor tell FreeMind that the editing has ended? Futhermore, should such editing be modal? How to ensure such a modality and not get locked in it when the external editor crashes?
 
: There is already some work done on integration of the WYSIWYG HTML editor Kafenio into FreeMind. --[[User:Danielpolansky|Danielpolansky]] 10:51, 6 Mar 2005 (PST)
 
==== Open Source WYSIWYG HTML editors in Java ====
 
There are the following open source WYSIWYG HTML editors written in Java.
 
* [http://www.hexidec.com/ekit.php eKit] &mdash; LGPL licenced
* [http://editor.kafenio.org/ Kafenio] &mdash; LGPL licenced, developed as a fork of eKit
* [http://www.lightdev.com/page/3.htm SimplyHTML] &mdash; GPL licenced
 
=== Using HTML versus XHTML in rich text nodes ===
 
What follows is a preliminary analysis of the issues concerning HTML versus XHTML used for rich text in FreeMind.
 
AFAIK there are two separate questions: (1) should we store (a) HTML or (b) XHTML in nodes, and (2) should we (a) store only one thing or (b) store plain text in one attribute, and store HTML/XHTML in another attribute where HTML is available, modelling on email systems.
 
As for the first question, using HTML has the advantage of being straightforward: it is supported by JLabel, it is supported by Java HTML editing component, and it is the format now mostly used in web pages. An advantage of XHTML is that it is a flavor of XML and thus easily amenable to XSLT processing.
 
As for the second question, as soon as we would store also plain text, it would be automatically available to all XSLT processing, which would make the first question less decisive. However, it would considerably increase the size of mind maps stored on the disk, by my estimation by factor 1.5 as soon as a lot of rich text would be used.
 
Performing transformations of HTML to XHTML on the fly before performing preprocessing from FreeMind would not really save the day, as XHTML would still need to be stored in mind maps on the disk; if we would use HTML internally, we would have to convert XHTML to HTML upon loading a new map for all nodes, instead of doing that only upon nodes being shown for the purpose of JLabel.
 
If you find the other options more attractive, an important question is: is it really possible to process XHTML from within an XML attribute? Can someone demonstrate that? If yes, that would make XHTML rather attractive. But if not really, then using HTML would be as good as using XHTML.
 
==== Converting HTML from node attribute TEXT to plain text within XSLT ====
 
Converting HTML from node attribute TEXT to plain text within XSLT is virtually impossible. XSLT does not feature regular replaces, and it does not even feature simple text replaces (simple text replaces can be sort of [http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426 implemented within XSLT] though). My old view on this option follows.
 
: I estimate that the most straightforward way of solving the related problems is to find out how to convert HTML into plain text within XSLT script. I currently do not have a sufficient knowledge of XSLT to judge on that; it should be possible using several regular expression replacements, modelled on what we already have in FreeMind in Java. As soon as we would be able to do that, there might even be a regular expression way to covert boldface and italics to open document format of OpenOffice. Admittedly, instead of having one conversion routine from HTML to plain text in FreeMind, it would have to be replicated in every XSLT script dealing with FreeMind mind maps.
 
==== Storing XHTML on par with FreeMind XML ====
 
The option of storing XHTML elements on par with FreeMind XML elements like <node> would require a considerable effort. The benefits of the effort would include
 
* + better support for XSLT transformations
* + more readable XML of FreeMind mind maps
 
The costs would include
 
* - switching away from [http://nanoxml.cyberelf.be/ NanoXML/Lite] to a more bloated technology for reading and saving of mind maps, meaning considerable slowing down upon loading and saving of mind maps. (That is not true; I was wrong. We would only have to adjust NanoXML so that it stops parsing XML within certain elements and reads everything within them as uninterpreted string instead. --[[User:Danielpolansky|Danielpolansky]] 06:34, 13 May 2006 (PDT))
 
By storing on par, I mean the following.
 
<pre>
  <map>
    <node>
      <html>
        <body>Hello </br> Dolly.</body>
      </html>
    </node>
  </map>
</pre>
 
I recommend to avoid this option. Out current option is
 
<pre>
  <map>
    <node TEXT="& lt ; HTML & gt ; Hello & lt ; br & gt ; Dolly."/>
  </map>
</pre>
 
A discussion shows the following possibilities of storing on par.
 
# Storing HTML directly like <code>< node >< html ></ html ></ node ></code>
# Storing HTML within '''content''' element like <code>< node >< content >< html >< /html ></ content ></ node ></code> and
# Storing plain text within TEXT attribute of '''node''' element
# Storing plain text as <code>< node >< text >Plain</ text ></ node ></code>
# Storing plain text as <code>< node >< content >Plain</ text ></ node ></code>
 
==== Converting HTML to XHTML in Java ====
 
I find a conversion of HTML to XHTML possible with reasonable effort. I think there are not many more subtleties apart from those already addressed: closed tags < td >, < tr > and the like, closed tags < /br >, < /hr >, < img/ > and several others. We would be able to discover all the subtleties by reading XHTML standard and by empirical testing. (For reference, [http://www.shredzone.net/articles/java/html2xhtml/ html2xhtml at shredzone.net], thanks to Dimitri)
 
However, W3C points out that converting HTML to XHTML is a tricky business.
 
: The main problem of developing your own converter is that either you are sure your HTML is correct (and so you only need to fix cases, quotes in attributes, entitities and close the few HTML empty tags) or you will go crazy trying to cope with all the possible errors that the "official" web browsers accept but that would kill any simple parser.
 
See also [http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html Convert HTML content to PDF format at JavaWorld] using [http://sourceforge.net/projects/jtidy/ JTidy].
 
==== Converting XHTML to HTML in Java ====
 
Searching the web using the expressions
 
* "XHTML to HTML"  java
* XHTML2HTML java GPL
* XHTML2HTML java
 
I have found very little about already existing code for converting XHTML to HTML in Java, with GNU GPL licenced code. Thus, my recommendation is to create a new method for that, in the class Tools. The method would be created with the use of [1] as a checklist. The method would use regular expression replaces, unless we see that this is too slow, which I do not think will be the case. (We already use regular expression replaces in method <tt>update()</tt> of <tt>NodeView</tt>.)
 
A preliminary code is as follows.
 
<pre>
  public String xhtmlToHtml(String xhtmlText) {
      //Remove '/' from <.../> of elements that do not have '/' there in HTML
      return xhtmlText.
        replaceAll("<(("+
                    "br|area|base|basefont|"+
                    "bgsound|button|col|colgroup|embed|hr"+
                    "|img|input|isindex|keygen|link|meta"+
                    "|object|plaintext|spacer|wbr"+
                    ")(\\s[^>]*)?)/>",
                    "<$1>"));
</pre>
 
See also
 
# [http://www.stylusstudio.com/xsllist/200004/post10350.html Discussion on converting XHTML to HTML using XSLT] (can be checked against when developing conversion in Java)
# [http://membres.lycos.fr/cvincent/xml/api/fr.bizolin.xml.XHTML2HTML.html XHTML2HTML in Java], albeit needing some Perl package which is difficult to understand. As old as of year 2000.
 
==== Requirements on file format of FreeMind ====
 
We have identified the following requirements on the format of FreeMind. These have different priority; people may disagree about what the priority of their requirements are.
 
# guarantee file format integrity, i.e. XML conformance.
# be flexible for new features like (x)html, svg, mathml,...
# stay reasonably backwards compatible, so that all existing generators of FreeMind mind maps work with later versions of  FreeMind too. Put differently, create new format only as an extension of the old format, that is by adding new elements and attributes only
# new format should allow for import of all old format features (from stable versions).
# limit redundancy of information.
# keep it easy to do XSLT transformations.
# keep the format as simple as possible.
# make it easy to create and edit mm files manually in an editor like Vim, Emacs or Notepad.
# make it easy to create mm files programmatically.
# the solution should be fast.
# the solution should be safe.
# the file format of both notes and nodes should be XHTML (a further specification of the first requirement)
 
For [[User:Danielpolansky|Danielpolansky]], the requirement on staying reasonably backwards compatible is important; the requirement on the solution to be fast too; the requirement on XSLT transformations is completely unimportant in view of the possibility of replacing XSLT transformations with small Java functions doing the same with less footprint; the requirement on keeping the format simple is important; the requirement on making it easy to create mind maps programatically is important.
 
==== Sources of HTML coming to mind maps ====
 
Rich text in the form of HTML will be coming into FreeMind from the following sources:
 
* directly entered in FreeMind using WYSIWYG editor
* pasted from web pages
* pasted from Microsoft Word documents, and other applications exposing HTML to the clipboard
 
To my experience, the pasting is much more usual and of higher volume than direct editing.
 
==== See also ====
 
* [http://en.wikipedia.org/wiki/Xhtml XHTML at Wikipedia]
* [http://www.w3.org/TR/xhtml1/#diffs 4. Differences with HTML 4] of W3C XHTML 1.0 specification
* [http://www.w3schools.com/xhtml/xhtml_html.asp Differences Between XHTML And HTML] at w3schools
 
--[[User:Danielpolansky|Danielpolansky]] 03:29, 29 Apr 2006 (PDT)
 
=== Rendering of HTML nodes is slow ===
 
Rendering of quite long HTML nodes is slow. If you have a HTML page corresponding to ten paper pages, then the rendering of the node upon unfolding takes several seconds. The related code is in the method <code>update</code> of the class <code>NodeView</code>. What takes so long is the statement
 
          setText(nodeText);
 
in the section
 
        if (nodeText.startsWith("<html>")) {
          // Make it possible to use relative img references in HTML using tag <base>.
          if (nodeText.indexOf("<img")>=0 && nodeText.indexOf("<base ") < 0 ) {
              try {
                nodeText = "<html><base href=\""+
                    map.getModel().getURL()+"\">"+nodeText.substring(6); }
              catch (MalformedURLException e) {} }
          setText(nodeText);
 
This result does not give us much hope of improving the speed easily, as the command just tells Java's JLabel to render the page. A solution would be to find a different HTML rendering Java component. We can also wait until Sun's Java virtual machine improves the speed of JLabel's HTML rendering.
 
--
What about pre-loading nodes which are likely to be expanded, using threading?  Keep some relatively small cache of nodes in proximity to the last expanded node, and swap in the expanded node when the unexpanded one is clicked.  No?
 
=== To obtain focus for selected node in reliable manner ===


Requesting focus for NodeView using requestFocus() method is unreliable. A reliable way of doing that has been implemented in the method <code>obtainFocusForSelected()</code> of Controller. A typical call in ControllerAdaper.java is  
Requesting focus for NodeView using requestFocus() method is unreliable. A reliable way of doing that has been implemented in the method <code>obtainFocusForSelected()</code> of Controller. A typical call in ControllerAdaper.java is  
Line 559: Line 44:


where <code>newSelected</code> is a NodeView is unreliable, though most often works.
where <code>newSelected</code> is a NodeView is unreliable, though most often works.
=== To set the class load path in manifest.mf in jar ===
In the source folder tree of FreeMind, there's a file MANIFEST.MF. This file tells what
should happen with the freemind.jar when java tries to run the jar archive. The file
may look like
Manifest-Version: 1.0
Main-Class: freemind.main.FreeMind
Class-Path:                  silk.jar nanoxml.jar ekit.jar kafenio.jar
            kafenio-config.jar kafenio-icons.jar gnu-regexp-1.1.4.jar
Created-By: Joerg Mueller
A tricky thing about the file is that the length of the lines can be
at most 72 characters. That creates difficulties when specifying Class-Path.
In the exaple above, the first line of Class-Path is set in such a way
that it has 70 chacters. That has been achieved by putting spaces before
the actual list of classes. In the freemind.jar, the file can be found in the
folder META-INF. Here you can check if the manifest has been created correctly.
=== Deleting nodes and branches in FreeMind ===
Since version 0.8.0, it is possible to delete a whole branch of nodes by pressing DELETE. When a user accidentally presses DELETE and does not notice that, they may loose considerable amount of data. For users using FreeMind as a knowledge base or a semi-structured database, being able to delete whole branch at one keystroke is problematic and unusual; in filesystem browsers, users are asked for confirmation before the file is deleted by the system.
However, some users use FreeMind as a mind mapper and are glad to be able to delete nodes just by pressing DELETE.
There are several solutions to this problem.
* Add user option to enable or disable confirmation before deleting of nodes and branches
* Store all deleted nodes and branches in a kind of trashcan associated with every mind map
* Ask for confirmation only for nodes with children
* Ask for confirmation only for nodes with more than ''p'' children
The confirmation would be requested both for keystrokes DELETE and CONTROL + X, that is the actions Delete and Cut.


== More development pages ==
== More development pages ==


=== Documentation efforts ===
To see all development pages, have a look at the category Development, by clicking on the link at the bottom of this page.
 
See [[documentation efforts]].
Also, internals documentation at [[Under the covers]].
 
=== Short patches ===


See [[short patches]].
[[Category:Development]]

Latest revision as of 19:04, 28 May 2011

The development of FreeMind is coordinated using FreeMind's project page at SourceForge, and also using this wiki. At wiki, we have requests for enhancements page; there is also requests for enhancements (RFEs) page at SourceForge (not preferred). You can browse our new GIT repository.

We also use SourceForge for bugs, and open discussion forum. We do not use the documentation part there as we use this wiki instead.

Contributing to FreeMind

See Contributing.

Getting started as a developer

See Getting started as a developer.

Getting started as a tester

See Getting started as a tester.

Reporting bugs

See Reporting bugs.

Organization of FreeMind development

Initially, every active developer of the core team works on his own GIT branch. Our intermediate results are published as our "alpha versions". We use forum Open Discussion to communicate them.

Further details about the FreeMind release process are described on the FreeMind Release process page.

Experimental versions

Currently, there are no experimental versions available. The latest release candidate can be downloaded from Files section.

Obtaining focus for selected node in reliable manner

Requesting focus for NodeView using requestFocus() method is unreliable. A reliable way of doing that has been implemented in the method obtainFocusForSelected() of Controller. A typical call in ControllerAdaper.java is

 getController().obtainFocusForSelected();

Requesting focus using

 newSelected.requestFocus();

where newSelected is a NodeView is unreliable, though most often works.

More development pages

To see all development pages, have a look at the category Development, by clicking on the link at the bottom of this page.