|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ca.quine.jcommons.freemind.maputil.MapUtils
Field Summary | |
static int |
TRAVERSAL_BFS
Use a breadth first search traversal. |
static int |
TRAVERSAL_DFS_POSTORDER
Use a depth first search traversal, where we visit each node after its children. |
static int |
TRAVERSAL_DFS_PRE_AND_POSTORDER
Use a depth first search traversal, where each node is applied before and after its children. |
static int |
TRAVERSAL_DFS_PREORDER
Use a depth first search traversal, where we visit each node before its children. |
Method Summary | |
static void |
addChild(Node parent,
Node child)
Adds the given child Node to the parent Node, creating a NodeItem wrapper for it. |
static void |
addLink(Node node,
String id)
Creates a graphical link from the given Node to the Node with the given ID. |
static void |
apply(Map map,
int traversal,
INodeApplicator applicator)
Applies the given applicator to the given Map
in the given traversal order. |
static void |
apply(Node parentNode,
Node node,
int traversal,
INodeApplicator applicator)
Applies the given applicator to the given Node
in the given traversal order. |
static void |
closeLargeNodes(Map map,
int maxNodeChildren)
Close nodes that have more children than the given maximum. |
static int |
countAndCloseLargeNodes(Node node,
int maxNodeChildren)
Perform a DFS (depth-first search) finding all nodes that have more than the given number of children, and close (fold) them. |
static Node |
getChild(Node parent,
int childNum)
Returns the child Node of the given Node
at the given index (the first Node is index 1), or null
if no such child exists. |
static Node |
getLeftNode(Map node)
Returns the first child Node to the left of the root
node in the given Map . |
static Node |
getLeftNode(Map map,
int childNum)
Returns the child Node to the left of the root node
in the given Map at the given index (the first
Node is index 1), or null if no such child exists. |
static Node |
getRightNode(Map map)
Returns the first child Node to the right of the root
node in the given Map . |
static Node |
getRightNode(Map map,
int childNum)
Returns the child Node to the right of the root node
in the given Map at the given index (the first
Node is index 1), or null if no such child exists. |
static Node |
makeNode(String text)
Creates a new Node object with the given text. |
static Node |
makeNode(String text,
NodeItemPOSITIONType position)
Creates a new Node with the given text and position. |
static ArrayList |
search(Map map,
int searchType,
String searchText)
Searches for the given searchText with the given
searchType in the given Map and returns all
the Node s that match. |
static void |
sortMap(Map map)
Sorts the given FreeMind map based on the default NodeItemComparator. |
static void |
sortMap(Map map,
NodeItemComparator nodeItemComparator)
Sorts the given FreeMind map using the given NodeItemComparator. |
static void |
sortNode(Node node)
Sorts the children of the given Node based on the default NodeItemComparator. |
static void |
sortNode(Node node,
NodeItemComparator nodeItemComparator)
Sorts the children of the given Node based on the default NodeItemComparator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TRAVERSAL_DFS_PREORDER
apply(Map, int, INodeApplicator)
,
apply(Node, Node, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_DFS_POSTORDER
apply(Map, int, INodeApplicator)
,
apply(Node, Node, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_BFS
apply(Map, int, INodeApplicator)
,
apply(Node, Node, int, INodeApplicator)
,
Constant Field Valuespublic static final int TRAVERSAL_DFS_PRE_AND_POSTORDER
apply(Map, int, INodeApplicator)
,
apply(Node, Node, int, INodeApplicator)
,
Constant Field ValuesMethod Detail |
public static void sortMap(Map map)
map
- public static void sortMap(Map map, NodeItemComparator nodeItemComparator)
map
- nodeItemComparator
- public static void sortNode(Node node)
node
- public static void sortNode(Node node, NodeItemComparator nodeItemComparator)
node
- public static Node makeNode(String text)
Node
object with the given text.
text
-
Node
public static Node makeNode(String text, NodeItemPOSITIONType position)
text
- position
- determines the side on which a Node directly off the
root Node is displayed. The position is ignored for
all other Nodes.
Node
public static void addChild(Node parent, Node child)
parent
- child
- public static void addLink(Node node, String id)
node
- id
- public static void closeLargeNodes(Map map, int maxNodeChildren)
map
- maxNodeChildren
- public static int countAndCloseLargeNodes(Node node, int maxNodeChildren)
node
- maxNodeChildren
-
public static Node getRightNode(Map map)
Node
to the right of the root
node in the given Map
. NodeItem types that are not nodes
(such as "ArrowLink", "Cloud", "Edge", "Font", etc.) are ignored.
map
-
Node
to the right of the root
Node
in the given Map
.public static Node getRightNode(Map map, int childNum)
Node
to the right of the root node
in the given Map
at the given index (the first
Node
is index 1), or null if no such child exists.
NodeItem types that are not nodes
(such as "ArrowLink", "Cloud", "Edge", "Font", etc.) are ignored.
map
- childNum
-
Node
to the right of the root
node in the given Map
at the given index
(the first Node
is index 1), or null if no
such child exists.public static Node getLeftNode(Map node)
Node
to the left of the root
node in the given Map
. NodeItem types that are not nodes
(such as "ArrowLink", "Cloud", "Edge", "Font", etc.) are ignored.
node
-
Node
to the left of the root
Node
in the given Map
.public static Node getLeftNode(Map map, int childNum)
Node
to the left of the root node
in the given Map
at the given index (the first
Node
is index 1), or null if no such child exists.
map
- childNum
-
Node
to the left of the root
node in the given Map
at the given index
(the first Node
is index 1), or null if no
such child exists.public static Node getChild(Node parent, int childNum)
Node
of the given Node
at the given index (the first Node
is index 1), or null
if no such child exists.
parent
- childNum
-
Node
of the given
Node
at the given index
(the first Node
is index 1), or null if no
such child exists.public static ArrayList search(Map map, int searchType, String searchText)
searchText
with the given
searchType
in the given Map
and returns all
the Node
s that match.
map
- the Map
in which to searchsearchType
- one of SearchNodeApplicator.SEARCH_CONTAINS
,
SearchNodeApplicator.SEARCH_EXACT_MATCH
or
SearchNodeApplicator.SEARCH_REGEXP
searchText
- the text (or regex) to search for
ArrayList
of Node
spublic static void apply(Map map, int traversal, INodeApplicator applicator)
applicator
to the given Map
in the given traversal order.
map
- traversal
- one of TRAVERSAL_DFS_PREORDER
or
TRAVERSAL_DFS_POSTORDER
applicator
- public static void apply(Node parentNode, Node node, int traversal, INodeApplicator applicator)
applicator
to the given Node
in the given traversal order.
parentNode
- the parent Node
of node
(or null
if node
is the
root node)node
- traversal
- one of TRAVERSAL_DFS_PREORDER
or
TRAVERSAL_DFS_POSTORDER
applicator
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |