freemind.modes.mindmapmode.actions
Interface MindMapActions

All Known Implementing Classes:
MindMapController

public interface MindMapActions

This is the central method interface of actions that can be undertaken on nodes. Whenever you want to change the mindmap choose one of these actions as they do proper redisplay, inform others about the actions, the actions are all undoable etc.etc. All these methods do redisplay, because they are offered from the MindMapController for use.

Author:
foltin see MindMapController

Nested Class Summary
static interface MindMapActions.MouseWheelEventHandler
           
 
Field Summary
static int NEW_CHILD
           
static int NEW_CHILD_WITHOUT_FOCUS
           
static int NEW_SIBLING_BEFORE
           
static int NEW_SIBLING_BEHIND
           
 
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 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.
 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(MindMapActions.MouseWheelEventHandler handler)
           
 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.
 ActionFactory getActionFactory()
           
 java.awt.datatransfer.Clipboard getClipboard()
           
 MindMapNode getRootNode()
           
 void increaseFontSize(MindMapNode node, int increment)
           
 void invokeHook(ModeControllerHook hook)
           
 void invokeHooksRecursively(NodeAdapter node, MindMap map)
           
 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.
 java.lang.String marshall(freemind.controller.actions.generated.instance.XmlAction action)
           
 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).
 void nodeChanged(MindMapNode node)
          Call this method, if you changed anything at a node.
 void nodeRefresh(MindMapNode node)
          This is nodeChanged without making the map dirty.
 void nodeStructureChanged(MindMapNode node)
           
 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 registerMouseWheelEventHandler(MindMapActions.MouseWheelEventHandler handler)
           
 void removeAllIcons(MindMapNode node)
           
 void removeAttribute(MindMapNode node, int pPosition)
          Removes the attribute at the given position
 int removeLastIcon(MindMapNode node)
           
 void removeReference(MindMapLink arrowLink)
           
 void setArrowLinkColor(MindMapLink arrowLink, java.awt.Color color)
           
 void setArrowLinkEndPoints(MindMapArrowLink link, java.awt.Point startPoint, java.awt.Point endPoint)
           
 void setAttribute(MindMapNode node, 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)
           
 void setFontFamily(MindMapNode node, java.lang.String fontFamily)
           
 void setFontSize(MindMapNode node, java.lang.String fontSizeValue)
           
 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)
 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 selected, java.lang.String newText)
           
 void setToolTip(MindMapNode node, java.lang.String key, java.lang.String value)
           
 void splitNode(MindMapNode node, int caretPosition, java.lang.String newText)
           
 void toggleFolded()
          Switches the folding state of all selected nodes.
 freemind.controller.actions.generated.instance.XmlAction unMarshall(java.lang.String inputString)
           
 

Field Detail

NEW_CHILD_WITHOUT_FOCUS

static final int NEW_CHILD_WITHOUT_FOCUS
See Also:
Constant Field Values

NEW_CHILD

static final int NEW_CHILD
See Also:
Constant Field Values

NEW_SIBLING_BEHIND

static final int NEW_SIBLING_BEHIND
See Also:
Constant Field Values

NEW_SIBLING_BEFORE

static final int NEW_SIBLING_BEFORE
See Also:
Constant Field Values
Method Detail

nodeChanged

void nodeChanged(MindMapNode node)
Call this method, if you changed anything at a node. This method makes the map dirty.


nodeRefresh

void nodeRefresh(MindMapNode node)
This is nodeChanged without making the map dirty.


nodeStructureChanged

void nodeStructureChanged(MindMapNode node)

edit

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


setNodeText

void setNodeText(MindMapNode selected,
                 java.lang.String newText)

setNoteText

void setNoteText(MindMapNode selected,
                 java.lang.String newText)

addNew

MindMapNode addNew(MindMapNode target,
                   int newNodeMode,
                   java.awt.event.KeyEvent e)

addNewNode

MindMapNode addNewNode(MindMapNode parent,
                       int index,
                       boolean newNodeIsLeft)
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.

Parameters:
newNodeIsLeft - here, normally parent.isLeft() or null is used.
Returns:
returns the new node.

deleteNode

void deleteNode(MindMapNode selectedNode)

cut

java.awt.datatransfer.Transferable cut()

cut

java.awt.datatransfer.Transferable cut(java.util.List nodeList)
Parameters:
nodeList - a list of MindMapNode elements
Returns:
the result of the cut operation.

moveNodes

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


setFolded

void setFolded(MindMapNode node,
               boolean folded)

toggleFolded

void toggleFolded()
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.


setBold

void setBold(MindMapNode node,
             boolean bolded)

setItalic

void setItalic(MindMapNode node,
               boolean isItalic)

setNodeColor

void setNodeColor(MindMapNode node,
                  java.awt.Color color)

setNodeBackgroundColor

