freemind.modes.mindmapmode
Class MindMapController

java.lang.Object
  extended by freemind.modes.ControllerAdapter
      extended by freemind.modes.mindmapmode.MindMapController
All Implemented Interfaces:
TextTranslator, MindMapActions, ModeController

public class MindMapController
extends ControllerAdapter
implements MindMapActions


Nested Class Summary
protected  class MindMapController.AssignAttributesAction
           
 class MindMapController.DefaultMindMapNodeCreator
           
protected  class MindMapController.EditLongAction
           
protected  class MindMapController.ExportBranchToHTMLAction
           
protected  class MindMapController.ExportToHTMLAction
           
protected  class MindMapController.FollowLinkAction
           
static interface MindMapController.MindMapControllerPlugin
           
static interface MindMapController.NewNodeCreator
           
protected  class MindMapController.SetImageByFileChooserAction
           
protected  class MindMapController.SetLinkByFileChooserAction
           
 
Nested classes/interfaces inherited from class freemind.modes.ControllerAdapter
ControllerAdapter.EditAttributesAction, ControllerAdapter.FileOpener, ControllerAdapter.nodesDepthComparator, ControllerAdapter.OpenAction, ControllerAdapter.SaveAction, ControllerAdapter.SaveAsAction
 
Nested classes/interfaces inherited from interface freemind.modes.mindmapmode.actions.MindMapActions
MindMapActions.MouseWheelEventHandler
 
Nested classes/interfaces inherited from interface freemind.modes.ModeController
ModeController.NodeLifetimeListener, ModeController.NodeSelectionListener
 
Field Summary
 AddArrowLinkAction addArrowLinkAction
           
 AddLocalLinkAction addLocalLinkAction
           
protected  AssignAttributeDialog assignAttributeDialog
           
 javax.swing.Action assignAttributes
           
 BoldAction bold
           
 NodeStyleAction bubble
           
 ChangeArrowLinkEndPoints changeArrowLinkEndPoints
           
 ChangeArrowsInArrowLinkAction changeArrowsInArrowLinkAction
           
 CloudAction cloud
           
 CloudColorAction cloudColor
           
 ColorArrowLinkAction colorArrowLinkAction
           
 CopyAction copy
           
 javax.swing.Action copySingle
           
 CutAction cut
           
 javax.swing.Action decreaseNodeFont
           
 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
           
 javax.swing.Action editAttributes
           
 javax.swing.Action editLong
           
 javax.swing.Action exportBranch
           
 javax.swing.Action exportBranchToHTML
           
 javax.swing.Action exportToHTML
           
 FindAction find
           
 FindAction.FindNextAction findNext
           
 javax.swing.Action followLink
           
 FontFamilyAction fontFamily
           
 FontSizeAction fontSize
           
 NodeStyleAction fork
           
 GotoLinkNodeAction gotoLinkNodeAction
           
 java.util.Vector iconActions
           
 javax.swing.Action importBranch
           
 ImportExplorerFavoritesAction importExplorerFavorites
           
 ImportFolderStructureAction importFolderStructure
           
 javax.swing.Action importLinkedBranch
           
 javax.swing.Action importLinkedBranchWithoutRoot
           
 javax.swing.Action increaseNodeFont
           
 ItalicAction italic
           
 JoinNodesAction joinNodes
           
 MoveNodeAction moveNodeAction
           
 NewChildAction newChild
           
 javax.swing.Action newMap
           
 javax.swing.Action newPreviousSibling
           
 javax.swing.Action newSibling
           
 NodeBackgroundColorAction nodeBackgroundColor
           
 NodeColorAction nodeColor
           
 NodeColorBlendAction nodeColorBlend
           
 NodeDownAction nodeDown
           
 NodeHookAction nodeHookAction
           
 NodeUpAction nodeUp
           
 javax.swing.Action open
           
 PasteAction paste
           
 ApplyPatternAction[] patterns
           
 RedoAction redo
           
 RemoveAllIconsAction removeAllIconsAction
           
 RemoveArrowLinkAction removeArrowLinkAction
           
 RemoveIconAction removeLastIconAction
           
 NodeBackgroundColorAction.RemoveNodeBackgroundColorAction removeNodeBackgroundColor
           
 RevertAction revertAction
           
 javax.swing.Action save
           
 javax.swing.Action saveAs
           
 SelectAllAction selectAllAction
           
 SelectBranchAction selectBranchAction
           
 javax.swing.Action setImageByFileChooser
           
 javax.swing.Action setLinkByFileChooser
           
 SetLinkByTextFieldAction setLinkByTextField
           
 javax.swing.Action showAttributeManagerAction
           
 ToggleChildrenFoldedAction toggleChildrenFolded
           
 ToggleFoldedAction toggleFolded
           
 UnderlinedAction underlined
           
 UndoAction undo
           
 NodeHookUndoableContentActor undoableHookContentActor
           
 IconAction unknownIconAction
           
 UsePlainTextAction usePlainText
           
 UseRichFormattingAction useRichFormatting
           
 
