freemind.controller
Class Controller

java.lang.Object
  extended by freemind.controller.Controller
All Implemented Interfaces:
MapModuleManager.MapModuleChangeObserver

public class Controller
extends java.lang.Object
implements MapModuleManager.MapModuleChangeObserver

Provides the methods to edit/change a Node. Forwards all messages to MapModel(editing) or MapView(navigation).


Nested Class Summary
static class Controller.CloseAction
          This closes only the current map
static interface Controller.LocalLinkConverter
           
 class Controller.OptionAntialiasAction
           
 class Controller.PropertyAction
           
protected  class Controller.ShowSelectionAsRectangleAction
           
protected  class Controller.ZoomInAction
           
protected  class Controller.ZoomOutAction
           
 
Field Summary
 javax.swing.Action about
           
 Controller.CloseAction close
           
 javax.swing.Action documentation
           
 javax.swing.Action faq
           
 freemind.controller.Controller.OpenURLAction freemindUrl
           
 javax.swing.Action hideAllAttributes
           
static java.lang.String JAVA_VERSION
           
 javax.swing.Action keyDocumentation
           
 javax.swing.Action license
           
static Controller.LocalLinkConverter localDocumentationLinkConverter
          Used for MAC!!!
 javax.swing.Action moveToRoot
           
 javax.swing.Action navigationNextMap
           
 javax.swing.Action navigationPreviousMap
           
 Controller.OptionAntialiasAction optionAntialiasAction
           
 javax.swing.Action optionHTMLExportFoldingAction
           
 javax.swing.Action optionSelectionMechanismAction
           
 javax.swing.Action page
           
 javax.swing.Action print
           
 javax.swing.Action printDirect
           
 javax.swing.Action printPreview
           
 Controller.PropertyAction propertyAction
           
 javax.swing.Action quit
           
 javax.swing.Action showAllAttributes
           
 javax.swing.Action showAttributeManagerAction
           
 javax.swing.Action showFilterToolbarAction
           
 javax.swing.Action showSelectedAttributes
           
 javax.swing.Action showSelectionAsRectangle
           
 javax.swing.Action toggleLeftToolbar
           
 javax.swing.Action toggleMenubar
           
 javax.swing.Action toggleToolbar
           
 javax.swing.Action webDocu
           
 javax.swing.Action zoomIn
           
 javax.swing.Action zoomOut
           
 
Constructor Summary
Controller(FreeMindMain frame)
           
 
Method Summary
static void addPropertyChangeListener(FreemindPropertyListener listener)
           
static void addPropertyChangeListenerAndPropagate(FreemindPropertyListener listener)
           
 void afterMapClose(MapModule pOldMapModule, Mode pOldMode)
           
 void afterMapModuleChange(MapModule oldMapModule, Mode oldMode, MapModule newMapModule, Mode newMode)
           
 void beforeMapModuleChange(MapModule oldMapModule, Mode oldMode, MapModule newMapModule, Mode newMode)
           
 void close(boolean force)
          Closes the actual map.
 boolean createNewMode(java.lang.String mode)
          Creates a new mode (controller), activates the toolbars, title and deactivates all actions.
 void deregisterMapTitleChangeListener(MapModuleManager.MapTitleChangeListener pMapTitleChangeListener)
           
 void errorMessage(java.lang.Object message)
           
 void errorMessage(java.lang.Object message, javax.swing.JComponent component)
           
static javax.swing.JColorChooser getCommonJColorChooser()
          Static JColorChooser to have the recent colors feature.
 java.awt.Font getDefaultFont()
           
 java.lang.String getDefaultFontFamilyName()
           
 int getDefaultFontSize()
           
 int getDefaultFontStyle()
           
 FilterController getFilterController()
           
 java.awt.Font getFontThroughMap(java.awt.Font font)
           
 FreeMindMain getFrame()
           
 int getIntProperty(java.lang.String property, int defaultValue)
           
 javax.swing.JFrame getJFrame()
           
 LastOpenedList getLastOpenedList()
           
 MindMap getMap()
           
 MapModule getMapModule()
           
 MapModuleManager getMapModuleManager()
           
 MapMouseMotionListener getMapMouseMotionListener()
           
 MapMouseWheelListener getMapMouseWheelListener()
           
 Mode getMode()
           
 ModeController getModeController()
           
 MindMap getModel()
          Returns the current model
 NodeDragListener getNodeDragListener()
           
 NodeDropListener getNodeDropListener()
           
 NodeKeyListener getNodeKeyListener()
           
 NodeMotionListener getNodeMotionListener()
           
 NodeMouseMotionListener getNodeMouseMotionListener()
           
 java.awt.print.PageFormat getPageFormat()
           
 java.lang.String getProperty(java.lang.String property)
           
