freemind.modes
Class ControllerAdapter

java.lang.Object
  extended byfreemind.modes.ControllerAdapter
All Implemented Interfaces:
MindMapActions, ModeController
Direct Known Subclasses:
BrowseController, FileController, MindMapController, SchemeController

public abstract class ControllerAdapter
extends java.lang.Object
implements ModeController

Derive from this class to implement the Controller for your mode. Overload the methods you need for your data model, or use the defaults. There are some default Actions you may want to use for easy editing of your model. Take MindMapController as a sample.


Nested Class Summary
protected  class ControllerAdapter.EditLongAction
           
protected  class ControllerAdapter.FileOpener
           
protected  class ControllerAdapter.FollowLinkAction
           
protected  class ControllerAdapter.ModeControllerHookAction
           
protected  class ControllerAdapter.nodesDepthComparator
          This class sortes nodes by ascending depth of their paths to root.
protected  class ControllerAdapter.OpenAction
           
protected  class ControllerAdapter.SaveAction
           
protected  class ControllerAdapter.SaveAsAction
           
protected  class ControllerAdapter.SetImageByFileChooserAction
           
protected  class ControllerAdapter.SetLinkByFileChooserAction
           
 
Nested classes inherited from class freemind.modes.ModeController
ModeController.MouseWheelEventHandler
 
Field Summary
 AddArrowLinkAction addArrowLinkAction
           
 AddLocalLinkAction addLocalLinkAction
           
 BoldAction bold
           
 NodeStyleAction bubble
           
 ChangeArrowLinkEndPoints changeArrowLinkEndPoints
           
 ChangeArrowsInArrowLinkAction changeArrowsInArrowLinkAction
           
 CloudAction cloud
           
 CloudColorAction cloudColor
           
 ColorArrowLinkAction colorArrowLinkAction
           
 CopyAction copy
           
 javax.swing.Action copySingle
           
 CutAction cut
           
 DeleteChildAction deleteChild
           
 EdgeColorAction edgeColor
           
 EdgeStyleAction EdgeStyle_bezier
           
 EdgeStyleAction EdgeStyle_linear
           
 EdgeStyleAction EdgeStyle_sharp_bezier
           
 EdgeStyleAction EdgeStyle_sharp_linear
           
 EdgeStyleAction[] edgeStyles
           
 EdgeWidthAction EdgeWidth_1
           
 EdgeWidthAction EdgeWidth_2
           
 EdgeWidthAction EdgeWidth_4
           
 EdgeWidthAction EdgeWidth_8
           
 EdgeWidthAction EdgeWidth_WIDTH_PARENT
           
 EdgeWidthAction EdgeWidth_WIDTH_THIN
           
 EdgeWidthAction[] edgeWidths
           
 EditAction edit
           
 FindAction find
           
 FindAction.FindNextAction findNext
           
 FontFamilyAction fontFamily
           
 FontSizeAction fontSize
           
 NodeStyleAction fork
           
 GotoLinkNodeAction gotoLinkNodeAction
           
 ImportExplorerFavoritesAction importExplorerFavorites
           
 ImportFolderStructureAction importFolderStructure
           
 ItalicAction italic
           
 JoinNodesAction joinNodes
           
 MoveNodeAction moveNodeAction
           
static int NEW_CHILD
           
static int NEW_CHILD_WITHOUT_FOCUS
           
static int NEW_SIBLING_BEFORE
           
static int NEW_SIBLING_BEHIND
           
 NewChildAction newChild
           
 NodeBackgroundColorAction nodeBackgroundColor
           
 NodeColorAction nodeColor
           
 NodeColorBlendAction nodeColorBlend
           
 NodeDownAction nodeDown
           
 NodeHookAction nodeHookAction
           
 NodeUpAction nodeUp
           
 PasteAction paste
           
 ApplyPatternAction[] patterns
           
protected  freemind.modes.ControllerAdapter.ControllerPopupMenuListener popupListenerSingleton
          Take care! This listener is also used for modelpopups (as for graphical links).
 RedoAction redo
           
 RemoveAllIconsAction removeAllIconsAction
           
 RemoveArrowLinkAction removeArrowLinkAction
           
 RemoveLastIconAction removeLastIconAction
           
 NodeBackgroundColorAction.RemoveNodeBackgroundColorAction removeNodeBackgroundColor
           
 RevertAction revertAction
           
 SelectAllAction selectAllAction
           
 SelectBranchAction selectBranchAction
           
 SetLinkByTextFieldAction setLinkByTextField
           
 ToggleChildrenFoldedAction toggleChildrenFolded
           
 ToggleFoldedAction toggleFolded
           
 UnderlinedAction underlined
           
 UndoAction undo
           
 IconAction unknwonIconAction
           
 