Fields inherited from class freemind.modes.ControllerAdapter
popupListenerSingleton
 
Fields inherited from interface freemind.modes.mindmapmode.actions.MindMapActions
NEW_CHILD, NEW_CHILD_WITHOUT_FOCUS, NEW_SIBLING_BEFORE, NEW_SIBLING_BEHIND
 
Fields inherited from interface freemind.modes.ModeController
NODESEPARATOR
 
Constructor Summary
MindMapController(Mode mode)
           
 
Method Summary
 int addAttribute(MindMapNode node, Attribute pAttribute)
          Inserts a new attribute at the end of the attributes table.
 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 addIconsToMenu(StructuredMenuHolder holder, java.lang.String iconMenuString)
           
 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, boolean newNodeIsLeft)
          Another variant of addNew.
 void applyPattern(MindMapNode node, freemind.controller.actions.generated.instance.Pattern pattern)
           
 void applyPattern(MindMapNode node, java.lang.String patternName)
           
 void blendNodeColor(MindMapNode node)
           
 void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink, boolean hasStartArrow, boolean hasEndArrow)
           
 void clearNodeContents(MindMapNode pNode)
          Erases all content of the node as text, colors, fonts, etc.
 java.awt.datatransfer.Transferable copy(MindMapNode node, boolean saveInvisible)
           
 freemind.controller.actions.generated.instance.EditNoteToNodeAction createEditNoteToNodeAction(MindMapNode node, java.lang.String text)
           
 NodeHook createNodeHook(java.lang.String hookName, MindMapNode node, MindMap map)
          This is the only way to instanciate new Hooks.
 void createPatternSubMenu(StructuredMenuHolder holder, java.lang.String formatMenuString)
           
 XMLElement createXMLElement()
           
 java.awt.datatransfer.Transferable cut()
           
 java.awt.datatransfer.Transferable cut(java.util.List nodeList)
           
 freemind.controller.actions.generated.instance.WindowConfigurationStorage decorateDialog(javax.swing.JDialog dialog, java.lang.String window_preference_storage_property)
           
 void deleteNode(MindMapNode selectedNode)
           
 void deRegisterMouseWheelEventHandler(MindMapActions.MouseWheelEventHandler handler)
           
 void deregisterPlugin(MindMapController.MindMapControllerPlugin pPlugin)
           
 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; see MindMapController
 int editAttribute(MindMapNode pNode, java.lang.String pName, java.lang.String pNewValue)
          If an attribute with the same name exists, its value is changed.
 boolean extendSelection(java.awt.event.MouseEvent e)
          This extends the currently selected nodes.
 ActionFactory getActionFactory()
           
 AttributeController getAttributeController()
           
 AttributePopupMenu getAttributeTablePopupMenu()
           
 java.awt.datatransfer.Clipboard getClipboard()
           
 javax.swing.filechooser.FileFilter getFileFilter()
          You may want to implement this...
 HookFactory getHookFactory()
           
 java.awt.Component getLeftToolBar()
          Overwrite this, if you have one.