static java.util.Collection getPropertyChangeListeners()
           
 java.net.URL getResource(java.lang.String resource)
           
 java.lang.String getResourceString(java.lang.String resource)
           
 javax.swing.JToolBar getToolbar()
           
 MapView getView()
           
 java.lang.String[] getZooms()
           
 void informationMessage(java.lang.Object message)
           
 void informationMessage(java.lang.Object message, javax.swing.JComponent component)
           
 boolean isMapModuleChangeAllowed(MapModule oldMapModule, Mode oldMode, MapModule newMapModule, Mode newMode)
          The params may be null to indicate the there was no previous map, or that the last map is closed now.
 void numberOfOpenMapInformation(int number)
          To enable/disable the previous/next map actions.
 void obtainFocusForSelected()
           
 void registerMapTitleChangeListener(MapModuleManager.MapTitleChangeListener pMapTitleChangeListener)
           
static void removePropertyChangeListener(FreemindPropertyListener listener)
           
 void setAllActions(boolean enabled)
          Manage the availabilty of all Actions dependend of whether there is a map or not
 void setAntialiasAll(boolean antialiasAll)
           
 void setAntialiasEdges(boolean antialiasEdges)
           
 void setAttributeViewType(MindMap map, java.lang.String value)
           
 void setEdgesRenderingHint(java.awt.Graphics2D g)
           
 void setFrame(FreeMindMain frame)
           
 void setLeftToolbarVisible(boolean visible)
           
 void setMenubarVisible(boolean visible)
           
 void setProperty(java.lang.String property, java.lang.String value)
           
 void setTextRenderingHint(java.awt.Graphics2D g)
           
 void setTitle()
          Set the Frame title with mode and file if exist
 void setToolbarVisible(boolean visible)
           
 void setZoom(float zoom)
           
static java.awt.Color showCommonJColorChooserDialog(java.awt.Component component, java.lang.String title, java.awt.Color initialColor)
           
 void toggleSelectionAsRectangle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localDocumentationLinkConverter

public static Controller.LocalLinkConverter localDocumentationLinkConverter
Used for MAC!!!


close

public Controller.CloseAction close

print

public javax.swing.Action print

printDirect

public javax.swing.Action printDirect

printPreview

public javax.swing.Action printPreview

page

public javax.swing.Action page

quit

public javax.swing.Action quit

showAllAttributes

public javax.swing.Action showAllAttributes

showSelectedAttributes

public javax.swing.Action showSelectedAttributes

hideAllAttributes

public javax.swing.Action hideAllAttributes

optionAntialiasAction

public Controller.OptionAntialiasAction optionAntialiasAction

optionHTMLExportFoldingAction

public javax.swing.Action optionHTMLExportFoldingAction

optionSelectionMechanismAction

public javax.swing.Action optionSelectionMechanismAction

about

public javax.swing.Action about

faq

public javax.swing.Action faq

keyDocumentation

public javax.swing.Action keyDocumentation

webDocu

public javax.swing.Action webDocu

documentation

public javax.swing.Action documentation

license

public javax.swing.Action license

navigationPreviousMap

public javax.swing.Action navigationPreviousMap

showFilterToolbarAction

public javax.swing.Action showFilterToolbarAction

showAttributeManagerAction

public javax.swing.Action showAttributeManagerAction

navigationNextMap

public javax.swing.Action navigationNextMap

moveToRoot

public javax.swing.Action moveToRoot

toggleMenubar

public javax.swing.Action toggleMenubar

toggleToolbar

public javax.swing.Action toggleToolbar

toggleLeftToolbar

public javax.swing.Action toggleLeftToolbar

zoomIn

public javax.swing.Action zoomIn

zoomOut

public javax.swing.Action zoomOut

showSelectionAsRectangle

public javax.swing.Action showSelectionAsRectangle

propertyAction

public Controller.PropertyAction propertyAction

freemindUrl

public freemind.controller.Controller.OpenURLAction freemindUrl

JAVA_VERSION

public static final java.lang.String JAVA_VERSION
Constructor Detail

Controller

public Controller(FreeMindMain frame)
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String property)

getIntProperty

public int getIntProperty(java.lang.String property,
                          int defaultValue)

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)

getFrame

public FreeMindMain getFrame()

getJFrame

public javax.swing.JFrame getJFrame()

getResource

public java.net.URL getResource(java.lang.String resource)

getResourceString

public java.lang.String getResourceString(java.lang.String resource)

getModeController

public ModeController getModeController()
Returns:
the current modeController.

getModel

public MindMap getModel()
Returns the current model


getView

public MapView getView()

getMode

public Mode getMode()

getZooms

public java.lang.String[] getZooms()

getMapModuleManager

public MapModuleManager getMapModuleManager()

getLastOpenedList

public LastOpenedList getLastOpenedList()

getMapModule

public MapModule getMapModule()

getFontThroughMap

public java.awt.Font getFontThroughMap(java.awt.Font font)

setAntialiasEdges

public void setAntialiasEdges(boolean antialiasEdges)

setAntialiasAll

public void setAntialiasAll(boolean antialiasAll)

getDefaultFont

public java.awt.Font getDefaultFont()

getDefaultFontFamilyName

public java.lang.String getDefaultFontFamilyName()

getDefaultFontStyle

public int getDefaultFontStyle()

getDefaultFontSize

public int getDefaultFontSize()

getCommonJColorChooser