Constructor Summary
ControllerAdapter(Mode mode)
           
 
Method Summary
protected  void add(javax.swing.JMenu menu, javax.swing.Action action)
           
protected  javax.swing.JMenuItem add(javax.swing.JMenu menu, javax.swing.Action action, java.lang.String keystroke)
           
protected  javax.swing.JMenuItem add(StructuredMenuHolder holder, java.lang.String category, javax.swing.Action action, java.lang.String keystroke)
           
protected  javax.swing.JMenuItem addCheckBox(StructuredMenuHolder holder, java.lang.String category, javax.swing.Action action, java.lang.String keystroke)
           
 void addHook(MindMapNode focussed, java.util.List selecteds, java.lang.String hookName)
           
 void addIcon(MindMapNode node, MindIcon icon)
          This method is nice, but how to get a MindIcon ?
 void addLink(MindMapNode source, MindMapNode target)
          Source holds the MindMapArrowLinkModel and points to the id placed in target.
 MindMapNode addNew(MindMapNode target, int newNodeMode, java.awt.event.KeyEvent e)
           
 MindMapNode addNewNode(MindMapNode parent, int index, Tools.BooleanHolder newNodeIsLeft)
          Another variant of addNew.
 void anotherNodeSelected(MindMapNode n)
           
 void applyPattern(MindMapNode node, java.lang.String patternName)
           
 void applyPattern(MindMapNode node, StylePattern pattern)
           
protected  boolean binOptionIsTrue(java.lang.String option)
           
 void blendNodeColor(MindMapNode node)
           
 void centerNode(MindMapNode node)
          Node is displayed and selected as the only one selected.
 void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink, boolean hasStartArrow, boolean hasEndArrow)
           
 boolean close(boolean force)
          Return false if user has canceled.
 NodeHook createNodeHook(java.lang.String hookName, MindMapNode node, MindMap map)
          This is the only way to instanciate new Hooks.
 java.awt.datatransfer.Transferable cut()
           
 java.awt.datatransfer.Transferable cut(java.util.List nodeList)
           
 void deleteNode(MindMapNode selectedNode)
           
 void deRegisterMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
           
 void displayNode(MindMapNode node)
          Unfolds a node if necessary.
 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()
           
protected  javax.swing.filechooser.FileFilter getFileFilter()
          You may want to implement this...
 FreeMindMain getFrame()
           
protected  java.lang.String getLinkByFileChooser(javax.swing.filechooser.FileFilter fileFilter)
           
 java.lang.String getLinkShortText(MindMapNode node)
           
 MapAdapter getMap()
           
protected  MapModule getMapModule()
           
