freemind.modes

Class LinkRegistryAdapter

public class LinkRegistryAdapter extends Object implements MindMapLinkRegistry

Interface for the registry, which manages the ids of nodes and the existing links in a map. Thus, this interface is bound to a map model, because other maps have a different registry.
Nested Class Summary
classLinkRegistryAdapter.ID_BasicStateAdapter
State parent interface.
classLinkRegistryAdapter.ID_BlankAdapter
This state interface expresses the state that a node is blank (i.e. without an id, normal state).
protected classLinkRegistryAdapter.ID_RegisteredAdapter
This state interface expresses the state that a node has an ID.
protected abstract classLinkRegistryAdapter.ID_UsedStateAdapter
This state interface expresses the state that a node has an ID, but is abstract.
Field Summary
protected HashMapIDToCuttedLinks
protected HashMapIDToLinks
protected HashMapTargetToID
Constructor Summary
LinkRegistryAdapter()
Method Summary
voidclearCuttedNodeBuffer()
Clears the set of recent cutted nodes.
voidcutNode(MindMapNode target)
voidderegisterLink(MindMapLink link)
voidderegisterLinkTarget(MindMapNode target)
Exception if there are still targets registered.
protected StringgenerateUniqueID(String proposedID)
VectorgetAllLinks(MindMapNode node)
VectorgetAllLinksFromMe(MindMapNode source)
VectorgetAllLinksIntoMe(MindMapNode target)
VectorgetAllSources(MindMapNode target)
Returns a Vector of Nodes that point to the given target node.
VectorgetCuttedNode(String oldTargetID)
protected StringgetIDString(MindMapNode node)
StringgetLabel(MindMapNode target)
ID_BasicStategetState(MindMapNode node)
MindMapNodegetTargetForID(String ID)
voidregisterLink(MindMapLink link)
Method to keep track of the sources associated to a target node.
ID_RegisteredregisterLinkTarget(MindMapNode target)
The main method.
ID_RegisteredregisterLinkTarget(MindMapNode target, String proposedID)

Field Detail

IDToCuttedLinks

protected HashMap IDToCuttedLinks

IDToLinks

protected HashMap IDToLinks

TargetToID

protected HashMap TargetToID

Constructor Detail

LinkRegistryAdapter

public LinkRegistryAdapter()

Method Detail

clearCuttedNodeBuffer

public void clearCuttedNodeBuffer()
Clears the set of recent cutted nodes.

cutNode

public void cutNode(MindMapNode target)

deregisterLink

public void deregisterLink(MindMapLink link)

deregisterLinkTarget

public void deregisterLinkTarget(MindMapNode target)
Exception if there are still targets registered.

generateUniqueID

protected String generateUniqueID(String proposedID)

getAllLinks

public Vector getAllLinks(MindMapNode node)

getAllLinksFromMe

public Vector getAllLinksFromMe(MindMapNode source)

Returns: returns all links from this node.

getAllLinksIntoMe

public Vector getAllLinksIntoMe(MindMapNode target)

Returns: returns all links to this node.

getAllSources

public Vector getAllSources(MindMapNode target)
Returns a Vector of Nodes that point to the given target node.

getCuttedNode

public Vector getCuttedNode(String oldTargetID)

Returns: returns all links that have been cutted out recently.

getIDString

protected String getIDString(MindMapNode node)

getLabel

public String getLabel(MindMapNode target)

getState

public ID_BasicState getState(MindMapNode node)

getTargetForID

public MindMapNode getTargetForID(String ID)

registerLink

public void registerLink(MindMapLink link)
Method to keep track of the sources associated to a target node. This method also sets the new id to the target. Moreover, it is not required that the target node is already registered. This will be done on the fly.

registerLinkTarget

public ID_Registered registerLinkTarget(MindMapNode target)
The main method. Registeres a node with a new (or an existing) node-id. If the state of the id is pending, then it is set to registered again.

registerLinkTarget

public ID_Registered registerLinkTarget(MindMapNode target, String proposedID)