Program design

From FreeMind
Revision as of 23:02, 17 November 2010 by Yvyfyjeh (talk | contribs)
Jump to navigationJump to search

>==Architecture Design==

FreeMind is a Java application that uses the Java Swing library. The basic design is based on the Model-View-Controller model.

It's central graphic components (<tt>MapView</tt> and <tt>NodeView</tt>) allow displaying of arbitrary map implementations implementing interface <tt>MindMap</tt> extending swing interface <tt>TreeModel</tt>. The implementations include currently

  • <tt>MindMapMapModel</tt> used for editing of mind maps,
  • <tt>BrowseMapModel</tt> used for displaying a mind map in a browser or in a so-called browse mode,
  • <tt>FileMapModel</tt> used for displaying of file directory tree as a mind map.

All kinds of <tt>MindMap</tt> use <tt>MindMapNode </tt> for representing a single node.

Different modes are equipped with mode controllers implementing interface <tt>ModeController</tt>. The mode controllers are responsible for registering of Actions, Menu Items, Hot Keys and Mouse Listeners which are available for the user. The mode controller of the edit mode <tt>MindMapMode</tt> takes the required menu structure from file <tt>mindmap_menus.xml</tt>. It can also include classes registered as Plug-Ins and loaded at the run-time using reflection.

It makes possible to create a relatively compact freemindbrowser.jar that can be used in the applet viewer with a subset of the classes that makeup the whole FreeMind program.

Model

MindMap

MindMapNode

Filtering

Edge Models

Links

Clouds

Atributes

Attribute Registry

Model Events

View

MapView

NodeView

Edges
Filtered Nodes
Attribute Table
Clouds

Link Views

Layout Managers

Controller

The <code>Controller</code> and mode controller classes set up all the <code>Action</code>s that are used to respond to user input and make changes to the model.

The main <code>Controller</code> class needs a <code>FreeMindFrame</code> for it's constructor. <code>FreeMindFrame</code> is an <code>Interface</code>. This gives Controller the ability to call back into the <code>FreeMind</code> class which implements <code>FreeMindMain</code>.

Modes

Actions

Undo Implementation
XML-Serialization

Listeners

Controller Events

Filter Controller

Configuration (Preferences)

Plug-Ins

The plug-ins allows adding of new operations capsuled in their own components without changing code of controller for registering and managing them. Such plug-ins are saved in directory "accessories". Even the note is implemented as a plug-in.

The plug-ins also provide additional functions that aren't needed by everyone. For instance, the SVG plug-in gives you the capability of exporting your Mind Maps to SVG format. These modules are left out of the minimum download configurations in order to save space.

Startup

Freemind is started by invoking a script:

Starting Scripts
Windows freemind.bat
Linux freemind.sh
  1. The main class invoked by the script is: <code>freemind.main.FreeMindStarter</code>
  2. <code>FreeMindStarter</code> checks the Java version and then invokes <code>Freemind.main</code>.
  3. The <code>Freemind</code> takes care of initialization, setting the look and feel, loads maps and makes the GUI visible.
    • It might make some sense to refactor this class, it's very large and complicated. - Rben13
    • Currently the tabs and tab management are implemented as <code>FreeMindStarter</code>inner classes. Is it good? - DimitriPolivaev
  4. As soon as the frame is created (or the applet is displayed), its event loop takes control over. The starter threads ends at this point