freemind.modes
Interface ModeController

All Superinterfaces:
TextTranslator
All Known Implementing Classes:
BrowseController, ControllerAdapter, FileController, MindMapController, SchemeController, ViewControllerAdapter

public interface ModeController
extends TextTranslator


Nested Class Summary
static interface ModeController.NodeLifetimeListener
           
static interface ModeController.NodeSelectionListener
           
 
Field Summary
static java.lang.String NODESEPARATOR
           
 
Method Summary
 void centerNode(MindMapNode node)
          Node is displayed and selected as the only one selected.
 boolean close(boolean force, MapModuleManager mapModuleManager)
           
 java.awt.datatransfer.Transferable copy()
           
 java.awt.datatransfer.Transferable copy(java.util.List selectedNodes, boolean copyInvisible)
           
 java.awt.datatransfer.Transferable copy(MindMapNode node, boolean saveInvisible)
           
 java.awt.datatransfer.Transferable copySingle()
           
 MindMapNode createNodeTreeFromXml(java.io.Reader pReader, java.util.HashMap pIDToTarget)
          Given a valid Xml parameterization of a node (tree), this method returns freshly created nodes.
 void deregisterNodeLifetimeListener(ModeController.NodeLifetimeListener listener)
           
 void deregisterNodeSelectionListener(ModeController.NodeSelectionListener listener)
           
 void displayNode(MindMapNode node)
          Unfolds a node if necessary.
 void doubleClick(java.awt.event.MouseEvent e)
           
 boolean extendSelection(java.awt.event.MouseEvent e)
          This extends the currently selected nodes.
 void fireNodePreDeleteEvent(MindMapNode node)
          Is issued before a node is deleted.
 void firePreSaveEvent(MindMapNode node)
          Is issued before a node is saved (eg. to save its notes, too, even if the notes is currently edited).
 AttributeController getAttributeController()
           
 Controller getController()
           
 javax.swing.JFileChooser getFileChooser(javax.swing.filechooser.FileFilter filter)
           
 FreeMindMain getFrame()
           
 HookFactory getHookFactory()
           
 java.io.File getLastCurrentDir()
          If other places want to save/load something, this should be the default path.
 java.awt.Component getLeftToolBar()
          For the toolbar on the left hand side of the window.
 java.lang.String getLinkShortText(MindMapNode node)
           
 MindMap getMap()
           
 Mode getMode()
           
 javax.swing.JToolBar getModeToolBar()
           
 NodeAdapter getNodeFromID(java.lang.String nodeID)
          Given a node identifier, this method returns the corresponding node.
 java.lang.String getNodeID(MindMapNode selected)
          Calling this method the map-unique identifier of the node is returned (and created before, if not present)
 NodeView getNodeView(MindMapNode node)
           
 javax.swing.JPopupMenu getPopupForModel(java.lang.Object obj)
          This returns a context menu for an object placed in the background pane.
 javax.swing.JPopupMenu getPopupMenu()
           
 java.net.URL getResource(java.lang.String path)
           
 MindMapNode getSelected()
           
 java.util.List getSelecteds()
           
 java.util.List getSelectedsByDepth()
           
 NodeView getSelectedView()
           
 java.awt.Color getSelectionColor()
           
 java.lang.String getText(java.lang.String textId)
          Get text from resource file
 MapView getView()
           
 boolean isBlocked()
           
 ModeController load(java.io.File file)
          This is the same as load(URL) for those points where you have a file instead of an url (conversion is difficult between them...).
 ModeController load(java.net.URL file)
           
 void loadURL(java.lang.String relative)
          Opens a link in * the opened map * another map * another file.
 MindMap newMap()
           
 void nodeChanged(MindMapNode n)
          Invoke this method after you've changed how a node is to be represented in the tree.
 void nodeRefresh(MindMapNode node)
           
 void onDeselectHook(NodeView node)
          Is called when a node is deselected.
 void onSelectHook(NodeView node)
          Is called when a node is selected.
 void onViewCreatedHook(NodeView newView)
           
 void onViewRemovedHook(NodeView newView)
           
 void open()
           
 void plainClick(java.awt.event.MouseEvent e)
           
 void refreshMap()
           
 void registerNodeLifetimeListener(ModeController.NodeLifetimeListener listener)
          The onCreateNodeHook is called for every node (depest nodes first) after registration.
 void registerNodeSelectionListener(ModeController.NodeSelectionListener listener)
           
 boolean save()
           
 boolean save(java.io.File file)
           
 boolean saveAs()
           
 void select(NodeView node)
          Single selection: the node is the only one selected after calling this method.
 void setFolded(MindMapNode node, boolean folded)
          The position of this method is an exception.
 void setLastCurrentDir(java.io.File pLastCurrentDir)
          If some load/save operation has changed the path, it should be mentioned here.
 void setModel(MapAdapter model)
          This method must only be used by the model itself at creation time.
 void setVisible(boolean visible)
          This method is used to hide the map "under" another opened map.
 void showPopupMenu(java.awt.event.MouseEvent e)
           
 void shutdownController()
           
 void sortNodesByDepth(java.util.List inPlaceList)
          nodes with greater depth occur first.
 void startupController()
           
 void updateMenus(StructuredMenuHolder holder)
          Use this method to get menus to the screen.
 void updatePopupMenu(StructuredMenuHolder holder)
           
 

