freemind.modes

Class LinkRegistryAdapter

Implemented Interfaces:
MindMapLinkRegistry

public class LinkRegistryAdapter
extends java.lang.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

class
LinkRegistryAdapter.ID_BasicStateAdapter
State parent interface.
class
LinkRegistryAdapter.ID_BlankAdapter
This state interface expresses the state that a node is blank (i.e.
protected class
LinkRegistryAdapter.ID_RegisteredAdapter
This state interface expresses the state that a node has an ID.
protected abstract class
LinkRegistryAdapter.ID_UsedStateAdapter
This state interface expresses the state that a node has an ID, but is abstract.

Field Summary

protected HashMap
IDToCuttedLinks
protected HashMap
IDToLinks
protected HashMap
TargetToID

Constructor Summary

LinkRegistryAdapter()

Method Summary

void
clearCuttedNodeBuffer()
Clears the set of recent cutted nodes.
void
cutNode(MindMapNode target)
void
deregisterLink(MindMapLink link)
void
deregisterLinkTarget(MindMapNode target)
Exception if there are still targets registered.
protected String
generateUniqueID(String proposedID)
Vector
getAllLinks(MindMapNode node)
Vector
getAllLinksFromMe(MindMapNode source)
Vector
getAllLinksIntoMe(MindMapNode target)
Vector
getAllSources(MindMapNode target)
Returns a Vector of Nodes that point to the given target node.
Vector
getCuttedNode(String oldTargetID)
protected String
getIDString(MindMapNode node)
String
getLabel(MindMapNode target)
ID_BasicState
getState(MindMapNode node)
MindMapNode
getTargetForID(String ID)
void
registerLink(MindMapLink link)
Method to keep track of the sources associated to a target node.
ID_Registered
registerLinkTarget(MindMapNode target)
The main method.
ID_Registered
registerLinkTarget(MindMapNode target, String proposedID)

Field Details

IDToCuttedLinks

protected HashMap IDToCuttedLinks

IDToLinks

protected HashMap IDToLinks

TargetToID

protected HashMap TargetToID

Constructor Details

LinkRegistryAdapter

public LinkRegistryAdapter()

Method Details

clearCuttedNodeBuffer

public void clearCuttedNodeBuffer()
Clears the set of recent cutted nodes.
Specified by:
clearCuttedNodeBuffer in interface MindMapLinkRegistry

cutNode

public void cutNode(MindMapNode target)
Specified by:
cutNode in interface MindMapLinkRegistry

deregisterLink

public void deregisterLink(MindMapLink link)
Specified by:
deregisterLink in interface MindMapLinkRegistry

deregisterLinkTarget

public void deregisterLinkTarget(MindMapNode target)
            throws java.lang.IllegalArgumentException
Exception if there are still targets registered.
Specified by:
deregisterLinkTarget in interface MindMapLinkRegistry

generateUniqueID

protected String generateUniqueID(String proposedID)

getAllLinks

public Vector getAllLinks(MindMapNode node)
Specified by:
getAllLinks in interface MindMapLinkRegistry

getAllLinksFromMe

public Vector getAllLinksFromMe(MindMapNode source)
Specified by:
getAllLinksFromMe in interface MindMapLinkRegistry
Returns:
returns all links from this node.

getAllLinksIntoMe

public Vector getAllLinksIntoMe(MindMapNode target)
Specified by:
getAllLinksIntoMe in interface MindMapLinkRegistry
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.
Specified by:
getAllSources in interface MindMapLinkRegistry

getCuttedNode

public Vector getCuttedNode(String oldTargetID)
Specified by:
getCuttedNode in interface MindMapLinkRegistry
Returns:
returns all links that have been cutted out recently.

getIDString

protected String getIDString(MindMapNode node)

getLabel

public String getLabel(MindMapNode target)
Specified by:
getLabel in interface MindMapLinkRegistry

getState

public ID_BasicState getState(MindMapNode node)
Specified by:
getState in interface MindMapLinkRegistry

getTargetForID

public MindMapNode getTargetForID(String ID)
Specified by:
getTargetForID in interface MindMapLinkRegistry

registerLink

public void registerLink(MindMapLink link)
            throws java.lang.IllegalArgumentException
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.
Specified by:
registerLink in interface MindMapLinkRegistry

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.
Specified by:
registerLinkTarget in interface MindMapLinkRegistry

registerLinkTarget

public ID_Registered registerLinkTarget(MindMapNode target,
                                        String proposedID)
Specified by:
registerLinkTarget in interface MindMapLinkRegistry