protected  java.lang.String getLinkByFileChooser(javax.swing.filechooser.FileFilter fileFilter)
           
 javax.swing.JToolBar getModeToolBar()
          Overwrite this, if you have one.
 java.io.Reader getPatternReader()
           
 java.util.Set getPlugins()
           
 javax.swing.JPopupMenu getPopupForModel(java.lang.Object obj)
          Link implementation: If this is a link, we want to make a popup with at least removelink available.
 javax.swing.JPopupMenu getPopupMenu()
           
 java.util.Set getRegisteredMouseWheelEventHandler()
           
 void increaseFontSize(MindMapNode node, int increment)
           
 void insertNodeInto(MindMapNode newNode, MindMapNode parent, int index)
           
 void invokeHook(ModeControllerHook hook)
           
 boolean isUndoAction()
          undo in progress?
 void joinNodes(MindMapNode selectedNode, java.util.List selectedNodes)
           
 void load(java.lang.String xmlMapContents)
          Load the given map (as String) instead of the currently opened map.
 void loadPatterns(java.io.Reader reader)
          Creates the patterns actions (saved in array patterns), and the pure patterns list (saved in mPatternsList).
 void loadURL(java.lang.String relative)
          Opens a link in * the opened map * another map * another file.
 java.lang.String marshall(freemind.controller.actions.generated.instance.XmlAction action)
           
 void moveNodePosition(MindMapNode node, int parentVGap, 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).
 MapAdapter newModel(ModeController modeController)
          You _must_ implement this if you use one of the following actions: OpenAction, NewMapAction.
 MindMapNode newNode(java.lang.Object userObject, MindMap map)
           
 void nodeChanged(MindMapNode n)
          Currently, this method is called by the mapAdapter.
 void nodeStyleChanged(MindMapNode node)
           
 void onSelectHook(NodeView n)
          Is called when a node is selected.
 void paste(MindMapNode node, MindMapNode parent)
           
 void paste(java.awt.datatransfer.Transferable t, MindMapNode parent)
           
 boolean paste(java.awt.datatransfer.Transferable t, MindMapNode target, boolean asSibling, boolean isLeft)
           
 void plainClick(java.awt.event.MouseEvent e)
           
 void processMenuCategory(StructuredMenuHolder holder, java.util.List list, java.lang.String category)
           
 void registerMouseWheelEventHandler(MindMapActions.MouseWheelEventHandler handler)
           
 void registerPlugin(MindMapController.MindMapControllerPlugin pPlugin)
           
 void removeAllIcons(MindMapNode node)
           
 void removeAttribute(MindMapNode pNode, int pPosition)
          Removes the attribute at the given position
 int removeLastIcon(MindMapNode node)
           
 void removeNodeFromParent(MindMapNode selectedNode)
           
 void removeReference(MindMapLink arrowLink)
           
 void repaintMap()
           
static void saveHTML(java.util.List mindMapNodes, java.io.Writer fileout)
           
static void saveHTML(MindMapNodeModel rootNodeOfBranch, java.io.File file)
           
 void select(NodeView node)
          Single selection: the node is the only one selected after calling this method.
 void selectBranch(NodeView selected, boolean extend)
           
 void selectMultipleNodes(MindMapNode focussed, java.util.Collection selecteds)
           
 void selectMultipleNodes(NodeView focussed, java.util.Collection selecteds)
           
