Class PatternSpringembedder
java.lang.Object
org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
de.ipk_gatersleben.ag_nw.graffiti.plugins.layouters.pattern_springembedder.PatternSpringembedder
- All Implemented Interfaces:
Algorithm
public class PatternSpringembedder extends ThreadSafeAlgorithm
Spring Embedder Algorithm. Example #3.
- Author:
- Christian Klukas
- Recent revisions:
- 2.6.5
-
Field Summary
Fields Modifier and Type Field Description static StringspringName -
Constructor Summary
Constructors Constructor Description PatternSpringembedder() -
Method Summary
Modifier and Type Method Description voidattach(Graph g, Selection s)Attaches the given graph to this algorithm.voidcheck()Error Checkingvoidexecute()Layout AlgorithmvoidexecuteThreadSafe(ThreadSafeOptions options)ActionEventgetActionEvent()StringgetCategory()Returns the category an algorithm should assigned to.StringgetDescription()StringgetMenuCategory()Returns a path to a menu category.StringgetName()Sets Menu Command TitleParameter[]getParameters()Returns a list ofParameterthat are set for this algorithm.Parameter[]getParameters(double edgeLength, double nodeForce)static ArrayList<NodeCacheEntry>getPatternNodesPublic(ArrayList<NodeCacheEntry> nodeArray, NodeCacheEntry nodeInfo)Set<Category>getSetCategory()Returns a set of categories to classify this algorithm .booleanisLayoutAlgorithm()A LayoutAlgorithm should return true.voidreadPatternConnections(ThreadSafeOptions options)Init cache entry for a node (get pattern nodes-call cache)voidreset()Resets the internal state of the algorithm.voidresetDataCache(ThreadSafeOptions options)Initialized the node cache structures.voidsetActionEvent(ActionEvent a)booleansetControlInterface(ThreadSafeOptions options, JComponent jc)DOCUMENT ME!voidsetParameters(Parameter[] params)Sets the parameters for this algorithm.StringtoString()Methods inherited from class org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
getAcceleratorKeyStroke, mayWorkOnMultipleGraphs, showMenuIcon
-
Field Details
-
springName
- See Also:
- Constant Field Values
-
-
Constructor Details
-
PatternSpringembedder
public PatternSpringembedder()
-
-
Method Details
-
getName
Sets Menu Command Title- Returns:
- Menu command title
-
toString
-
getActionEvent
-
setActionEvent
-
getPatternNodesPublic
public static ArrayList<NodeCacheEntry> getPatternNodesPublic(ArrayList<NodeCacheEntry> nodeArray, NodeCacheEntry nodeInfo) -
check
Error Checking- Throws:
PreconditionExceptionPreconditionException- DOCUMENT ME!
-
execute
public void execute()Layout Algorithm -
readPatternConnections
Init cache entry for a node (get pattern nodes-call cache)- Parameters:
options- DOCUMENT ME!
-
setParameters
Description copied from interface:AlgorithmSets the parameters for this algorithm. Must have the same types and order as the array returned bygetParameter. -
getParameters
Description copied from interface:AlgorithmReturns a list ofParameterthat are set for this algorithm.- Returns:
- a collection of
Parameterthat are needed by theAlgorithm.
-
getParameters
-
setControlInterface
Description copied from class:ThreadSafeAlgorithmDOCUMENT ME!- Specified by:
setControlInterfacein classThreadSafeAlgorithm- Returns:
- true, if an GUI was set, false if no interface is needed
-
resetDataCache
Initialized the node cache structures.- Specified by:
resetDataCachein classThreadSafeAlgorithm- Parameters:
options- The options to use
-
executeThreadSafe
- Specified by:
executeThreadSafein classThreadSafeAlgorithm
-
attach
Description copied from interface:AlgorithmAttaches the given graph to this algorithm. A ttaches the given Selection information to the algorithm.- Parameters:
g- the graph to attach.s- the selection to attach.
-
reset
public void reset()Description copied from interface:AlgorithmResets the internal state of the algorithm. -
getCategory
Description copied from interface:AlgorithmReturns the category an algorithm should assigned to. Return NULL if the algorithm should be sorted directly in the plugin menu.- Returns:
- The category an algorithm should assigned to.
-
getSetCategory
Description copied from interface:AlgorithmReturns a set of categories to classify this algorithm . e.g. return new HashSet(Arrays.asList( Category.GRAPH, Category.NODE )); is an algorithm, working on graphs and more specific on nodes - Returns:
- Set of Category Enums that classify this algorithm.
-
getMenuCategory
Description copied from interface:AlgorithmReturns a path to a menu category. This is s '.' separated string which reflects the position of this Algorithm in the Menu Hierarchy e.g. "Network.Layout" would put this algorithm in the menu 'Network' and its submenu 'Layout' If this menu is not existent it will be created If this method returns 'null' the algorithm will not appear in the menu- Returns:
-
isLayoutAlgorithm
public boolean isLayoutAlgorithm()Description copied from interface:AlgorithmA LayoutAlgorithm should return true. All other types of algorithms should return false.- Returns:
-
getDescription
-