public static javax.swing.JColorChooser getCommonJColorChooser()
Static JColorChooser to have the recent colors feature.


showCommonJColorChooserDialog

public static java.awt.Color showCommonJColorChooserDialog(java.awt.Component component,
                                                           java.lang.String title,
                                                           java.awt.Color initialColor)
                                                    throws java.awt.HeadlessException
Throws:
java.awt.HeadlessException

isMapModuleChangeAllowed

public boolean isMapModuleChangeAllowed(MapModule oldMapModule,
                                        Mode oldMode,
                                        MapModule newMapModule,
                                        Mode newMode)
Description copied from interface: MapModuleManager.MapModuleChangeObserver
The params may be null to indicate the there was no previous map, or that the last map is closed now.

Specified by:
isMapModuleChangeAllowed in interface MapModuleManager.MapModuleChangeObserver

afterMapClose

public void afterMapClose(MapModule pOldMapModule,
                          Mode pOldMode)
Specified by:
afterMapClose in interface MapModuleManager.MapModuleChangeObserver

beforeMapModuleChange

public void beforeMapModuleChange(MapModule oldMapModule,
                                  Mode oldMode,
                                  MapModule newMapModule,
                                  Mode newMode)
Specified by:
beforeMapModuleChange in interface MapModuleManager.MapModuleChangeObserver

afterMapModuleChange

public void afterMapModuleChange(MapModule oldMapModule,
                                 Mode oldMode,
                                 MapModule newMapModule,
                                 Mode newMode)
Specified by:
afterMapModuleChange in interface MapModuleManager.MapModuleChangeObserver

numberOfOpenMapInformation

public void numberOfOpenMapInformation(int number)
Description copied from interface: MapModuleManager.MapModuleChangeObserver
To enable/disable the previous/next map actions.

Specified by:
numberOfOpenMapInformation in interface MapModuleManager.MapModuleChangeObserver

createNewMode

public boolean createNewMode(java.lang.String mode)
Creates a new mode (controller), activates the toolbars, title and deactivates all actions. Does nothing, if the mode is identical to the current mode.

Returns:
false if the change was not successful.

setMenubarVisible

public void setMenubarVisible(boolean visible)

setToolbarVisible

public void setToolbarVisible(boolean visible)

getToolbar

public javax.swing.JToolBar getToolbar()
Returns:
Returns the main toolbar.

setLeftToolbarVisible

public void setLeftToolbarVisible(boolean visible)

getNodeKeyListener

public NodeKeyListener getNodeKeyListener()

getNodeMouseMotionListener

public NodeMouseMotionListener getNodeMouseMotionListener()

getNodeMotionListener

public NodeMotionListener getNodeMotionListener()

getMapMouseMotionListener

public MapMouseMotionListener getMapMouseMotionListener()

getMapMouseWheelListener

public MapMouseWheelListener getMapMouseWheelListener()

getNodeDragListener

public NodeDragListener getNodeDragListener()

getNodeDropListener

public NodeDropListener getNodeDropListener()

setFrame

public void setFrame(FreeMindMain frame)

close

public void close(boolean force)
Closes the actual map.

Parameters:
force - true= without save.

informationMessage

public void informationMessage(java.lang.Object message)

informationMessage

public void informationMessage(java.lang.Object message,
                               javax.swing.JComponent component)

errorMessage

public void errorMessage(java.lang.Object message)

errorMessage

public void errorMessage(java.lang.Object message,
                         javax.swing.JComponent component)

obtainFocusForSelected

public void obtainFocusForSelected()

setZoom

public void setZoom(float zoom)

setTitle

public void setTitle()
Set the Frame title with mode and file if exist


registerMapTitleChangeListener

public void registerMapTitleChangeListener(MapModuleManager.MapTitleChangeListener pMapTitleChangeListener)

deregisterMapTitleChangeListener

public void deregisterMapTitleChangeListener(MapModuleManager.MapTitleChangeListener pMapTitleChangeListener)

setAllActions

public void setAllActions(boolean enabled)
Manage the availabilty of all Actions dependend of whether there is a map or not


getPropertyChangeListeners

public static java.util.Collection getPropertyChangeListeners()

toggleSelectionAsRectangle

public void toggleSelectionAsRectangle()

getMap

public MindMap getMap()

addPropertyChangeListener

public static void addPropertyChangeListener(FreemindPropertyListener listener)

addPropertyChangeListenerAndPropagate

public static void addPropertyChangeListenerAndPropagate(FreemindPropertyListener listener)
Parameters:
listener - The new listener. All currently available properties are sent to the listener after registration. Here, the oldValue parameter is set to null.

removePropertyChangeListener

public static void removePropertyChangeListener(FreemindPropertyListener listener)

getFilterController

public FilterController getFilterController()

getPageFormat

public java.awt.print.PageFormat getPageFormat()

setAttributeViewType

public void setAttributeViewType(MindMap map,
                                 java.lang.String value)

setEdgesRenderingHint

public void setEdgesRenderingHint(java.awt.Graphics2D g)

setTextRenderingHint

public void setTextRenderingHint(java.awt.Graphics2D g)