Class MultilevelFrameworkLayout
java.lang.Object
org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
org.vanted.plugins.layout.multilevelframework.MultilevelFrameworkLayout
- All Implemented Interfaces:
Algorithm
public class MultilevelFrameworkLayout extends ThreadSafeAlgorithm
Main class of the MLF add-on that contains the method that actually performs
the layout.
- Author:
- Gordian
- See Also:
AbstractEditorAlgorithm
-
Field Summary
Fields Modifier and Type Field Description boolean
benchmarkMode
Set this to true to make execute() block until it is finished and use the specified mergers instead of the ones selected through the GUI.static List<Merger>
mergers
String
nonInteractiveAlgorithm
Merger
nonInteractiveMerger
Placer
nonInteractivePlacer
static List<Placer>
placers
-
Constructor Summary
Constructors Constructor Description MultilevelFrameworkLayout()
-
Method Summary
Modifier and Type Method Description static void
addMerger(Merger merger)
Add a newMerger
that will be available for the user to choose.static void
addPlacer(Placer placer)
Add a newPlacer
that will be available for the user to choose.void
attach(Graph g, Selection selection)
Attaches the given graph to this algorithm.void
check()
Checks, if a graph was given and that the radius is positive.void
execute()
Performs the layout.void
executeThreadSafe(ThreadSafeOptions options)
ActionEvent
getActionEvent()
String
getCategory()
Returns the category an algorithm should assigned to.String
getDescription()
String
getMenuCategory()
Returns a path to a menu category.static Collection<Merger>
getMergers()
String
getName()
Returns the name (ID) of the algorithm.Parameter[]
getParameters()
Returns a list ofParameter
that are set for this algorithm.static Collection<Placer>
getPlacers()
Set<Category>
getSetCategory()
Returns a set of categories to classify this algorithm .boolean
isLayoutAlgorithm()
This makes sure the algorithm is moved to the layout-tab of VANTEDvoid
reset()
Callssuper.reset()
and updates the parameters.void
resetDataCache(ThreadSafeOptions options)
void
setActionEvent(ActionEvent a)
boolean
setControlInterface(ThreadSafeOptions __, JComponent jc)
DOCUMENT ME!void
setParameters(Parameter[] params)
Sets the parameters for this algorithm.Methods inherited from class org.graffiti.plugin.algorithm.ThreadSafeAlgorithm
getAcceleratorKeyStroke, mayWorkOnMultipleGraphs, showMenuIcon
-
Field Details
-
mergers
-
placers
-
benchmarkMode
public boolean benchmarkModeSet this to true to make execute() block until it is finished and use the specified mergers instead of the ones selected through the GUI. -
nonInteractiveMerger
-
nonInteractivePlacer
-
nonInteractiveAlgorithm
-
-
Constructor Details
-
MultilevelFrameworkLayout
public MultilevelFrameworkLayout()
-
-
Method Details
-
getDescription
- See Also:
Algorithm.getDescription()
-
getActionEvent
-
setActionEvent
-
reset
public void reset()Callssuper.reset()
and updates the parameters. -
getName
Description copied from interface:Algorithm
Returns the name (ID) of the algorithm.- Returns:
- the algorithm's name
-
check
Checks, if a graph was given and that the radius is positive.- Throws:
PreconditionException
- if no graph was given during algorithm invocation or the number of nodes is zero or negative
-
getParameters
Description copied from interface:Algorithm
Returns a list ofParameter
that are set for this algorithm.- Returns:
- a collection of
Parameter
that are needed by theAlgorithm
.
-
setParameters
Description copied from interface:Algorithm
Sets the parameters for this algorithm. Must have the same types and order as the array returned bygetParameter
. -
execute
public void execute()Performs the layout. Can be executed on multiple graphs at the same time (by calling attach, execute, attach, execute...), but only if theAlgorithm
used for the levels supports thread safe execution (i.e. multiple execute methods running at the same time using the same instance). This is only possible if the algorithm's execute method copies the parameter values or theThreadSafeOptions
object in case of aThreadSafeAlgorithm
. Unless you can guarantee that the algorithm you're using does this, it is not recommended to run this on multiple graphs at the same time. -
attach
Description copied from interface:Algorithm
Attaches the given graph to this algorithm. A ttaches the given Selection information to the algorithm.- Parameters:
g
- the graph to attach.selection
- the selection to attach.
-
getCategory
Description copied from interface:Algorithm
Returns 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:Algorithm
Returns 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:Algorithm
Returns 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()This makes sure the algorithm is moved to the layout-tab of VANTED- Returns:
true
-
addMerger
Add a newMerger
that will be available for the user to choose. This method is meant to be called by other VANTED add-ons that seek to extend the MLF with newMerger
s.- Parameters:
merger
- TheMerger
to add. Must not benull
.
-
getMergers
- Returns:
- the currently registered
Merger
s as an unmodifiableCollection
.
-
addPlacer
Add a newPlacer
that will be available for the user to choose. This method is meant to be called by other VANTED add-ons that seek to extend the MLF with newPlacer
s.- Parameters:
placer
- ThePlacer
to add. Must not benull
.
-
getPlacers
- Returns:
- the currently registered
Placer
s as an unmodifiableCollection
.
-
setControlInterface
Description copied from class:ThreadSafeAlgorithm
DOCUMENT ME!- Specified by:
setControlInterface
in classThreadSafeAlgorithm
- Returns:
- true, if an GUI was set, false if no interface is needed
-
executeThreadSafe
- Specified by:
executeThreadSafe
in classThreadSafeAlgorithm
-
resetDataCache
- Specified by:
resetDataCache
in classThreadSafeAlgorithm
-