freemind.modes
Interface ModeController

All Superinterfaces:
MindMapActions
All Known Implementing Classes:
ControllerAdapter

public interface ModeController
extends MindMapActions


Nested Class Summary
static interface ModeController.MouseWheelEventHandler
           
 
Method Summary
 void anotherNodeSelected(MindMapNode n)
           
 boolean close(boolean force)
           
 NodeHook createNodeHook(java.lang.String hookName, MindMapNode node, MindMap map)
          This is the only way to instanciate new Hooks.
 void deRegisterMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
           
 void doubleClick(java.awt.event.MouseEvent e)
           
 void edit(java.awt.event.KeyEvent e, boolean addNew, boolean editLong)
          The following modes are present: public final int NEW_CHILD_WITHOUT_FOCUS = 1; // old model of insertion public final int NEW_CHILD = 2; public final int NEW_SIBLING_BEHIND = 3; public final int NEW_SIBLING_BEFORE = 4;
 boolean extendSelection(java.awt.event.MouseEvent e)
          This extends the currently selected nodes.
 ActionFactory getActionFactory()
           
 ObjectFactory getActionXmlFactory()
           
 java.awt.datatransfer.Clipboard getClipboard()
           
 Controller getController()
           
 FreeMindMain getFrame()
           
 MapAdapter getMap()
           
 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)
 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()
           
 MindMapNode getSelected()
           
 java.util.List getSelecteds()
           
 java.util.List getSelectedsByDepth()
           
 java.awt.Color getSelectionColor()
           
 java.lang.String getText(java.lang.String textId)
          Get text from resource file
 MapView getView()
           
 void invokeHook(ModeControllerHook hook)
           
 void invokeHooksRecursively(NodeAdapter node, MindMap map)
           
 boolean isBlocked()
           
 boolean isUndoAction()
          undo in progress?
 void load(java.io.File file)
           
 java.lang.String marshall(XmlAction action)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 MindMap newMap()
           
 MindMapNode newNode(java.lang.Object userObject)
           
 void nodeChanged(MindMapNode n)
          Invoke this method after you've changed how a node is to be represented in the tree.
 void open()
           
 void plainClick(java.awt.event.MouseEvent e)
           
 void registerMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
           
 boolean save()
           
 boolean save(java.io.File file)
           
 boolean saveAs()
           
 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()
           
 XmlAction unMarshall(java.lang.String inputString)
           
 void updateMenus(StructuredMenuHolder holder)
          Use this method to get menus to the screen.
 void updatePopupMenu(StructuredMenuHolder holder)
           
 
Methods inherited from interface freemind.modes.actions.MindMapActions
addHook, addIcon, addLink, addNew, addNewNode, applyPattern, applyPattern, blendNodeColor, centerNode, changeArrowsOfArrowLink, cut, cut, deleteNode, displayNode, getLinkShortText, getRootNode, increaseFontSize, joinNodes, load, moveNodePosition, moveNodes, nodeRefresh, nodeStructureChanged, paste, paste, paste, removeAllIcons, removeLastIcon, removeReference, select, select, selectBranch, selectMultipleNodes, setArrowLinkColor, setArrowLinkEndPoints, setBold, setCloud, setCloudColor, setEdgeColor, setEdgeStyle, setEdgeWidth, setFolded, setFontFamily, setFontSize, setItalic, setLink, setNodeBackgroundColor, setNodeColor, setNodeStyle, setNodeText, setToolTip, splitNode, toggleFolded
 

Method Detail

load

public void load(java.io.File file)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 XMLParseException
Throws:
java.io.FileNotFoundException
java.io.IOException
XMLParseException

save

public boolean save(java.io.File file)

newNode

public MindMapNode newNode(java.lang.Object userObject)
Parameters:
userObject - is typically a text.

newMap

public MindMap newMap()

save

public boolean save()

saveAs

public boolean saveAs()

open

public void open()

close

public boolean close(boolean force)

startupController

public void startupController()

shutdownController

public void shutdownController()

setVisible

public 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.


doubleClick

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

plainClick

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

isBlocked

public boolean isBlocked()

edit

public void edit(java.awt.event.KeyEvent e,
                 boolean addNew,
                 boolean editLong)
Description copied from interface: MindMapActions
The following modes are present: public final int NEW_CHILD_WITHOUT_FOCUS = 1; // old model of insertion public final int NEW_CHILD = 2; public final int NEW_SIBLING_BEHIND = 3; public final int NEW_SIBLING_BEFORE = 4;

Specified by:
edit in interface MindMapActions
See Also:
ControllerAdapter

registerMouseWheelEventHandler

public void registerMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)

deRegisterMouseWheelEventHandler

public void deRegisterMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)

getSelected

public MindMapNode getSelected()

getSelecteds

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

getSelectedsByDepth

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

sortNodesByDepth

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

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

extendSelection

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

Returns:
true, if the method changed the selection.

updateMenus

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


updatePopupMenu

public void updatePopupMenu(StructuredMenuHolder holder)

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu()

showPopupMenu

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

getPopupForModel

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


nodeChanged

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

Specified by:
nodeChanged in interface MindMapActions
Parameters:
n -

anotherNodeSelected

public void anotherNodeSelected(MindMapNode n)

getNodeFromID

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


getNodeID

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


createNodeHook

public NodeHook createNodeHook(java.lang.String hookName,
                               MindMapNode node,
                               MindMap map)
This is the only way to instanciate new Hooks. THEY HAVE TO BE INVOKED AFTERWARDS! The hook is equipped with the map and controller information. Furthermore, the hook is added to the node, if it is an instance of the PermanentNodeHook. If the hook policy specifies, that only one instance may exist per node, it returns this instance if it already exists.

Parameters:
map - may be null if not known. But it has to be set afterwards!

invokeHook

public void invokeHook(ModeControllerHook hook)

invokeHooksRecursively

public void invokeHooksRecursively(NodeAdapter node,
                                   MindMap map)

getFrame

public FreeMindMain getFrame()

getView

public MapView getView()

getMap

public MapAdapter getMap()

getController

public Controller getController()

getClipboard

public java.awt.datatransfer.Clipboard getClipboard()

getActionFactory

public ActionFactory getActionFactory()

getActionXmlFactory

public ObjectFactory getActionXmlFactory()

getSelectionColor

public java.awt.Color getSelectionColor()

getText

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


marshall

public java.lang.String marshall(XmlAction action)

unMarshall

public XmlAction unMarshall(java.lang.String inputString)

isUndoAction

public boolean isUndoAction()
undo in progress?