Field Detail

NODESEPARATOR

static final java.lang.String NODESEPARATOR
See Also:
Constant Field Values
Method Detail

load

ModeController load(java.net.URL file)
                    throws java.io.FileNotFoundException,
                           java.io.IOException,
                           XMLParseException,
                           java.net.URISyntaxException
Parameters:
file - Nowadays this is an URL to unify the behaviour of the browser and the other modes.
Returns:
returns the new mode controller created for this url.
Throws:
java.io.FileNotFoundException
java.io.IOException
XMLParseException
java.net.URISyntaxException

load

ModeController load(java.io.File file)
                    throws java.io.FileNotFoundException,
                           java.io.IOException
This is the same as load(URL) for those points where you have a file instead of an url (conversion is difficult between them...).

Throws:
java.io.FileNotFoundException
java.io.IOException

loadURL

void loadURL(java.lang.String relative)
Opens a link in * the opened map * another map * another file.


save

boolean save(java.io.File file)

newMap

MindMap newMap()

save

boolean save()
Returns:
true, if successfully saved. False, if canceled or exception.

saveAs

boolean saveAs()

open

void open()

close

boolean close(boolean force,
              MapModuleManager mapModuleManager)

createNodeTreeFromXml

MindMapNode createNodeTreeFromXml(java.io.Reader pReader,
                                  java.util.HashMap pIDToTarget)
                                  throws XMLParseException,
                                         java.io.IOException
Given a valid Xml parameterization of a node (tree), this method returns freshly created nodes.

Throws:
XMLParseException
java.io.IOException

startupController

void startupController()

shutdownController

void shutdownController()

doubleClick

void doubleClick(java.awt.event.MouseEvent e)

plainClick

void plainClick(java.awt.event.MouseEvent e)

setVisible

void setVisible(boolean visible)
This method is used to hide the map "under" another opened map. In fact, should remove the focus, stop plugins, if necessary, etc.


isBlocked

boolean isBlocked()

getNodeFromID

NodeAdapter getNodeFromID(java.lang.String nodeID)
Given a node identifier, this method returns the corresponding node.

Throws:
java.lang.IllegalArgumentException - if the id is unknown.

getNodeID

java.lang.String getNodeID(MindMapNode selected)
Calling this method the map-unique identifier of the node is returned (and created before, if not present)


select

void select(NodeView node)
Single selection: the node is the only one selected after calling this method.


getSelected

MindMapNode getSelected()

getSelectedView

NodeView getSelectedView()

getSelecteds

java.util.List getSelecteds()
Returns:
a List of MindMapNode s.

getSelectedsByDepth

java.util.List getSelectedsByDepth()
Returns:
a LinkedList of MindMapNodes ordered by depth. nodes with greater depth occur first.

sortNodesByDepth

void sortNodesByDepth(java.util.List inPlaceList)
nodes with greater depth occur first.

Parameters:
inPlaceList - the given list is sorted by reference.

extendSelection

boolean extendSelection(java.awt.event.MouseEvent e)
This extends the currently selected nodes.

