Program design: Difference between revisions

From FreeMind
Jump to navigationJump to search
(revert to last full version)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This page describes the current program design.
This page describes the current program design.
The discussion of its future changes is moved to the [[talk:Program design|talk]] page.


  Currently this page is small,  
  Currently this page is small,  
Line 48: Line 49:
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>.
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>.


'''NOTE''': Because of the way this reference is handled, the coupling between the model, the view, and the controller appears to be very high. I haven't finished going through it all, but it appears, to me, that there might be some benefit in reducing the size and complexity of these classes in order to reduce the coupling. High coupling (Calls back and forth between modules) can be a source of frequent bugs.
* [[talk:Program design#Implementation of the Model View Controller pattern can be revisited|See discussion page]] for more.
 
At the moment, it looks as if I might have to code up my own versions of <code>Controller</code> and <code>MapView</code> in order to create the preview pane for the redesigned Format Dialog. I might just still be confused. What I want to do, is to create a preview pane, essentially a JPanel, which can show how the formatting changes will look. Right now, it appears that with the current way things are done, all changes are made directly to the properties of the model. For my purposes, it would be better to be able to get a copy of the properties, let the user play with them, and then copy them back when, and if, the user hits the Okay button. (** Commentary **) - I use this tag to mark stuff I want to delete out later.
 
==== Modes ====
==== Modes ====
==== Actions ====
==== Actions ====
Line 63: Line 61:
=== Plug-Ins===
=== Plug-Ins===


The plug-ins 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.
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===
===Startup===


#Freemind is started by invoking a script:
Freemind is started by invoking a script:
{| class="wikitable" border="1" cellpadding="5"
{| class="wikitable" border="1" cellpadding="5"
|+ Starting Scripts
|+ Starting Scripts
Line 77: Line 77:
| freemind.sh
| freemind.sh
|}
|}
 
#The main class invoked by the script is: <code>freemind.main.FreeMindStarter</code>
<ol start="2">
#<code>FreeMindStarter</code> checks the Java version and then invokes <code>Freemind.main</code>.
<li>The main class invoked by the script is: <code>freemind.main.FreeMindStarter</code>
#The <code>Freemind</code> takes care of initialization, setting the look and feel, loads maps and makes the GUI visible.
<li><code>FreeMindStarter</code> checks the Java version and then invokes <code>Freemind.main</code>.</li>
#* It might make some sense to refactor this class, it's very large and complicated. - [[User:Rben13|Rben13]]
<li>The <code>Freemind</code> takes care of initialization, setting the look and feel, loads maps and makes the GUI visible.
#* Currently the tabs and tab management are implemented as <code>FreeMindStarter</code>inner classes. Is it good? - [[User:DimitriPolivaev|DimitriPolivaev]]
<p>'''NOTE:'''It might make some sense to refactor this class, it's very large and complicated.</p>
#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
</li>
<li>As soon as the frame is created (or the applet is displayed), its event loop takes control over. The starter threads ends afterwards.</li>
</ol>


==GUI Design Principles==
==GUI Design Principles==

Latest revision as of 12:17, 22 November 2010

This page describes the current program design. The discussion of its future changes is moved to the talk page.

Currently this page is small, 
Ask questions so that the team members can extend 
the points you are interested in. DimitriPolivaev

Note: Someone should review this page every couple of versions and bring it up-to-date. This version of the page is based on the 0.9.0 code base.

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 (MapView and NodeView) allow displaying of arbitrary map implementations implementing interface MindMap extending swing interface TreeModel. The implementations include currently

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

All kinds of MindMap use MindMapNode for representing a single node.

Different modes are equipped with mode controllers implementing interface ModeController. 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 MindMapMode takes the required menu structure from file mindmap_menus.xml. 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 Controller and mode controller classes set up all the Actions that are used to respond to user input and make changes to the model.

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

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: freemind.main.FreeMindStarter
  2. FreeMindStarter checks the Java version and then invokes Freemind.main.
  3. The Freemind 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 FreeMindStarterinner 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

GUI Design Principles

The purpose of FreeMind is to provide an easy-to-use Mind Mapping application. It is important to make the users experience with the program as easy, natural, and intuitive as possible. The interface should be uncluttered and easy to navigate.

Need more on this from people who know more about the program.

Auxillary Files

Distribution

Required Library Files

  • lib\freemind.jar
  • lib\commons-lang-2.0.jar
  • lib\forms-1.0.5.jar
  • lib\jibx\jibx-run.jar
  • lib\jibx\xpp3.jar
  • lib\bindings.jar