protected  void setAllActions(boolean enabled)
          Enabled/Disabled all actions that are dependent on whether there is a map open or not.
 void setArrowLinkColor(MindMapLink arrowLink, java.awt.Color color)
           
 void setArrowLinkEndPoints(MindMapArrowLink link, java.awt.Point startPoint, java.awt.Point endPoint)
           
 void setAttribute(MindMapNode pNode, int pPosition, Attribute pAttribute)
           
 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)
          The position of this method is an exception.
 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. http:/freemind.sourceforge.net)
protected  void setLinkByFileChooser()
           
 void setNewNodeCreator(MindMapController.NewNodeCreator creator)
           
 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 setNoteText(MindMapNode node, java.lang.String text)
           
 void setToolTip(MindMapNode node, java.lang.String key, java.lang.String value)
           
 void shutdownController()
           
 void splitNode(MindMapNode node, int caretPosition, java.lang.String newText)
           
 void startupController()
          This method is called after and before a change of the map module.
 void storeDialogPositions(javax.swing.JDialog dialog, freemind.controller.actions.generated.instance.WindowConfigurationStorage pStorage, java.lang.String window_preference_storage_property)
           
 void toggleFolded()
          Switches the folding state of all selected nodes.
 freemind.controller.actions.generated.instance.XmlAction unMarshall(java.lang.String inputString)
           
 void updateMenus(StructuredMenuHolder holder)
          Use this method to get menus to the screen.
 freemind.controller.actions.generated.instance.MenuStructure updateMenusFromXml(java.io.InputStream in)
           
protected  void updateNode(MindMapNode node)
          Overwrite this method to perform additional operations to an node update.
 
Methods inherited from class freemind.modes.ControllerAdapter
_setFolded, add, add, add, addCheckBox, addRadioItem, centerNode, close, copy, copy, copySingle, createForNodesFlavor, createNodeTreeFromXml, deregisterNodeLifetimeListener, deregisterNodeSelectionListener, displayNode, displayNode, fireNodePostDeleteEvent, fireNodePreDeleteEvent, firePreSaveEvent, fireRecursiveNodeCreateEvent, getController, getFileChooser, getFileChooser, getFrame, getLastCurrentDir, getLinkShortText, getMap, getMode, getModeController, getModel, getNodeFromID, getNodeID, getNodeLifetimeListeners, getNodeView, getResource, getRootNode, getSelected, getSelecteds, getSelectedsByDepth, getSelectedView, getSelectionColor, getText, getView, handleLoadingException, insertNodeInto, invokeHooksRecursively, isBlocked, load, loadURL, newMap, newMap, nodeRefresh, nodeStructureChanged, onDeselectHook, onViewCreatedHook, onViewRemovedHook, open, refreshMap, refreshMapFrom, registerNodeLifetimeListener, registerNodeSelectionListener, save, save, saveAs, setBlocked, setLastCurrentDir, setMode, setModel, setVisible, showPopupMenu, sortNodesByDepth, updateMapModuleName, updatePopupMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemind.modes.mindmapmode.actions.MindMapActions
getRootNode, invokeHooksRecursively, nodeRefresh, nodeStructureChanged
 

Field Detail

patterns

public ApplyPatternAction[] patterns

newMap

public javax.swing.Action newMap

open

public javax.swing.Action open

save

public javax.swing.Action save

saveAs

public javax.swing.Action saveAs

exportToHTML

public javax.swing.Action exportToHTML

exportBranchToHTML

public javax.swing.Action exportBranchToHTML

editLong

public javax.swing.Action editLong

editAttributes

public javax.swing.Action editAttributes

assignAttributeDialog

protected AssignAttributeDialog assignAttributeDialog

assignAttributes

public javax.swing.Action assignAttributes

newSibling

public javax.swing.Action newSibling

newPreviousSibling

public javax.swing.Action newPreviousSibling

setLinkByFileChooser

public javax.swing.Action setLinkByFileChooser

setImageByFileChooser

public javax.swing.Action setImageByFileChooser

followLink

public javax.swing.Action followLink

exportBranch

public javax.swing.Action exportBranch