Returns:
true, if the method changed the selection.

nodeChanged

void nodeChanged(MindMapNode n)
Invoke this method after you've changed how a node is to be represented in the tree.


onSelectHook

void onSelectHook(NodeView node)
Is called when a node is selected.


onDeselectHook

void onDeselectHook(NodeView node)
Is called when a node is deselected.


onViewCreatedHook

void onViewCreatedHook(NodeView newView)

onViewRemovedHook

void onViewRemovedHook(NodeView newView)

registerNodeSelectionListener

void registerNodeSelectionListener(ModeController.NodeSelectionListener listener)

deregisterNodeSelectionListener

void deregisterNodeSelectionListener(ModeController.NodeSelectionListener listener)

firePreSaveEvent

void firePreSaveEvent(MindMapNode node)
Is issued before a node is saved (eg. to save its notes, too, even if the notes is currently edited). It is issued via NodeSelectionListener.


registerNodeLifetimeListener

void registerNodeLifetimeListener(ModeController.NodeLifetimeListener listener)
The onCreateNodeHook is called for every node (depest nodes first) after registration.


deregisterNodeLifetimeListener

void deregisterNodeLifetimeListener(ModeController.NodeLifetimeListener listener)

fireNodePreDeleteEvent

void fireNodePreDeleteEvent(MindMapNode node)
Is issued before a node is deleted. It is issued via NodeLifetimeListener.


setFolded

void setFolded(MindMapNode node,
               boolean folded)
The position of this method is an exception. Normally, every method that changes nodes must be contained in the specific mode controllers but as this method is also used by the MapView to switch to neighbours (private NodeView getNeighbour(int directionCode)), we make this exception here (fc, 6.11.2005).


displayNode

void displayNode(MindMapNode node)
Unfolds a node if necessary.


centerNode

void centerNode(MindMapNode node)
Node is displayed and selected as the only one selected. It is moved to the center of the screen.


getLinkShortText

java.lang.String getLinkShortText(MindMapNode node)

getModeToolBar

javax.swing.JToolBar getModeToolBar()

getLeftToolBar

java.awt.Component getLeftToolBar()
For the toolbar on the left hand side of the window.


updateMenus

void updateMenus(StructuredMenuHolder holder)
Use this method to get menus to the screen.


updatePopupMenu

void updatePopupMenu(StructuredMenuHolder holder)

getPopupMenu

javax.swing.JPopupMenu getPopupMenu()

showPopupMenu

void showPopupMenu(java.awt.event.MouseEvent e)

getPopupForModel

javax.swing.JPopupMenu getPopupForModel(java.lang.Object obj)
This returns a context menu for an object placed in the background pane.


getFrame

FreeMindMain getFrame()

getView

MapView getView()

getMap

MindMap getMap()

setModel

void setModel(MapAdapter model)
This method must only be used by the model itself at creation time. Don't use this method.


getMode

Mode getMode()

getController

Controller getController()

getHookFactory

HookFactory getHookFactory()

getSelectionColor

java.awt.Color getSelectionColor()

getText

java.lang.String getText(java.lang.String textId)
Get text from resource file

Specified by:
getText in interface TextTranslator

getResource

java.net.URL getResource(java.lang.String path)

getLastCurrentDir

java.io.File getLastCurrentDir()
If other places want to save/load something, this should be the default path.


setLastCurrentDir

void setLastCurrentDir(java.io.File pLastCurrentDir)
If some load/save operation has changed the path, it should be mentioned here.


getAttributeController

AttributeController getAttributeController()

nodeRefresh

void nodeRefresh(MindMapNode node)

getNodeView

NodeView getNodeView(MindMapNode node)

refreshMap

void refreshMap()

copy

java.awt.datatransfer.Transferable copy(MindMapNode node,
                                        boolean saveInvisible)

copy

java.awt.datatransfer.Transferable copy()

copySingle

java.awt.datatransfer.Transferable copySingle()

copy

java.awt.datatransfer.Transferable copy(java.util.List selectedNodes,
                                        boolean copyInvisible)

getFileChooser

javax.swing.JFileChooser getFileChooser(javax.swing.filechooser.FileFilter filter)