Program design: Difference between revisions

From FreeMind
Jump to navigationJump to search
No edit summary
m (Reverted edit of Yvyfyjeh, changed back to last version by DimitriPolivaev)
Line 1: Line 1:
>==Architecture Design==
==Architecture Design==


FreeMind is a Java application that uses the Java Swing library. The basic design is based on the [http://en.wikipedia.org/wiki/Model-view-controller Model-View-Controller] model.
FreeMind is a Java application that uses the Java Swing library. The basic design is based on the [http://en.wikipedia.org/wiki/Model-view-controller 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|MindMap]]</tt> extending swing interface <tt>TreeModel</tt>. The implementations include currently  
It's central graphic components (<tt>MapView</tt> and <tt>NodeView</tt>) allow displaying of arbitrary map implementations implementing interface <tt>[[#MindMap|MindMap]]</tt> extending swing interface <tt>TreeModel</tt>. The implementations include currently  
*&lt;tt&gt;MindMapMapModel&lt;/tt&gt; used for editing of mind maps,  
*<tt>MindMapMapModel</tt> used for editing of mind maps,  
*&lt;tt&gt;BrowseMapModel&lt;/tt&gt; used for displaying a mind map in a browser or in a so-called browse mode,
*<tt>BrowseMapModel</tt> used for displaying a mind map in a browser or in a so-called browse mode,
*&lt;tt&gt;FileMapModel&lt;/tt&gt; used for displaying of file directory tree as a mind map.
*<tt>FileMapModel</tt> used for displaying of file directory tree as a mind map.


All kinds of &lt;tt&gt;[[#MindMap|MindMap]]&lt;/tt&gt; use &lt;tt&gt;[[#MindMapNode |MindMapNode ]]&lt;/tt&gt; for representing a single node.
All kinds of <tt>[[#MindMap|MindMap]]</tt> use <tt>[[#MindMapNode |MindMapNode ]]</tt> for representing a single node.


Different modes are equipped with mode controllers implementing interface &lt;tt&gt;ModeController&lt;/tt&gt;. 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 &lt;tt&gt;MindMapMode&lt;/tt&gt; takes the required menu structure from file &lt;tt&gt;mindmap_menus.xml&lt;/tt&gt;. It can also include classes registered as [[#Plug-Ins|Plug-Ins]] and loaded at the run-time using reflection.
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|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.
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.
Line 36: Line 36:


=== Controller ===
=== Controller ===
The &lt;code&gt;Controller&lt;/code&gt; and mode controller classes set up all the &lt;code&gt;Action&lt;/code&gt;s that are used to respond to user input and make changes to the model.
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 &lt;code&gt;Controller&lt;/code&gt; class needs a &lt;code&gt;FreeMindFrame&lt;/code&gt; for it's constructor. &lt;code&gt;FreeMindFrame&lt;/code&gt; is an &lt;code&gt;Interface&lt;/code&gt;. This gives Controller the ability to call back into the &lt;code&gt;FreeMind&lt;/code&gt; class which implements &lt;code&gt;FreeMindMain&lt;/code&gt;.
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>.


* [[talk:Program design#Implementation of the Model View Controller pattern can be revisited|See discussion page]] for more.
* [[talk:Program design#Implementation of the Model View Controller pattern can be revisited|See discussion page]] for more.
Line 52: Line 52:
=== Plug-Ins===
=== 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 &quot;accessories&quot;. Even the note is implemented as a plug-in.
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.
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.
Line 59: Line 59:


Freemind is started by invoking a script:
Freemind is started by invoking a script:
{| class=&quot;wikitable&quot; border=&quot;1&quot; cellpadding=&quot;5&quot;
{| class="wikitable" border="1" cellpadding="5"
|+ Starting Scripts
|+ Starting Scripts
|-
|-
Line 68: Line 68:
| freemind.sh
| freemind.sh
|}
|}
#The main class invoked by the script is: &lt;code&gt;freemind.main.FreeMindStarter&lt;/code&gt;
#The main class invoked by the script is: <code>freemind.main.FreeMindStarter</code>
#&lt;code&gt;FreeMindStarter&lt;/code&gt; checks the Java version and then invokes &lt;code&gt;Freemind.main&lt;/code&gt;.
#<code>FreeMindStarter</code> checks the Java version and then invokes <code>Freemind.main</code>.
#The &lt;code&gt;Freemind&lt;/code&gt; takes care of initialization, setting the look and feel, loads maps and makes the GUI visible.
#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. - [[User:Rben13|Rben13]]
#* It might make some sense to refactor this class, it's very large and complicated. - [[User:Rben13|Rben13]]
#* Currently the tabs and tab management are implemented as &lt;code&gt;FreeMindStarter&lt;/code&gt;inner classes. Is it good? - [[User:DimitriPolivaev|DimitriPolivaev]]
#* Currently the tabs and tab management are implemented as <code>FreeMindStarter</code>inner classes. Is it good? - [[User:DimitriPolivaev|DimitriPolivaev]]
#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
#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
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://yhenuvawac.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
----
=[http://yhenuvawac.co.cc CLICK HERE]=
----
</div>

Revision as of 19:11, 18 November 2010

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