freemind.modes.actions
Interface MindMapActions

All Known Subinterfaces:
ModeController
All Known Implementing Classes:
ControllerAdapter

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 ModeController for use.

Author:
foltin
See Also:
ModeController

Method Summary
 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 applyPattern(MindMapNode node, java.lang.String patternName)
           
 void applyPattern(MindMapNode node, StylePattern pattern)
           
 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)
           
 java.awt.datatransfer.Transferable cut()
           
 java.awt.datatransfer.Transferable cut(java.util.List nodeList)
           
 void deleteNode(MindMapNode selectedNode)
           
 void displayNode(MindMapNode node)
          Unfolds a node if necessary.
 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;
 java.lang.String getLinkShortText(MindMapNode node)
           
 MindMapNode getRootNode()
           
 void increaseFontSize(MindMapNode node, int increment)
           
 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 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)
           
 void paste(java.awt.datatransfer.Transferable t, MindMapNode target, boolean asSibling, boolean isLeft)
           
 void removeAllIcons(MindMapNode node)
           
 int removeLastIcon(MindMapNode node)
           
 void removeReference(MindMapLink arrowLink)
           
 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.
 void setArrowLinkColor(MindMapLink arrowLink, java.awt.Color color)
           
 void setArrowLinkEndPoints(MindMapArrowLink link, java.awt.Point startPoint, java.awt.Point endPoint)
           
 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.
 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 splitNode(MindMapNode node, int caretPosition, java.lang.String newText)
           
 void toggleFolded()
          Switches the folding state of all selected nodes.
 

Method Detail

nodeChanged

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

Parameters:
node -

nodeRefresh

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

Parameters:
node -

nodeStructureChanged

public void nodeStructureChanged(MindMapNode node)

edit

public 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 Also:
ControllerAdapter

setNodeText

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

addNew

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

addNewNode

public MindMapNode addNewNode(MindMapNode parent,
                              int index,
                              Tools.BooleanHolder 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

public void deleteNode(MindMapNode selectedNode)

cut

public java.awt.datatransfer.Transferable cut()

cut

public java.awt.datatransfer.Transferable cut(java.util.List nodeList)

moveNodes

public 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

public void setFolded(MindMapNode node,
                      boolean folded)
Parameters:
node -
folded -

toggleFolded

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


displayNode

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

Parameters:
node -

centerNode

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

Parameters:
node -

getLinkShortText

public java.lang.String getLinkShortText(MindMapNode node)

setBold

public void setBold(MindMapNode node,
                    boolean bolded)

setItalic

public void setItalic(MindMapNode node,
                      boolean isItalic)

setNodeColor

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

setNodeBackgroundColor

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

blendNodeColor

public void blendNodeColor(MindMapNode node)

setFontFamily

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

setFontSize

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

addIcon

public void addIcon(MindMapNode node,
                    MindIcon icon)
This method is nice, but how to get a MindIcon ?


removeLastIcon

public int removeLastIcon(MindMapNode node)

removeAllIcons

public void removeAllIcons(MindMapNode node)

applyPattern

public 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 ControllerAdapter. Each action has a getPattern() method and the pattern has a getName() method ...

applyPattern

public void applyPattern(MindMapNode node,
                         StylePattern pattern)

setNodeStyle

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

setEdgeColor

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

setEdgeWidth

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


setEdgeStyle

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

setCloud

public void setCloud(MindMapNode node,
                     boolean enable)

setCloudColor

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

addLink

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


removeReference

public void removeReference(MindMapLink arrowLink)

changeArrowsOfArrowLink

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

setArrowLinkColor

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

setArrowLinkEndPoints

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

setLink

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

Parameters:
node -
link -

increaseFontSize

public void increaseFontSize(MindMapNode node,
                             int increment)

splitNode

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

joinNodes

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

paste

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

paste

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

paste

public void paste(MindMapNode node,
                  MindMapNode parent)

addHook

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

getRootNode

public MindMapNode getRootNode()

setToolTip

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

select

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

Parameters:
node -

select

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

Parameters:
selected -

selectMultipleNodes

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

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


moveNodePosition

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

Parameters:
node -
vGap -
hGap -
shiftY -

load

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

Parameters:
xmlMapContents -