protected  Mode getMode()
           
 ControllerAdapter getModeController()
          This was inserted by fc, 10.03.04 to enable all actions to refer to its controller easily.
 MapAdapter getModel()
           
 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)
          Default implementation: no context menu.
 java.net.URL getResource(java.lang.String name)
           
 MindMapNode getRootNode()
           
 MindMapNode getSelected()
           
 java.util.List getSelecteds()
          fc, 24.1.2004: having two methods getSelecteds with different return values (linkedlists of models resp.
 java.util.List getSelectedsByDepth()
           
 java.awt.Color getSelectionColor()
           
 java.lang.String getText(java.lang.String textId)
          Get text from resource file
 MapView getView()
           
 void handleLoadingException(java.lang.Exception ex)
           
 void increaseFontSize(MindMapNode node, int increment)
           
 void invokeHook(ModeControllerHook hook)
           
 void invokeHooksRecursively(NodeAdapter node, MindMap map)
           
 boolean isBlocked()
           
 boolean isUndoAction()
          undo in progress?
 void joinNodes(MindMapNode selectedNode, java.util.List selectedNodes)
           
 void load(java.io.File file)
          You may decide to overload this or take the default and implement the functionality in your MapModel (implements MindMap)
 void load(java.lang.String xmlMapContents)
          Load the given map (as String) instead of the currently opened map.
 void loadURL()
           
 void loadURL(java.lang.String relative)
           
 java.lang.String marshall(XmlAction action)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 void moveNodePosition(MindMapNode node, int vGap, int hGap, int shiftY)
          Moves the node to a new position.
 void moveNodes(MindMapNode selected, java.util.List selecteds, int direction)
          moves selected and selecteds (if they are child of the same parent and adjacent) in the direction specified (up = -1, down = 1).
 MindMap newMap()
           
 void newMap(MindMap mapModel)
           
 MapAdapter newModel()
          You _must_ implement this if you use one of the following actions: OpenAction, NewMapAction.
protected  MindMapNode newNode()
           
abstract  MindMapNode newNode(java.lang.Object userObject)
           
 void nodeChanged(MindMapNode node)
          Currently, this method is called by the mapAdapter.
 void nodeRefresh(MindMapNode node)
          This is nodeChanged without making the map dirty.
 void nodeStructureChanged(MindMapNode node)
           
 void open()
           
 void paste(MindMapNode node, MindMapNode parent)
           
 void paste(java.awt.datatransfer.Transferable t, MindMapNode parent)
           
 void paste(java.awt.datatransfer.Transferable t, MindMapNode target, boolean asSibling, boolean isLeft)
           
 void plainClick(java.awt.event.MouseEvent e)
           
 void registerMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
           
 void removeAllIcons(MindMapNode node)
           
 int removeLastIcon(MindMapNode node)
           
 void removeReference(MindMapLink arrowLink)
           
 boolean save()
           
 boolean save(java.io.File file)
          Return false is the action was cancelled, e.g.
 boolean saveAs()
          Save as; return false is the action was cancelled
 void select(MindMapNode selected)
          Single selection: the node is the only one selected after calling this method.
 void select(NodeView node)
          Single selection: the node is the only one selected after calling this method.
 void selectBranch(MindMapNode selected, boolean extend)
          The branch that starts from selected is added to the selection.
 void selectMultipleNodes(MindMapNode focussed, java.util.Collection selecteds)
          Multiple selection.
protected  void setAllActions(boolean enabled)
          Overwrite this to set all of your actions which are dependent on whether there is a map or not.
 void setArrowLinkColor(MindMapLink arrowLink, java.awt.Color color)
           
 void setArrowLinkEndPoints(MindMapArrowLink link, java.awt.Point startPoint, java.awt.Point endPoint)
           
 void setBlocked(boolean isBlocked)
           
 void setBold(MindMapNode node, boolean bolded)
           
 void setCloud(MindMapNode node, boolean enable)
           
 void setCloudColor(MindMapNode node, java.awt.Color color)
           
 void setEdgeColor(MindMapNode node, java.awt.Color color)
           
 void setEdgeStyle(MindMapNode node, java.lang.String style)
           
 void setEdgeWidth(MindMapNode node, int width)
          The widths range from -1 (for equal to parent) to 0 (thin), 1, 2, 4, 8.
 void setFolded(MindMapNode node, boolean folded)
           
 void setFontFamily(MindMapNode node, java.lang.String fontFamilyValue)
           
 void setFontSize(MindMapNode node, java.lang.String fontSizeValue)
           
protected  void setImageByFileChooser()
           
 void setItalic(MindMapNode node, boolean isItalic)
           
 void setLink(MindMapNode node, java.lang.String link)
          Adds a textual hyperlink to a node (e.g.
protected  void setLinkByFileChooser()
           
protected  void setMode(Mode mode)
           
 void setNodeBackgroundColor(MindMapNode node, java.awt.Color color)
           
 void setNodeColor(MindMapNode node, java.awt.Color color)
           
 void setNodeStyle(MindMapNode node, java.lang.String style)
           
 void setNodeText(MindMapNode selected, java.lang.String newText)
           
 void setToolTip(MindMapNode node, java.lang.String key, java.lang.String value)
           
 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 splitNode(MindMapNode node, int caretPosition, java.lang.String newText)
           
 void startupController()
           
 void toggleFolded()
          Switches the folding state of all selected nodes.
 XmlAction unMarshall(java.lang.String inputString)
           
protected  void updateMapModuleName()
           
 void updatePopupMenu(StructuredMenuHolder holder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemind.modes.ModeController
getPopupMenu, updateMenus
 

Field Detail

patterns

public ApplyPatternAction[] patterns

undo

public UndoAction undo

redo

public RedoAction redo

copy

public CopyAction copy

copySingle

public javax.swing.Action copySingle

cut

public CutAction cut

paste

public PasteAction paste

bold

public BoldAction bold

italic

public ItalicAction italic

underlined

public UnderlinedAction underlined

fontSize

public FontSizeAction fontSize

fontFamily

public FontFamilyAction fontFamily

edit

public EditAction edit

newChild

public NewChildAction newChild

deleteChild

public DeleteChildAction deleteChild

toggleFolded

public ToggleFoldedAction toggleFolded

toggleChildrenFolded

public ToggleChildrenFoldedAction toggleChildrenFolded

nodeUp

public NodeUpAction nodeUp

nodeDown

public NodeDownAction nodeDown

edgeColor

public EdgeColorAction edgeColor

EdgeWidth_WIDTH_PARENT

public EdgeWidthAction EdgeWidth_WIDTH_PARENT

EdgeWidth_WIDTH_THIN

public EdgeWidthAction EdgeWidth_WIDTH_THIN

EdgeWidth_1

public EdgeWidthAction EdgeWidth_1

EdgeWidth_2

public EdgeWidthAction EdgeWidth_2

EdgeWidth_4

public EdgeWidthAction EdgeWidth_4

EdgeWidth_8

public EdgeWidthAction EdgeWidth_8

edgeWidths

public EdgeWidthAction[] edgeWidths

EdgeStyle_linear

public EdgeStyleAction EdgeStyle_linear

EdgeStyle_bezier

public EdgeStyleAction EdgeStyle_bezier

EdgeStyle_sharp_linear

public EdgeStyleAction EdgeStyle_sharp_linear

EdgeStyle_sharp_bezier

public EdgeStyleAction EdgeStyle_sharp_bezier

edgeStyles

public EdgeStyleAction[] edgeStyles

nodeColorBlend

public NodeColorBlendAction nodeColorBlend

fork

public NodeStyleAction fork

bubble

public NodeStyleAction bubble

cloud

public CloudAction cloud

cloudColor

public CloudColorAction cloudColor

addArrowLinkAction

public AddArrowLinkAction addArrowLinkAction

removeArrowLinkAction

public RemoveArrowLinkAction removeArrowLinkAction

colorArrowLinkAction

public ColorArrowLinkAction colorArrowLinkAction

changeArrowsInArrowLinkAction

public ChangeArrowsInArrowLinkAction changeArrowsInArrowLinkAction

nodeBackgroundColor

public NodeBackgroundColorAction nodeBackgroundColor

removeNodeBackgroundColor

public NodeBackgroundColorAction.RemoveNodeBackgroundColorAction removeNodeBackgroundColor

unknwonIconAction

public IconAction unknwonIconAction

removeLastIconAction

public RemoveLastIconAction removeLastIconAction

removeAllIconsAction

public RemoveAllIconsAction removeAllIconsAction

setLinkByTextField

public SetLinkByTextFieldAction setLinkByTextField

addLocalLinkAction

public AddLocalLinkAction addLocalLinkAction

gotoLinkNodeAction

public GotoLinkNodeAction gotoLinkNodeAction

joinNodes

public JoinNodesAction joinNodes

moveNodeAction

public MoveNodeAction moveNodeAction

importExplorerFavorites

public ImportExplorerFavoritesAction importExplorerFavorites

importFolderStructure

public ImportFolderStructureAction importFolderStructure

changeArrowLinkEndPoints

public ChangeArrowLinkEndPoints changeArrowLinkEndPoints

find

public FindAction find

findNext

public FindAction.FindNextAction findNext

nodeHookAction

public NodeHookAction nodeHookAction

revertAction

public RevertAction revertAction

selectBranchAction

public SelectBranchAction selectBranchAction

selectAllAction

public SelectAllAction selectAllAction

nodeColor

public NodeColorAction nodeColor

popupListenerSingleton

protected final freemind.modes.ControllerAdapter.ControllerPopupMenuListener popupListenerSingleton
Take care! This listener is also used for modelpopups (as for graphical links).


NEW_CHILD_WITHOUT_FOCUS

public static final int NEW_CHILD_WITHOUT_FOCUS
See Also:
Constant Field Values

NEW_CHILD

public static final int NEW_CHILD
See Also:
Constant Field Values

NEW_SIBLING_BEHIND

public static final int NEW_SIBLING_BEHIND
See Also:
Constant Field Values

NEW_SIBLING_BEFORE

public static final int NEW_SIBLING_BEFORE
See Also:
Constant Field Values
Constructor Detail

ControllerAdapter

public ControllerAdapter(Mode mode)
Method Detail

getActionFactory

public ActionFactory getActionFactory()
Specified by:
getActionFactory in interface ModeController

newNode

public abstract MindMapNode newNode(java.lang.Object userObject)
Specified by:
newNode in interface ModeController
Parameters:
userObject - is typically a text.

newNode

protected MindMapNode newNode()

newModel

public MapAdapter newModel()
You _must_ implement this if you use one of the following actions: OpenAction, NewMapAction.


getFileFilter

protected javax.swing.filechooser.FileFilter getFileFilter()
You may want to implement this... It returns the FileFilter that is used by the open() and save() JFileChoosers.


nodeChanged

public void nodeChanged(MindMapNode node)
Currently, this method is called by the mapAdapter. This is buggy, and is to be changed.

Specified by:
nodeChanged in interface ModeController

nodeRefresh

public void nodeRefresh(MindMapNode node)
Description copied from interface: MindMapActions
This is nodeChanged without making the map dirty.

Specified by:
nodeRefresh in interface MindMapActions
Parameters:
node -

nodeStructureChanged

public void nodeStructureChanged(MindMapNode node)
Specified by:
nodeStructureChanged in interface MindMapActions

isUndoAction

public boolean isUndoAction()
Description copied from interface: ModeController
undo in progress?

Specified by:
isUndoAction in interface ModeController

anotherNodeSelected

public void anotherNodeSelected(MindMapNode n)
Specified by:
anotherNodeSelected in interface ModeController

doubleClick

public void doubleClick(java.awt.event.MouseEvent e)
Specified by:
doubleClick in interface ModeController

plainClick

public void plainClick(java.awt.event.MouseEvent e)
Specified by:
plainClick in interface ModeController

getText

public java.lang.String getText(java.lang.String textId)
Description copied from interface: ModeController
Get text from resource file

Specified by:
getText in interface ModeController

binOptionIsTrue

protected boolean binOptionIsTrue(java.lang.String option)

newMap

public MindMap newMap()
Specified by:
newMap in interface ModeController

newMap

public void newMap(MindMap mapModel)

load

public void load(java.io.File file)
          throws java.io.FileNotFoundException,
                 java.io.IOException,
                 XMLParseException
You may decide to overload this or take the default and implement the functionality in your MapModel (implements MindMap)

Specified by:
load in interface ModeController
Throws:
java.io.FileNotFoundException
java.io.IOException
XMLParseException

save

public boolean save()
Specified by:
save in interface ModeController

load

public void load(java.lang.String xmlMapContents)
Description copied from interface: MindMapActions
Load the given map (as String) instead of the currently opened map.

Specified by:
load in interface MindMapActions
Parameters:
xmlMapContents -

getSelecteds

public java.util.List getSelecteds()
fc, 24.1.2004: having two methods getSelecteds with different return values (linkedlists of models resp. views) is asking for trouble. @see MapView

Specified by:
getSelecteds in interface ModeController
Returns:
returns a list of MindMapNode s.

getSelectedsByDepth

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

sortNodesByDepth

public void sortNodesByDepth(java.util.List inPlaceList)
Description copied from interface: ModeController
nodes with greater depth occur first.

Specified by:
sortNodesByDepth in interface ModeController
Parameters:
inPlaceList - the given list is sorted by reference.

save

public boolean save(java.io.File file)
Return false is the action was cancelled, e.g. when it has to lead to saving as.

Specified by:
save in interface ModeController

add

protected javax.swing.JMenuItem add(javax.swing.JMenu menu,
                                    javax.swing.Action action,
                                    java.lang.String keystroke)
Returns:
returns the new JMenuItem.

add

protected javax.swing.JMenuItem add(StructuredMenuHolder holder,
                                    java.lang.String category,
                                    javax.swing.Action action,
                                    java.lang.String keystroke)
Parameters:
keystroke - can be null, if no keystroke should be assigned.
Returns:
returns the new JMenuItem.

addCheckBox

protected javax.swing.JMenuItem addCheckBox(StructuredMenuHolder holder,
                                            java.lang.String category,
                                            javax.swing.Action action,
                                            java.lang.String keystroke)
Parameters:
keystroke - can be null, if no keystroke should be assigned.
Returns:
returns the new JCheckBoxMenuItem.

add

protected void add(javax.swing.JMenu menu,
                   javax.swing.Action action)

open

public void open()
Specified by:
open in interface ModeController

handleLoadingException

public void handleLoadingException(java.lang.Exception ex)

saveAs

public boolean saveAs()
Save as; return false is the action was cancelled

Specified by:
saveAs in interface ModeController

close

public boolean close(boolean force)
Return false if user has canceled.

Specified by:
close in interface ModeController

setVisible

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

Specified by:
setVisible in interface ModeController

setAllActions

protected void setAllActions(boolean enabled)
Overwrite this to set all of your actions which are dependent on whether there is a map or not.


showPopupMenu

public void showPopupMenu(java.awt.event.MouseEvent e)
Specified by:
showPopupMenu in interface ModeController

getPopupForModel

public javax.swing.JPopupMenu getPopupForModel(java.lang.Object obj)
Default implementation: no context menu.

Specified by:
getPopupForModel in interface ModeController

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface ModeController

registerMouseWheelEventHandler

public void registerMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
Specified by:
registerMouseWheelEventHandler in interface ModeController

deRegisterMouseWheelEventHandler

public void deRegisterMouseWheelEventHandler(ModeController.MouseWheelEventHandler handler)
Specified by:
deRegisterMouseWheelEventHandler in interface ModeController

isBlocked

public boolean isBlocked()
Specified by:
isBlocked in interface ModeController

setBlocked

public void setBlocked(boolean isBlocked)

setBold

public void setBold(MindMapNode node,
                    boolean bolded)
Specified by:
setBold in interface MindMapActions

setItalic

public void setItalic(MindMapNode node,
                      boolean isItalic)
Specified by:
setItalic in interface MindMapActions

setCloud

public void setCloud(MindMapNode node,
                     boolean enable)
Specified by:
setCloud in interface MindMapActions

setCloudColor

public void setCloudColor(MindMapNode node,
                          java.awt.Color color)
Specified by:
setCloudColor in interface MindMapActions

setFontSize

public void setFontSize(MindMapNode node,
                        java.lang.String fontSizeValue)
Specified by:
setFontSize in interface MindMapActions

increaseFontSize

public void increaseFontSize(MindMapNode node,
                             int increment)
Specified by:
increaseFontSize in interface MindMapActions

setFontFamily

public void setFontFamily(MindMapNode node,
                          java.lang.String fontFamilyValue)
Specified by:
setFontFamily in interface MindMapActions

setNodeColor

public void setNodeColor(MindMapNode node,
                         java.awt.Color color)
Specified by:
setNodeColor in interface MindMapActions

setNodeBackgroundColor

public void setNodeBackgroundColor(MindMapNode node,
                                   java.awt.Color color)
Specified by:
setNodeBackgroundColor in interface MindMapActions

blendNodeColor

public void blendNodeColor(MindMapNode node)
Specified by:
blendNodeColor in interface MindMapActions

setEdgeColor

public void setEdgeColor(MindMapNode node,
                         java.awt.Color color)
Specified by:
setEdgeColor in interface MindMapActions

applyPattern

public void applyPattern(MindMapNode node,
                         java.lang.String patternName)
Specified by:
applyPattern in interface MindMapActions
Parameters:
patternName - is one of the names. They can be received using the patterns list of ApplyPatternActions from the ControllerAdapter. Each action has a getPattern() method and the pattern has a getName() method ...

applyPattern

public void applyPattern(MindMapNode node,
                         StylePattern pattern)
Specified by:
applyPattern in interface MindMapActions

addIcon

public void addIcon(MindMapNode node,
                    MindIcon icon)
Description copied from interface: MindMapActions
This method is nice, but how to get a MindIcon ?

Specified by:
addIcon in interface MindMapActions

removeAllIcons

public void removeAllIcons(MindMapNode node)
Specified by:
removeAllIcons in interface MindMapActions

removeLastIcon

public int removeLastIcon(MindMapNode node)
Specified by:
removeLastIcon in interface MindMapActions

addLink

public void addLink(MindMapNode source,
                    MindMapNode target)
Description copied from interface: MindMapActions
Source holds the MindMapArrowLinkModel and points to the id placed in target.

Specified by:
addLink in interface MindMapActions

removeReference

public void removeReference(MindMapLink arrowLink)
Specified by:
removeReference in interface MindMapActions

setArrowLinkColor

public void setArrowLinkColor(MindMapLink arrowLink,
                              java.awt.Color color)
Specified by:
setArrowLinkColor in interface MindMapActions

changeArrowsOfArrowLink

public void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink,
                                    boolean hasStartArrow,
                                    boolean hasEndArrow)
Specified by:
changeArrowsOfArrowLink in interface MindMapActions

setArrowLinkEndPoints

public void setArrowLinkEndPoints(MindMapArrowLink link,
                                  java.awt.Point startPoint,
                                  java.awt.Point endPoint)
Specified by:
setArrowLinkEndPoints in interface MindMapActions

setLink

public void setLink(MindMapNode node,
                    java.lang.String link)
Description copied from interface: MindMapActions
Adds a textual hyperlink to a node (e.g. http:/freemind.sourceforge.net)

Specified by:
setLink in interface MindMapActions
Parameters:
node -
link -

setToolTip

public void setToolTip(MindMapNode node,
                       java.lang.String key,
                       java.lang.String value)
Specified by:
setToolTip in interface MindMapActions
Parameters:
node -
key - key value patterns is used to ensure, that more than one tooltip can be displayed.
value - null if you want to delete this tooltip.

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 ModeController

setNodeText

public void setNodeText(MindMapNode selected,
                        java.lang.String newText)
Specified by:
setNodeText in interface MindMapActions

setEdgeWidth

public void setEdgeWidth(MindMapNode node,
                         int width)
Description copied from interface: MindMapActions
The widths range from -1 (for equal to parent) to 0 (thin), 1, 2, 4, 8.

Specified by:
setEdgeWidth in interface MindMapActions

setEdgeStyle

public void setEdgeStyle(MindMapNode node,
                         java.lang.String style)
Specified by:
setEdgeStyle in interface MindMapActions

setNodeStyle

public void setNodeStyle(MindMapNode node,
                         java.lang.String style)
Specified by:
setNodeStyle in interface MindMapActions

cut

public java.awt.datatransfer.Transferable cut()
Specified by:
cut in interface MindMapActions

cut

public java.awt.datatransfer.Transferable cut(java.util.List nodeList)
Specified by:
cut in interface MindMapActions

paste

public void paste(java.awt.datatransfer.Transferable t,
                  MindMapNode parent)
Specified by:
paste in interface MindMapActions

paste

public void paste(java.awt.datatransfer.Transferable t,
                  MindMapNode target,
                  boolean asSibling,
                  boolean isLeft)
Specified by:
paste in interface MindMapActions
Parameters:
isLeft - determines, whether or not the node is placed on the left or right.

paste

public void paste(MindMapNode node,
                  MindMapNode parent)
Specified by:
paste in interface MindMapActions

addNew

public MindMapNode addNew(MindMapNode target,
                          int newNodeMode,
                          java.awt.event.KeyEvent e)
Specified by:
addNew in interface MindMapActions

addNewNode

public MindMapNode addNewNode(MindMapNode parent,
                              int index,
                              Tools.BooleanHolder newNodeIsLeft)
Description copied from interface: MindMapActions
Another variant of addNew. If the index of the new node as a child of parent is known, this method is easier to use. Moreover, it does not automatically start an editor.

Specified by:
addNewNode in interface MindMapActions
Parameters:
newNodeIsLeft - here, normally parent.isLeft() or null is used.
Returns:
returns the new node.

deleteNode

public void deleteNode(MindMapNode selectedNode)
Specified by:
deleteNode in interface MindMapActions

toggleFolded

public void toggleFolded()
Description copied from interface: MindMapActions
Switches the folding state of all selected nodes. In fact, it determines one action (fold or unfold) and applies this action to every selected node.

Specified by:
toggleFolded in interface MindMapActions

setFolded

public void setFolded(MindMapNode node,
                      boolean folded)
Specified by:
setFolded in interface MindMapActions
Parameters:
node -
folded -

displayNode

public void displayNode(MindMapNode node)
Description copied from interface: MindMapActions
Unfolds a node if necessary.

Specified by:
displayNode in interface MindMapActions
Parameters:
node -

centerNode

public void centerNode(MindMapNode node)
Description copied from interface: MindMapActions
Node is displayed and selected as the only one selected. It is moved to the center of the screen.

Specified by:
centerNode in interface MindMapActions
Parameters:
node -

getLinkShortText

public java.lang.String getLinkShortText(MindMapNode node)
Specified by:
getLinkShortText in interface MindMapActions

moveNodes

public void moveNodes(MindMapNode selected,
                      java.util.List selecteds,
                      int direction)
Description copied from interface: MindMapActions
moves selected and selecteds (if they are child of the same parent and adjacent) in the direction specified (up = -1, down = 1).

Specified by:
moveNodes in interface MindMapActions

joinNodes

public void joinNodes(MindMapNode selectedNode,
                      java.util.List selectedNodes)
Specified by:
joinNodes in interface MindMapActions

setLinkByFileChooser

protected void setLinkByFileChooser()

setImageByFileChooser

protected void setImageByFileChooser()

getLinkByFileChooser

protected java.lang.String getLinkByFileChooser(javax.swing.filechooser.FileFilter fileFilter)

loadURL

public void loadURL(java.lang.String relative)

loadURL

public void loadURL()

getMode

protected Mode getMode()

setMode

protected void setMode(Mode mode)

getMapModule

protected MapModule getMapModule()

getMap

public MapAdapter getMap()
Specified by:
getMap in interface ModeController

getRootNode

public MindMapNode getRootNode()
Specified by:
getRootNode in interface MindMapActions

getResource

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

getController

public Controller getController()
Specified by:
getController in interface ModeController

getFrame

public FreeMindMain getFrame()
Specified by:
getFrame in interface ModeController

getModeController

public ControllerAdapter getModeController()
This was inserted by fc, 10.03.04 to enable all actions to refer to its controller easily.


getModel

public MapAdapter getModel()

getView

public MapView getView()
Specified by:
getView in interface ModeController

updateMapModuleName

protected void updateMapModuleName()

getNodeFromID

public NodeAdapter getNodeFromID(java.lang.String nodeID)
Description copied from interface: ModeController
Given a node identifier, this method returns the corresponding node.

Specified by:
getNodeFromID in interface ModeController

getNodeID

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

Specified by:
getNodeID in interface ModeController

getSelected

public MindMapNode getSelected()
Specified by:
getSelected in interface ModeController

extendSelection

public boolean extendSelection(java.awt.event.MouseEvent e)
Description copied from interface: ModeController
This extends the currently selected nodes.

Specified by:
extendSelection in interface ModeController
Returns:
true, if the method changed the selection.

select

public void select(NodeView node)
Description copied from interface: MindMapActions
Single selection: the node is the only one selected after calling this method.

Specified by:
select in interface MindMapActions
Parameters:
node -

select

public void select(MindMapNode selected)
Description copied from interface: MindMapActions
Single selection: the node is the only one selected after calling this method.

Specified by:
select in interface MindMapActions
Parameters:
selected -

selectMultipleNodes

public void selectMultipleNodes(MindMapNode focussed,
                                java.util.Collection selecteds)
Description copied from interface: MindMapActions
Multiple selection.

Specified by:
selectMultipleNodes in interface MindMapActions
Parameters:
focussed - will be focussed afterwards
selecteds - are all nodes that are selected (the focussed has not to be contained).

selectBranch

public void selectBranch(MindMapNode selected,
                         boolean extend)
Description copied from interface: MindMapActions
The branch that starts from selected is added to the selection. On extend = false clear up the previous selection. if extend is false, the past selection will be empty. if yes, the selection will extended with this node and its children

Specified by:
selectBranch in interface MindMapActions

invokeHook

public void invokeHook(ModeControllerHook hook)
Specified by:
invokeHook in interface ModeController

invokeHooksRecursively

public void invokeHooksRecursively(NodeAdapter node,
                                   MindMap map)
Specified by:
invokeHooksRecursively in interface ModeController

createNodeHook

public NodeHook createNodeHook(java.lang.String hookName,
                               MindMapNode node,
                               MindMap map)
Description copied from interface: ModeController
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.

Specified by:
createNodeHook in interface ModeController
Parameters:
map - may be null if not known. But it has to be set afterwards!

addHook

public void addHook(MindMapNode focussed,
                    java.util.List selecteds,
                    java.lang.String hookName)
Specified by:
addHook in interface MindMapActions

marshall

public java.lang.String marshall(XmlAction action)
Specified by:
marshall in interface ModeController

unMarshall

public XmlAction unMarshall(java.lang.String inputString)
Specified by:
unMarshall in interface ModeController

getActionXmlFactory

public ObjectFactory getActionXmlFactory()
Specified by:
getActionXmlFactory in interface ModeController
Returns:

getSelectionColor

public java.awt.Color getSelectionColor()
Specified by:
getSelectionColor in interface ModeController
Returns:

getClipboard

public java.awt.datatransfer.Clipboard getClipboard()
Specified by:
getClipboard in interface ModeController
Returns:

updatePopupMenu

public void updatePopupMenu(StructuredMenuHolder holder)
Specified by:
updatePopupMenu in interface ModeController

shutdownController

public void shutdownController()
Specified by:
shutdownController in interface ModeController

startupController

public void startupController()
Specified by:
startupController in interface ModeController

splitNode

public void splitNode(MindMapNode node,
                      int caretPosition,
                      java.lang.String newText)
Specified by:
splitNode in interface MindMapActions
Parameters:
node -
newText -

moveNodePosition

public void moveNodePosition(MindMapNode node,
                             int vGap,
                             int hGap,
                             int shiftY)
Description copied from interface: MindMapActions
Moves the node to a new position.

Specified by:
moveNodePosition in interface MindMapActions
Parameters:
node -
vGap -
hGap -
shiftY -