Class StressMinimizationLayout
java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
org.graffiti.plugin.algorithm.AbstractEditorAlgorithm
org.vanted.plugins.layout.stressminimization.BackgroundAlgorithm
org.vanted.plugins.layout.stressminimization.StressMinimizationLayout
- All Implemented Interfaces:
UndoableEdit
,Algorithm
,EditorAlgorithm
public class StressMinimizationLayout extends BackgroundAlgorithm
Layout algorithm performing a stress minimization layout process.
-
Constructor Summary
Constructors Constructor Description StressMinimizationLayout()
Creates a new StressMinimizationLayout instance. -
Method Summary
Modifier and Type Method Description boolean
activeForView(View v)
void
check()
Checks whether all preconditions of the current graph are satisfied.void
execute()
Executes the whole algorithm.String
getCategory()
Returns the category an algorithm should assigned to.String
getDescription()
The algorithm description.String
getName()
Returns the name (ID) of the algorithm.Parameter[]
getParameters()
Deprecated.JComponent
getParameterUI()
boolean
isLayoutAlgorithm()
A LayoutAlgorithm should return true.void
reset()
Resets the internal state of the algorithm.void
resume()
Resumes execution of this algorithm, if the algorithm has been paused.void
setParameters(Parameter[] params)
Deprecated.void
stop()
Stops the execution of the algorithm.Methods inherited from class org.vanted.plugins.layout.stressminimization.BackgroundAlgorithm
addPropertyChangeListener, addPropertyChangeListeners, getLayout, getProgress, getPropertyChangeListener, getStatus, getStatusDescription, isPaused, isStopped, pause, removePropertyChangeListener
Methods inherited from class org.graffiti.plugin.algorithm.AbstractEditorAlgorithm
getIcon, getParameterDialog, getShortName
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
addEdit, attach, canRedo, canUndo, die, doesUndo, getAcceleratorKeyStroke, getActionEvent, getMenuCategory, getPresentationName, getRedoPresentationName, getSetCategory, getUndoPresentationName, isAlwaysExecutable, isSignificant, markExecutionDone, markRedoDone, markUndoDone, mayWorkOnMultipleGraphs, redo, replaceEdit, setActionEvent, showMenuIcon, undo
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graffiti.plugin.algorithm.Algorithm
attach, getAcceleratorKeyStroke, getActionEvent, getMenuCategory, getSetCategory, mayWorkOnMultipleGraphs, setActionEvent, showMenuIcon
-
Constructor Details
-
StressMinimizationLayout
public StressMinimizationLayout()Creates a new StressMinimizationLayout instance.
-
-
Method Details
-
getName
Description copied from interface:Algorithm
Returns the name (ID) of the algorithm.- Returns:
- DOCUMENT ME!
-
getDescription
Description copied from class:AbstractAlgorithm
The algorithm description.- Specified by:
getDescription
in interfaceAlgorithm
- Overrides:
getDescription
in classAbstractAlgorithm
- Returns:
- String, could be HTML-styled.
-
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.- Specified by:
getCategory
in interfaceAlgorithm
- Overrides:
getCategory
in classAbstractAlgorithm
- Returns:
- The category an algorithm should assigned to.
-
isLayoutAlgorithm
public boolean isLayoutAlgorithm()Description copied from interface:Algorithm
A LayoutAlgorithm should return true. All other types of algorithms should return false.- Specified by:
isLayoutAlgorithm
in interfaceAlgorithm
- Overrides:
isLayoutAlgorithm
in classAbstractAlgorithm
- Returns:
-
activeForView
-
check
Checks whether all preconditions of the current graph are satisfied.- Specified by:
check
in interfaceAlgorithm
- Overrides:
check
in classAbstractAlgorithm
- Throws:
PreconditionException
- if the preconditions of the current graph are not satisfied.
-
getParameterUI
- Specified by:
getParameterUI
in classBackgroundAlgorithm
-
getParameters
Deprecated.Returns a list ofParameter
that are set for this algorithm.- Specified by:
getParameters
in interfaceAlgorithm
- Overrides:
getParameters
in classAbstractAlgorithm
- Returns:
- a collection of
Parameter
that are needed by theAlgorithm
.
-
setParameters
Deprecated.Sets the parameters for this algorithm. Must have the same types and order as the array returned bygetParameter
.- Specified by:
setParameters
in interfaceAlgorithm
- Overrides:
setParameters
in classAbstractAlgorithm
- Parameters:
params
- Parameter array
-
reset
public void reset()Resets the internal state of the algorithm.- Specified by:
reset
in interfaceAlgorithm
- Overrides:
reset
in classBackgroundAlgorithm
-
execute
public void execute()Executes the whole algorithm. -
resume
public void resume()Description copied from class:BackgroundAlgorithm
Resumes execution of this algorithm, if the algorithm has been paused.- Overrides:
resume
in classBackgroundAlgorithm
-
stop
public void stop()Description copied from class:BackgroundAlgorithm
Stops the execution of the algorithm. In contrast to pause the algorithm will terminate. reset has to be called before the next execution of the algorithm.- Overrides:
stop
in classBackgroundAlgorithm
-