importBranch

public javax.swing.Action importBranch

importLinkedBranch

public javax.swing.Action importLinkedBranch

importLinkedBranchWithoutRoot

public javax.swing.Action importLinkedBranchWithoutRoot

showAttributeManagerAction

public javax.swing.Action showAttributeManagerAction

increaseNodeFont

public javax.swing.Action increaseNodeFont

decreaseNodeFont

public javax.swing.Action decreaseNodeFont

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

nodeColor

public NodeColorAction nodeColor

edit

public EditAction edit

newChild

public NewChildAction newChild

deleteChild

public DeleteChildAction deleteChild

toggleFolded

public ToggleFoldedAction toggleFolded

toggleChildrenFolded

public ToggleChildrenFoldedAction toggleChildrenFolded

useRichFormatting

public UseRichFormattingAction useRichFormatting

usePlainText

public UsePlainTextAction usePlainText

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

unknownIconAction

public IconAction unknownIconAction

removeLastIconAction

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

iconActions

public java.util.Vector iconActions

undoableHookContentActor

public NodeHookUndoableContentActor undoableHookContentActor
Constructor Detail

MindMapController

public MindMapController(Mode mode)
Method Detail

getPatternReader

public java.io.Reader getPatternReader()
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

getClipboard

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

isUndoAction

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

Specified by:
isUndoAction in interface MindMapActions

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

loadPatterns

public void loadPatterns(java.io.Reader reader)
                  throws java.lang.Exception
Creates the patterns actions (saved in array patterns), and the pure patterns list (saved in mPatternsList).

Throws:
java.lang.Exception

startupController

public void startupController()
This method is called after and before a change of the map module. Use it to perform the actions that cannot be performed at creation time.

Specified by:
startupController in interface ModeController
Overrides:
startupController in class ControllerAdapter

shutdownController

public void shutdownController()
Specified by:
shutdownController in interface ModeController
Overrides:
shutdownController in class ControllerAdapter

newModel

public MapAdapter newModel(ModeController modeController)
Description copied from class: ControllerAdapter
You _must_ implement this if you use one of the following actions: OpenAction, NewMapAction.

Overrides:
newModel in class ControllerAdapter
Parameters:
modeController - TODO

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Description copied from class: ControllerAdapter
You may want to implement this... It returns the FileFilter that is used by the open() and save() JFileChoosers.

Overrides:
getFileFilter in class ControllerAdapter

nodeChanged

public void nodeChanged(MindMapNode n)
Description copied from class: ControllerAdapter
Currently, this method is called by the mapAdapter. This is buggy, and is to be changed.

Specified by:
nodeChanged in interface MindMapActions
Specified by:
nodeChanged in interface ModeController
Overrides:
nodeChanged in class ControllerAdapter

onSelectHook

public void onSelectHook(NodeView n)
Description copied from interface: ModeController
Is called when a node is selected.

Specified by:
onSelectHook in interface ModeController
Overrides:
onSelectHook in class ControllerAdapter

setNewNodeCreator

public void setNewNodeCreator(MindMapController.NewNodeCreator creator)

newNode

public MindMapNode newNode(java.lang.Object userObject,
                           MindMap map)
Specified by:
newNode in class ControllerAdapter

updateMenus

public void updateMenus(StructuredMenuHolder holder)
Description copied from interface: ModeController
Use this method to get menus to the screen.

Specified by:
updateMenus in interface ModeController

addIconsToMenu

public void addIconsToMenu(StructuredMenuHolder holder,
                           java.lang.String iconMenuString)

createPatternSubMenu

public void createPatternSubMenu(StructuredMenuHolder holder,
                                 java.lang.String formatMenuString)

updateMenusFromXml

public freemind.controller.actions.generated.instance.MenuStructure updateMenusFromXml(java.io.InputStream in)

processMenuCategory