void setNodeBackgroundColor(MindMapNode node,
                            java.awt.Color color)

blendNodeColor

void blendNodeColor(MindMapNode node)

setFontFamily

void setFontFamily(MindMapNode node,
                   java.lang.String fontFamily)

setFontSize

void setFontSize(MindMapNode node,
                 java.lang.String fontSizeValue)

addIcon

void addIcon(MindMapNode node,
             MindIcon icon)
This method is nice, but how to get a MindIcon ? see freemind.modes.MindIcon.factory(String)


removeLastIcon

int removeLastIcon(MindMapNode node)

removeAllIcons

void removeAllIcons(MindMapNode node)

applyPattern

void applyPattern(MindMapNode node,
                  java.lang.String patternName)
Parameters:
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

void applyPattern(MindMapNode node,
                  freemind.controller.actions.generated.instance.Pattern pattern)

setNodeStyle

void setNodeStyle(MindMapNode node,
                  java.lang.String style)

setEdgeColor

void setEdgeColor(MindMapNode node,
                  java.awt.Color color)

setEdgeWidth

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


setEdgeStyle

void setEdgeStyle(MindMapNode node,
                  java.lang.String style)

setCloud

void setCloud(MindMapNode node,
              boolean enable)

setCloudColor

void setCloudColor(MindMapNode node,
                   java.awt.Color color)

addLink

void addLink(MindMapNode source,
             MindMapNode target)
Source holds the MindMapArrowLinkModel and points to the id placed in target.


removeReference

void removeReference(MindMapLink arrowLink)

changeArrowsOfArrowLink

void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink,
                             boolean hasStartArrow,
                             boolean hasEndArrow)

setArrowLinkColor

void setArrowLinkColor(MindMapLink arrowLink,
                       java.awt.Color color)

setArrowLinkEndPoints

void setArrowLinkEndPoints(MindMapArrowLink link,
                           java.awt.Point startPoint,
                           java.awt.Point endPoint)

setLink

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


increaseFontSize

void increaseFontSize(MindMapNode node,
                      int increment)

splitNode

void splitNode(MindMapNode node,
               int caretPosition,
               java.lang.String newText)

joinNodes

void joinNodes(MindMapNode selectedNode,
               java.util.List selectedNodes)

paste

void paste(java.awt.datatransfer.Transferable t,
           MindMapNode parent)

paste

boolean paste(java.awt.datatransfer.Transferable t,
              MindMapNode target,
              boolean asSibling,
              boolean isLeft)
Parameters:
isLeft - determines, whether or not the node is placed on the left or right.
Returns:
true, if successfully.

paste

void paste(MindMapNode node,
           MindMapNode parent)

addHook

void addHook(MindMapNode focussed,
             java.util.List selecteds,
             java.lang.String hookName)

createNodeHook

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

void invokeHook(ModeControllerHook hook)

invokeHooksRecursively

void invokeHooksRecursively(NodeAdapter node,
                            MindMap map)

getActionFactory

ActionFactory getActionFactory()

marshall

java.lang.String marshall(freemind.controller.actions.generated.instance.XmlAction action)

unMarshall

freemind.controller.actions.generated.instance.XmlAction unMarshall(java.lang.String inputString)

isUndoAction

boolean isUndoAction()
undo in progress?


getClipboard

java.awt.datatransfer.Clipboard getClipboard()

getRootNode

MindMapNode getRootNode()

setToolTip

void setToolTip(MindMapNode node,
                java.lang.String key,
                java.lang.String value)
Parameters:
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.

moveNodePosition

void moveNodePosition(MindMapNode node,
                      int vGap,
                      int hGap,
                      int shiftY)
Moves the node to a new position.


load

void load(java.lang.String xmlMapContents)
Load the given map (as String) instead of the currently opened map.


registerMouseWheelEventHandler

void registerMouseWheelEventHandler(MindMapActions.MouseWheelEventHandler handler)

deRegisterMouseWheelEventHandler

void deRegisterMouseWheelEventHandler(MindMapActions.MouseWheelEventHandler handler)

setAttribute

void setAttribute(MindMapNode node,
                  int pPosition,
                  Attribute pAttribute)

addAttribute

int addAttribute(MindMapNode node,
                 Attribute pAttribute)
Inserts a new attribute at the end of the attributes table.

Parameters:
node - to which the attribute is added
pAttribute - itself
Returns:
the index of the new attribute.

removeAttribute

void removeAttribute(MindMapNode node,
                     int pPosition)
Removes the attribute at the given position

Parameters:
pPosition - the position to delete.

editAttribute

int editAttribute(MindMapNode pNode,
                  java.lang.String pName,
                  java.lang.String pNewValue)
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.

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.

clearNodeContents

void clearNodeContents(MindMapNode pNode)
Erases all content of the node as text, colors, fonts, etc.