public void processMenuCategory(StructuredMenuHolder holder,
                                java.util.List list,
                                java.lang.String category)

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu()
Specified by:
getPopupMenu in interface ModeController

getPopupForModel

public javax.swing.JPopupMenu getPopupForModel(java.lang.Object obj)
Link implementation: If this is a link, we want to make a popup with at least removelink available.

Specified by:
getPopupForModel in interface ModeController
Overrides:
getPopupForModel in class ControllerAdapter

getModeToolBar

public javax.swing.JToolBar getModeToolBar()
Description copied from class: ControllerAdapter
Overwrite this, if you have one.

Specified by:
getModeToolBar in interface ModeController
Overrides:
getModeToolBar in class ControllerAdapter

getLeftToolBar

public java.awt.Component getLeftToolBar()
Description copied from class: ControllerAdapter
Overwrite this, if you have one.

Specified by:
getLeftToolBar in interface ModeController
Overrides:
getLeftToolBar in class ControllerAdapter

setAllActions

protected void setAllActions(boolean enabled)
Enabled/Disabled all actions that are dependent on whether there is a map open or not.

Overrides:
setAllActions in class ControllerAdapter

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
patternName - is one of the names. They can be received using the patterns list of ApplyPatternActions from the MindMapController. Each action has a getPattern() method and the pattern has a getName() method ...

applyPattern

public void applyPattern(MindMapNode node,
                         freemind.controller.actions.generated.instance.Pattern 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 ? see freemind.modes.MindIcon.factory(String)

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

setToolTip

public void setToolTip(MindMapNode node,
                       java.lang.String key,
                       java.lang.String value)
Specified by:
setToolTip in interface MindMapActions
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; see MindMapController

Specified by:
edit in interface MindMapActions

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

copy

public java.awt.datatransfer.Transferable copy(MindMapNode node,
                                               boolean saveInvisible)
Specified by:
copy in interface ModeController
Overrides:
copy in class ControllerAdapter

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
Parameters:
nodeList - a list of MindMapNode elements
Returns:
the result of the cut operation.

paste

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

paste

public boolean 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.
Returns:
true, if successfully.

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,
                              boolean 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
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)
Description copied from interface: ModeController
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).

Specified by:
setFolded in interface MindMapActions
Specified by:
setFolded in interface ModeController

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)
Description copied from interface: ModeController
Opens a link in * the opened map * another map * another file.

Specified by:
loadURL in interface ModeController
Overrides:
loadURL in class ControllerAdapter

addHook

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

moveNodePosition

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

Specified by:
moveNodePosition in interface MindMapActions

plainClick

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

getHookFactory

public HookFactory getHookFactory()
Specified by:
getHookFactory in interface ModeController

createNodeHook

public NodeHook createNodeHook(java.lang.String hookName,
                               MindMapNode node,
                               MindMap map)
Description copied from interface: MindMapActions
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 MindMapActions
map - may be null if not known. But it has to be set afterwards!

invokeHook

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

getActionFactory

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

saveHTML

public static void saveHTML(MindMapNodeModel rootNodeOfBranch,
                            java.io.File file)
                     throws java.io.IOException
Throws:
java.io.IOException

saveHTML

public static void saveHTML(java.util.List mindMapNodes,
                            java.io.Writer fileout)
                     throws java.io.IOException
Throws:
java.io.IOException

splitNode

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

updateNode

protected void updateNode(MindMapNode node)
Description copied from class: ControllerAdapter
Overwrite this method to perform additional operations to an node update.

Overrides:
updateNode in class ControllerAdapter

doubleClick

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

select

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

Specified by:
select in interface ModeController
Overrides:
select in class ControllerAdapter

selectMultipleNodes

public void selectMultipleNodes(NodeView focussed,
                                java.util.Collection selecteds)

selectMultipleNodes

public void selectMultipleNodes(MindMapNode focussed,
                                java.util.Collection selecteds)

selectBranch

public void selectBranch(NodeView selected,
                         boolean extend)

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.

registerMouseWheelEventHandler

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

deRegisterMouseWheelEventHandler

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

getRegisteredMouseWheelEventHandler

public java.util.Set getRegisteredMouseWheelEventHandler()
Overrides:
getRegisteredMouseWheelEventHandler in class ControllerAdapter

marshall

public java.lang.String marshall(freemind.controller.actions.generated.instance.XmlAction action)
Specified by:
marshall in interface MindMapActions

unMarshall

public freemind.controller.actions.generated.instance.XmlAction unMarshall(java.lang.String inputString)
Specified by:
unMarshall in interface MindMapActions

storeDialogPositions

public void storeDialogPositions(javax.swing.JDialog dialog,
                                 freemind.controller.actions.generated.instance.WindowConfigurationStorage pStorage,
                                 java.lang.String window_preference_storage_property)

decorateDialog

public freemind.controller.actions.generated.instance.WindowConfigurationStorage decorateDialog(javax.swing.JDialog dialog,
                                                                                                java.lang.String window_preference_storage_property)

getAttributeController

public AttributeController getAttributeController()
Specified by:
getAttributeController in interface ModeController
Overrides:
getAttributeController in class ControllerAdapter

getAttributeTablePopupMenu

public AttributePopupMenu getAttributeTablePopupMenu()

createXMLElement

public XMLElement createXMLElement()
Specified by:
createXMLElement in class ControllerAdapter

setAttribute

public void setAttribute(MindMapNode pNode,
                         int pPosition,
                         Attribute pAttribute)
Specified by:
setAttribute in interface MindMapActions

removeAttribute

public void removeAttribute(MindMapNode pNode,
                            int pPosition)
Description copied from interface: MindMapActions
Removes the attribute at the given position

Specified by:
removeAttribute in interface MindMapActions
pPosition - the position to delete.

addAttribute

public int addAttribute(MindMapNode node,
                        Attribute pAttribute)
Description copied from interface: MindMapActions
Inserts a new attribute at the end of the attributes table.

Specified by:
addAttribute in interface MindMapActions
Parameters:
node - to which the attribute is added
pAttribute - itself
Returns:
the index of the new attribute.

editAttribute

public int editAttribute(MindMapNode pNode,
                         java.lang.String pName,
                         java.lang.String pNewValue)
Description copied from interface: MindMapActions
If an attribute with the same name exists, its value is changed. If the new value is null, the attribute is deleted. Otherwise an attribute is created. If several attributes with the same name exist, only the first is changed.

Specified by:
editAttribute in interface MindMapActions
Parameters:
pNode - to which the attribute is associated
pName - the name of the attribute
pNewValue - its new value
Returns:
the index of the attribute, or -1 if an attribute should be deleted, but wasn't found.

insertNodeInto

public void insertNodeInto(MindMapNode newNode,
                           MindMapNode parent,
                           int index)
Overrides:
insertNodeInto in class ControllerAdapter

removeNodeFromParent

public void removeNodeFromParent(MindMapNode selectedNode)

nodeStyleChanged

public void nodeStyleChanged(MindMapNode node)

repaintMap

public void repaintMap()

clearNodeContents

public void clearNodeContents(MindMapNode pNode)
Description copied from interface: MindMapActions
Erases all content of the node as text, colors, fonts, etc.

Specified by:
clearNodeContents in interface MindMapActions

createEditNoteToNodeAction

public freemind.controller.actions.generated.instance.EditNoteToNodeAction createEditNoteToNodeAction(MindMapNode node,
                                                                                                      java.lang.String text)

setNoteText

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

registerPlugin

public void registerPlugin(MindMapController.MindMapControllerPlugin pPlugin)

deregisterPlugin

public void deregisterPlugin(MindMapController.MindMapControllerPlugin pPlugin)

getPlugins

public java.util.Set getPlugins()